diff options
Diffstat (limited to 'OpenSim/Framework/Serialization/External/LandDataSerializer.cs')
-rw-r--r-- | OpenSim/Framework/Serialization/External/LandDataSerializer.cs | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs index a64f01c..709b516 100644 --- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs +++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs | |||
@@ -93,6 +93,8 @@ namespace OpenSim.Framework.Serialization.External | |||
93 | "MediaURL", (ld, xtr) => ld.MediaURL = xtr.ReadElementString("MediaURL")); | 93 | "MediaURL", (ld, xtr) => ld.MediaURL = xtr.ReadElementString("MediaURL")); |
94 | m_ldProcessors.Add( | 94 | m_ldProcessors.Add( |
95 | "MusicURL", (ld, xtr) => ld.MusicURL = xtr.ReadElementString("MusicURL")); | 95 | "MusicURL", (ld, xtr) => ld.MusicURL = xtr.ReadElementString("MusicURL")); |
96 | m_ldProcessors.Add( | ||
97 | "OwnerID", (ld, xtr) => ld.OwnerID = UUID.Parse(xtr.ReadElementString("OwnerID"))); | ||
96 | 98 | ||
97 | m_ldProcessors.Add( | 99 | m_ldProcessors.Add( |
98 | "ParcelAccessList", ProcessParcelAccessList); | 100 | "ParcelAccessList", ProcessParcelAccessList); |
@@ -186,7 +188,16 @@ namespace OpenSim.Framework.Serialization.External | |||
186 | return landData; | 188 | return landData; |
187 | } | 189 | } |
188 | 190 | ||
189 | public static string Serialize(LandData landData) | 191 | /// <summary> |
192 | /// Serialize land data | ||
193 | /// </summary> | ||
194 | /// <param name='landData'></param> | ||
195 | /// <param name='options'> | ||
196 | /// Serialization options. | ||
197 | /// Can be null if there are no options. | ||
198 | /// "wipe-owners" will write UUID.Zero rather than the ownerID so that a later reload loads all parcels with the estate owner as the owner | ||
199 | /// </param> | ||
200 | public static string Serialize(LandData landData, Dictionary<string, object> options) | ||
190 | { | 201 | { |
191 | StringWriter sw = new StringWriter(); | 202 | StringWriter sw = new StringWriter(); |
192 | XmlTextWriter xtw = new XmlTextWriter(sw); | 203 | XmlTextWriter xtw = new XmlTextWriter(sw); |
@@ -215,7 +226,14 @@ namespace OpenSim.Framework.Serialization.External | |||
215 | xtw.WriteElementString("MediaID", landData.MediaID.ToString()); | 226 | xtw.WriteElementString("MediaID", landData.MediaID.ToString()); |
216 | xtw.WriteElementString("MediaURL", landData.MediaURL); | 227 | xtw.WriteElementString("MediaURL", landData.MediaURL); |
217 | xtw.WriteElementString("MusicURL", landData.MusicURL); | 228 | xtw.WriteElementString("MusicURL", landData.MusicURL); |
218 | xtw.WriteElementString("OwnerID", landData.OwnerID.ToString()); | 229 | |
230 | UUID ownerIdToWrite; | ||
231 | if (options != null && options.ContainsKey("wipe-owners")) | ||
232 | ownerIdToWrite = UUID.Zero; | ||
233 | else | ||
234 | ownerIdToWrite = landData.OwnerID; | ||
235 | |||
236 | xtw.WriteElementString("OwnerID", ownerIdToWrite.ToString()); | ||
219 | 237 | ||
220 | xtw.WriteStartElement("ParcelAccessList"); | 238 | xtw.WriteStartElement("ParcelAccessList"); |
221 | foreach (LandAccessEntry pal in landData.ParcelAccessList) | 239 | foreach (LandAccessEntry pal in landData.ParcelAccessList) |