diff options
author | UbitUmarov | 2018-10-06 23:42:24 +0100 |
---|---|---|
committer | UbitUmarov | 2018-10-06 23:47:56 +0100 |
commit | eb5fe57a17ada01885fbc5bb5ea543d109dab7ec (patch) | |
tree | b5ad4b3018e39ed3074e59bfff7e35bf5ce1d837 /OpenSim/Framework | |
parent | mantis 8384: try to fix bullet heimap managed memory sharing with unmanaged lib (diff) | |
download | opensim-SC-eb5fe57a17ada01885fbc5bb5ea543d109dab7ec.zip opensim-SC-eb5fe57a17ada01885fbc5bb5ea543d109dab7ec.tar.gz opensim-SC-eb5fe57a17ada01885fbc5bb5ea543d109dab7ec.tar.bz2 opensim-SC-eb5fe57a17ada01885fbc5bb5ea543d109dab7ec.tar.xz |
more use of simpler xml encoder on inventory fetch, plus other cosmetics
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Culture.cs | 67 | ||||
-rw-r--r-- | OpenSim/Framework/InventoryCollection.cs | 1 | ||||
-rw-r--r-- | OpenSim/Framework/LLSDxmlEncode.cs | 18 |
3 files changed, 11 insertions, 75 deletions
diff --git a/OpenSim/Framework/Culture.cs b/OpenSim/Framework/Culture.cs index 1a44660..483f735 100644 --- a/OpenSim/Framework/Culture.cs +++ b/OpenSim/Framework/Culture.cs | |||
@@ -1,66 +1 @@ | |||
1 | /* | /* * Copyright (c) Contributors, http://opensimulator.org/ * See CONTRIBUTORS.TXT for a full list of copyright holders. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the OpenSimulator Project nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ using System; using System.Globalization; using System.Threading; namespace OpenSim.Framework { public class Culture { private static readonly CultureInfo m_cultureInfo = new CultureInfo("en-US", false); public static NumberFormatInfo NumberFormatInfo { get { return m_cultureInfo.NumberFormat; } } public static IFormatProvider FormatProvider { get { return m_cultureInfo; } } /// <summary> /// Set Culture to en-US to make string processing of numbers simpler. /// </summary> public static void SetCurrentCulture() { Thread.CurrentThread.CurrentCulture = m_cultureInfo; } public static void SetDefaultCurrentCulture() { CultureInfo.DefaultThreadCurrentCulture = m_cultureInfo; } public static CultureInfo GetDefaultCurrentCulture() { return CultureInfo.DefaultThreadCurrentCulture; } } } \ No newline at end of file | |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Globalization; | ||
30 | using System.Threading; | ||
31 | |||
32 | namespace OpenSim.Framework | ||
33 | { | ||
34 | public class Culture | ||
35 | { | ||
36 | private static readonly CultureInfo m_cultureInfo = new CultureInfo("en-US", false); | ||
37 | |||
38 | public static NumberFormatInfo NumberFormatInfo | ||
39 | { | ||
40 | get { return m_cultureInfo.NumberFormat; } | ||
41 | } | ||
42 | |||
43 | public static IFormatProvider FormatProvider | ||
44 | { | ||
45 | get { return m_cultureInfo; } | ||
46 | } | ||
47 | |||
48 | /// <summary> | ||
49 | /// Set Culture to en-US to make string processing of numbers simpler. | ||
50 | /// </summary> | ||
51 | public static void SetCurrentCulture() | ||
52 | { | ||
53 | Thread.CurrentThread.CurrentCulture = m_cultureInfo; | ||
54 | } | ||
55 | |||
56 | public static void SetDefaultCurrentCulture() | ||
57 | { | ||
58 | CultureInfo.DefaultThreadCurrentCulture = m_cultureInfo; | ||
59 | } | ||
60 | |||
61 | public static CultureInfo GetDefaultCurrentCulture() | ||
62 | { | ||
63 | return CultureInfo.DefaultThreadCurrentCulture; | ||
64 | } | ||
65 | } | ||
66 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/InventoryCollection.cs b/OpenSim/Framework/InventoryCollection.cs index 59655eb..a55a1cb 100644 --- a/OpenSim/Framework/InventoryCollection.cs +++ b/OpenSim/Framework/InventoryCollection.cs | |||
@@ -40,5 +40,6 @@ namespace OpenSim.Framework | |||
40 | public UUID OwnerID; | 40 | public UUID OwnerID; |
41 | public UUID FolderID; | 41 | public UUID FolderID; |
42 | public int Version; | 42 | public int Version; |
43 | public int Descendents; | ||
43 | } | 44 | } |
44 | } | 45 | } |
diff --git a/OpenSim/Framework/LLSDxmlEncode.cs b/OpenSim/Framework/LLSDxmlEncode.cs index ed5c4db..35fc964 100644 --- a/OpenSim/Framework/LLSDxmlEncode.cs +++ b/OpenSim/Framework/LLSDxmlEncode.cs | |||
@@ -159,7 +159,7 @@ namespace OpenSim.Framework | |||
159 | else | 159 | else |
160 | { | 160 | { |
161 | sb.Append("<real>"); | 161 | sb.Append("<real>"); |
162 | sb.Append(e.ToString(CultureInfo.InvariantCulture)); | 162 | sb.Append(e.ToString(CultureInfo.InvariantCulture)); |
163 | sb.Append("</real>"); | 163 | sb.Append("</real>"); |
164 | } | 164 | } |
165 | } | 165 | } |
@@ -173,7 +173,7 @@ namespace OpenSim.Framework | |||
173 | else | 173 | else |
174 | { | 174 | { |
175 | sb.Append("<real>"); | 175 | sb.Append("<real>"); |
176 | sb.Append(e.X.ToString(CultureInfo.InvariantCulture)); | 176 | sb.Append(e.X.ToString(CultureInfo.InvariantCulture)); |
177 | sb.Append("</real><key>y</key>"); | 177 | sb.Append("</real><key>y</key>"); |
178 | } | 178 | } |
179 | 179 | ||
@@ -196,7 +196,7 @@ namespace OpenSim.Framework | |||
196 | else | 196 | else |
197 | { | 197 | { |
198 | sb.Append("<real>"); | 198 | sb.Append("<real>"); |
199 | sb.Append(e.X.ToString(CultureInfo.InvariantCulture)); | 199 | sb.Append(e.X.ToString(CultureInfo.InvariantCulture)); |
200 | sb.Append("</real><key>y</key>"); | 200 | sb.Append("</real><key>y</key>"); |
201 | } | 201 | } |
202 | 202 | ||
@@ -228,7 +228,7 @@ namespace OpenSim.Framework | |||
228 | else | 228 | else |
229 | { | 229 | { |
230 | sb.Append("<real>"); | 230 | sb.Append("<real>"); |
231 | sb.Append(e.X.ToString(CultureInfo.InvariantCulture)); | 231 | sb.Append(e.X.ToString(CultureInfo.InvariantCulture)); |
232 | sb.Append("</real><key>y</key>"); | 232 | sb.Append("</real><key>y</key>"); |
233 | } | 233 | } |
234 | 234 | ||
@@ -347,7 +347,7 @@ namespace OpenSim.Framework | |||
347 | else | 347 | else |
348 | format = "yyyy-MM-ddTHH:mm:ssZ"; | 348 | format = "yyyy-MM-ddTHH:mm:ssZ"; |
349 | sb.Append("<date>"); | 349 | sb.Append("<date>"); |
350 | sb.Append(u.ToString(format,CultureInfo.InvariantCulture)); | 350 | sb.Append(u.ToString(format,CultureInfo.InvariantCulture)); |
351 | sb.Append("</date>"); | 351 | sb.Append("</date>"); |
352 | } | 352 | } |
353 | 353 | ||
@@ -478,7 +478,7 @@ namespace OpenSim.Framework | |||
478 | else | 478 | else |
479 | { | 479 | { |
480 | sb.Append("<real>"); | 480 | sb.Append("<real>"); |
481 | sb.Append(e.X.ToString(CultureInfo.InvariantCulture)); | 481 | sb.Append(e.X.ToString(CultureInfo.InvariantCulture)); |
482 | sb.Append("</real><key>y</key>"); | 482 | sb.Append("</real><key>y</key>"); |
483 | } | 483 | } |
484 | 484 | ||
@@ -503,7 +503,7 @@ namespace OpenSim.Framework | |||
503 | else | 503 | else |
504 | { | 504 | { |
505 | sb.Append("<real>"); | 505 | sb.Append("<real>"); |
506 | sb.Append(e.X.ToString(CultureInfo.InvariantCulture)); | 506 | sb.Append(e.X.ToString(CultureInfo.InvariantCulture)); |
507 | sb.Append("</real><key>y</key>"); | 507 | sb.Append("</real><key>y</key>"); |
508 | } | 508 | } |
509 | 509 | ||
@@ -537,7 +537,7 @@ namespace OpenSim.Framework | |||
537 | else | 537 | else |
538 | { | 538 | { |
539 | sb.Append("<real>"); | 539 | sb.Append("<real>"); |
540 | sb.Append(e.X.ToString(CultureInfo.InvariantCulture)); | 540 | sb.Append(e.X.ToString(CultureInfo.InvariantCulture)); |
541 | sb.Append("</real><key>y</key>"); | 541 | sb.Append("</real><key>y</key>"); |
542 | } | 542 | } |
543 | 543 | ||
@@ -680,7 +680,7 @@ namespace OpenSim.Framework | |||
680 | else | 680 | else |
681 | format = "yyyy-MM-ddTHH:mm:ssZ"; | 681 | format = "yyyy-MM-ddTHH:mm:ssZ"; |
682 | sb.Append("<date>"); | 682 | sb.Append("<date>"); |
683 | sb.Append(u.ToString(format,CultureInfo.InvariantCulture)); | 683 | sb.Append(u.ToString(format,CultureInfo.InvariantCulture)); |
684 | sb.Append("</date>"); | 684 | sb.Append("</date>"); |
685 | } | 685 | } |
686 | 686 | ||