aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-02-12 23:13:35 +0000
committerJustin Clark-Casey (justincc)2010-02-12 23:13:35 +0000
commit00800c59d35662d65aeb61a17de0d56fa6196509 (patch)
tree594c2eefcf1806392d6c00cb86cf3b764f1d9f1c /OpenSim/Framework
parentminor: remove completely commented out and unused class (diff)
downloadopensim-SC_OLD-00800c59d35662d65aeb61a17de0d56fa6196509.zip
opensim-SC_OLD-00800c59d35662d65aeb61a17de0d56fa6196509.tar.gz
opensim-SC_OLD-00800c59d35662d65aeb61a17de0d56fa6196509.tar.bz2
opensim-SC_OLD-00800c59d35662d65aeb61a17de0d56fa6196509.tar.xz
Apply last two patches from http://opensimulator.org/mantis/view.php?id=3522
These patch should allow people using systems that do not have their locale set to En_US or similar to use OpenSim without suffering effects such as being a million miles up in the air on login. The problem was caused by parsing strings without forcing that parse to be En_US (hence different decimal and digit group symbols were causing problems). Thanks very much to VikingErik for doing the legwork on this fix and phacelia for spotting it in the first place.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/Services/LoginService.cs4
-rw-r--r--OpenSim/Framework/Culture.cs2
-rw-r--r--OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs24
3 files changed, 15 insertions, 15 deletions
diff --git a/OpenSim/Framework/Communications/Services/LoginService.cs b/OpenSim/Framework/Communications/Services/LoginService.cs
index 57ca704..71b38ed 100644
--- a/OpenSim/Framework/Communications/Services/LoginService.cs
+++ b/OpenSim/Framework/Communications/Services/LoginService.cs
@@ -1015,8 +1015,8 @@ namespace OpenSim.Framework.Communications.Services
1015 } 1015 }
1016 else 1016 else
1017 { 1017 {
1018 theUser.CurrentAgent.Position = new Vector3(float.Parse(uriMatch.Groups["x"].Value), 1018 theUser.CurrentAgent.Position = new Vector3(float.Parse(uriMatch.Groups["x"].Value, Culture.NumberFormatInfo),
1019 float.Parse(uriMatch.Groups["y"].Value), float.Parse(uriMatch.Groups["z"].Value)); 1019 float.Parse(uriMatch.Groups["y"].Value, Culture.NumberFormatInfo), float.Parse(uriMatch.Groups["z"].Value, Culture.NumberFormatInfo));
1020 } 1020 }
1021 } 1021 }
1022 response.LookAt = "[r0,r1,r0]"; 1022 response.LookAt = "[r0,r1,r0]";
diff --git a/OpenSim/Framework/Culture.cs b/OpenSim/Framework/Culture.cs
index 2066794..3d78fac 100644
--- a/OpenSim/Framework/Culture.cs
+++ b/OpenSim/Framework/Culture.cs
@@ -33,7 +33,7 @@ namespace OpenSim.Framework
33{ 33{
34 public class Culture 34 public class Culture
35 { 35 {
36 private static readonly CultureInfo m_cultureInfo = new CultureInfo("en-US", true); 36 private static readonly CultureInfo m_cultureInfo = new CultureInfo("en-US", false);
37 37
38 public static NumberFormatInfo NumberFormatInfo 38 public static NumberFormatInfo NumberFormatInfo
39 { 39 {
diff --git a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs
index b5901e1..6ba4c5a 100644
--- a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs
+++ b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs
@@ -109,7 +109,7 @@ namespace OpenSim.Framework.Serialization.External
109 settings.AgentLimit = int.Parse(xtr.ReadElementContentAsString()); 109 settings.AgentLimit = int.Parse(xtr.ReadElementContentAsString());
110 break; 110 break;
111 case "ObjectBonus": 111 case "ObjectBonus":
112 settings.ObjectBonus = double.Parse(xtr.ReadElementContentAsString()); 112 settings.ObjectBonus = double.Parse(xtr.ReadElementContentAsString(), Culture.NumberFormatInfo);
113 break; 113 break;
114 } 114 }
115 } 115 }
@@ -134,28 +134,28 @@ namespace OpenSim.Framework.Serialization.External
134 settings.TerrainTexture4 = UUID.Parse(xtr.ReadElementContentAsString()); 134 settings.TerrainTexture4 = UUID.Parse(xtr.ReadElementContentAsString());
135 break; 135 break;
136 case "ElevationLowSW": 136 case "ElevationLowSW":
137 settings.Elevation1SW = double.Parse(xtr.ReadElementContentAsString()); 137 settings.Elevation1SW = double.Parse(xtr.ReadElementContentAsString(), Culture.NumberFormatInfo);
138 break; 138 break;
139 case "ElevationLowNW": 139 case "ElevationLowNW":
140 settings.Elevation1NW = double.Parse(xtr.ReadElementContentAsString()); 140 settings.Elevation1NW = double.Parse(xtr.ReadElementContentAsString(), Culture.NumberFormatInfo);
141 break; 141 break;
142 case "ElevationLowSE": 142 case "ElevationLowSE":
143 settings.Elevation1SE = double.Parse(xtr.ReadElementContentAsString()); 143 settings.Elevation1SE = double.Parse(xtr.ReadElementContentAsString(), Culture.NumberFormatInfo);
144 break; 144 break;
145 case "ElevationLowNE": 145 case "ElevationLowNE":
146 settings.Elevation1NE = double.Parse(xtr.ReadElementContentAsString()); 146 settings.Elevation1NE = double.Parse(xtr.ReadElementContentAsString(), Culture.NumberFormatInfo);
147 break; 147 break;
148 case "ElevationHighSW": 148 case "ElevationHighSW":
149 settings.Elevation2SW = double.Parse(xtr.ReadElementContentAsString()); 149 settings.Elevation2SW = double.Parse(xtr.ReadElementContentAsString(), Culture.NumberFormatInfo);
150 break; 150 break;
151 case "ElevationHighNW": 151 case "ElevationHighNW":
152 settings.Elevation2NW = double.Parse(xtr.ReadElementContentAsString()); 152 settings.Elevation2NW = double.Parse(xtr.ReadElementContentAsString(), Culture.NumberFormatInfo);
153 break; 153 break;
154 case "ElevationHighSE": 154 case "ElevationHighSE":
155 settings.Elevation2SE = double.Parse(xtr.ReadElementContentAsString()); 155 settings.Elevation2SE = double.Parse(xtr.ReadElementContentAsString(), Culture.NumberFormatInfo);
156 break; 156 break;
157 case "ElevationHighNE": 157 case "ElevationHighNE":
158 settings.Elevation2NE = double.Parse(xtr.ReadElementContentAsString()); 158 settings.Elevation2NE = double.Parse(xtr.ReadElementContentAsString(), Culture.NumberFormatInfo);
159 break; 159 break;
160 } 160 }
161 } 161 }
@@ -168,13 +168,13 @@ namespace OpenSim.Framework.Serialization.External
168 switch (xtr.Name) 168 switch (xtr.Name)
169 { 169 {
170 case "WaterHeight": 170 case "WaterHeight":
171 settings.WaterHeight = double.Parse(xtr.ReadElementContentAsString()); 171 settings.WaterHeight = double.Parse(xtr.ReadElementContentAsString(), Culture.NumberFormatInfo);
172 break; 172 break;
173 case "TerrainRaiseLimit": 173 case "TerrainRaiseLimit":
174 settings.TerrainRaiseLimit = double.Parse(xtr.ReadElementContentAsString()); 174 settings.TerrainRaiseLimit = double.Parse(xtr.ReadElementContentAsString(), Culture.NumberFormatInfo);
175 break; 175 break;
176 case "TerrainLowerLimit": 176 case "TerrainLowerLimit":
177 settings.TerrainLowerLimit = double.Parse(xtr.ReadElementContentAsString()); 177 settings.TerrainLowerLimit = double.Parse(xtr.ReadElementContentAsString(), Culture.NumberFormatInfo);
178 break; 178 break;
179 case "UseEstateSun": 179 case "UseEstateSun":
180 settings.UseEstateSun = bool.Parse(xtr.ReadElementContentAsString()); 180 settings.UseEstateSun = bool.Parse(xtr.ReadElementContentAsString());