aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs')
-rw-r--r--OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs41
1 files changed, 36 insertions, 5 deletions
diff --git a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs
index 931898c..19468c3 100644
--- a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs
+++ b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs
@@ -30,6 +30,8 @@ using System.Text;
30using System.Xml; 30using System.Xml;
31using OpenMetaverse; 31using OpenMetaverse;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using log4net;
34using System.Reflection;
33 35
34namespace OpenSim.Framework.Serialization.External 36namespace OpenSim.Framework.Serialization.External
35{ 37{
@@ -38,8 +40,6 @@ namespace OpenSim.Framework.Serialization.External
38 /// </summary> 40 /// </summary>
39 public class RegionSettingsSerializer 41 public class RegionSettingsSerializer
40 { 42 {
41 protected static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding();
42
43 /// <summary> 43 /// <summary>
44 /// Deserialize settings 44 /// Deserialize settings
45 /// </summary> 45 /// </summary>
@@ -48,7 +48,7 @@ namespace OpenSim.Framework.Serialization.External
48 /// <exception cref="System.Xml.XmlException"></exception> 48 /// <exception cref="System.Xml.XmlException"></exception>
49 public static RegionSettings Deserialize(byte[] serializedSettings) 49 public static RegionSettings Deserialize(byte[] serializedSettings)
50 { 50 {
51 return Deserialize(m_asciiEncoding.GetString(serializedSettings, 0, serializedSettings.Length)); 51 return Deserialize(Encoding.ASCII.GetString(serializedSettings, 0, serializedSettings.Length));
52 } 52 }
53 53
54 /// <summary> 54 /// <summary>
@@ -187,7 +187,29 @@ namespace OpenSim.Framework.Serialization.External
187 break; 187 break;
188 } 188 }
189 } 189 }
190 190
191 xtr.ReadEndElement();
192
193 if (xtr.IsStartElement("Telehub"))
194 {
195 xtr.ReadStartElement("Telehub");
196
197 while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement)
198 {
199 switch (xtr.Name)
200 {
201 case "TelehubObject":
202 settings.TelehubObject = UUID.Parse(xtr.ReadElementContentAsString());
203 break;
204 case "SpawnPoint":
205 string str = xtr.ReadElementContentAsString();
206 SpawnPoint sp = SpawnPoint.Parse(str);
207 settings.AddSpawnPoint(sp);
208 break;
209 }
210 }
211 }
212
191 xtr.Close(); 213 xtr.Close();
192 sr.Close(); 214 sr.Close();
193 215
@@ -243,7 +265,16 @@ namespace OpenSim.Framework.Serialization.External
243 xtw.WriteElementString("SunPosition", settings.SunPosition.ToString()); 265 xtw.WriteElementString("SunPosition", settings.SunPosition.ToString());
244 // Note: 'SunVector' isn't saved because this value is owned by the Sun Module, which 266 // Note: 'SunVector' isn't saved because this value is owned by the Sun Module, which
245 // calculates it automatically according to the date and other factors. 267 // calculates it automatically according to the date and other factors.
246 xtw.WriteEndElement(); 268 xtw.WriteEndElement();
269
270 xtw.WriteStartElement("Telehub");
271 if (settings.TelehubObject != UUID.Zero)
272 {
273 xtw.WriteElementString("TelehubObject", settings.TelehubObject.ToString());
274 foreach (SpawnPoint sp in settings.SpawnPoints())
275 xtw.WriteElementString("SpawnPoint", sp.ToString());
276 }
277 xtw.WriteEndElement();
247 278
248 xtw.WriteEndElement(); 279 xtw.WriteEndElement();
249 280