diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Serialization')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs | 22 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | 14 |
2 files changed, 32 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs index a4f730d..5cb271d 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs | |||
@@ -42,9 +42,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
42 | /// <summary> | 42 | /// <summary> |
43 | /// Serialize and deserialize coalesced scene objects. | 43 | /// Serialize and deserialize coalesced scene objects. |
44 | /// </summary> | 44 | /// </summary> |
45 | /// <remarks> | ||
46 | /// Deserialization not yet here. | ||
47 | /// </remarks> | ||
48 | public class CoalescedSceneObjectsSerializer | 45 | public class CoalescedSceneObjectsSerializer |
49 | { | 46 | { |
50 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -128,6 +125,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
128 | // m_log.DebugFormat("[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() deserializing {0}", xml); | 125 | // m_log.DebugFormat("[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() deserializing {0}", xml); |
129 | 126 | ||
130 | coa = null; | 127 | coa = null; |
128 | int i = 0; | ||
131 | 129 | ||
132 | using (StringReader sr = new StringReader(xml)) | 130 | using (StringReader sr = new StringReader(xml)) |
133 | { | 131 | { |
@@ -153,7 +151,23 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
153 | if (reader.Name == "SceneObjectGroup") | 151 | if (reader.Name == "SceneObjectGroup") |
154 | { | 152 | { |
155 | string soXml = reader.ReadOuterXml(); | 153 | string soXml = reader.ReadOuterXml(); |
156 | coa.Add(SceneObjectSerializer.FromOriginalXmlFormat(soXml)); | 154 | |
155 | SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(soXml); | ||
156 | |||
157 | if (so != null) | ||
158 | { | ||
159 | coa.Add(so); | ||
160 | } | ||
161 | else | ||
162 | { | ||
163 | // XXX: Possibly we should fail outright here rather than continuing if a particular component of the | ||
164 | // coalesced object fails to load. | ||
165 | m_log.WarnFormat( | ||
166 | "[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml for component {0} failed. Continuing.", | ||
167 | i); | ||
168 | } | ||
169 | |||
170 | i++; | ||
157 | } | 171 | } |
158 | } | 172 | } |
159 | 173 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 2984782..ce4fb40 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -365,6 +365,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
365 | m_SOPXmlProcessors.Add("CollisionSound", ProcessCollisionSound); | 365 | m_SOPXmlProcessors.Add("CollisionSound", ProcessCollisionSound); |
366 | m_SOPXmlProcessors.Add("CollisionSoundVolume", ProcessCollisionSoundVolume); | 366 | m_SOPXmlProcessors.Add("CollisionSoundVolume", ProcessCollisionSoundVolume); |
367 | m_SOPXmlProcessors.Add("MediaUrl", ProcessMediaUrl); | 367 | m_SOPXmlProcessors.Add("MediaUrl", ProcessMediaUrl); |
368 | m_SOPXmlProcessors.Add("DynAttrs", ProcessDynAttrs); | ||
368 | m_SOPXmlProcessors.Add("TextureAnimation", ProcessTextureAnimation); | 369 | m_SOPXmlProcessors.Add("TextureAnimation", ProcessTextureAnimation); |
369 | m_SOPXmlProcessors.Add("ParticleSystem", ProcessParticleSystem); | 370 | m_SOPXmlProcessors.Add("ParticleSystem", ProcessParticleSystem); |
370 | m_SOPXmlProcessors.Add("PayPrice0", ProcessPayPrice0); | 371 | m_SOPXmlProcessors.Add("PayPrice0", ProcessPayPrice0); |
@@ -797,6 +798,11 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
797 | obj.MediaUrl = reader.ReadElementContentAsString("MediaUrl", String.Empty); | 798 | obj.MediaUrl = reader.ReadElementContentAsString("MediaUrl", String.Empty); |
798 | } | 799 | } |
799 | 800 | ||
801 | private static void ProcessDynAttrs(SceneObjectPart obj, XmlTextReader reader) | ||
802 | { | ||
803 | obj.DynAttrs.ReadXml(reader); | ||
804 | } | ||
805 | |||
800 | private static void ProcessTextureAnimation(SceneObjectPart obj, XmlTextReader reader) | 806 | private static void ProcessTextureAnimation(SceneObjectPart obj, XmlTextReader reader) |
801 | { | 807 | { |
802 | obj.TextureAnimation = Convert.FromBase64String(reader.ReadElementContentAsString("TextureAnimation", String.Empty)); | 808 | obj.TextureAnimation = Convert.FromBase64String(reader.ReadElementContentAsString("TextureAnimation", String.Empty)); |
@@ -1339,6 +1345,14 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1339 | writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString()); | 1345 | writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString()); |
1340 | if (sop.MediaUrl != null) | 1346 | if (sop.MediaUrl != null) |
1341 | writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString()); | 1347 | writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString()); |
1348 | |||
1349 | if (sop.DynAttrs.Count > 0) | ||
1350 | { | ||
1351 | writer.WriteStartElement("DynAttrs"); | ||
1352 | sop.DynAttrs.WriteXml(writer); | ||
1353 | writer.WriteEndElement(); | ||
1354 | } | ||
1355 | |||
1342 | WriteBytes(writer, "TextureAnimation", sop.TextureAnimation); | 1356 | WriteBytes(writer, "TextureAnimation", sop.TextureAnimation); |
1343 | WriteBytes(writer, "ParticleSystem", sop.ParticleSystem); | 1357 | WriteBytes(writer, "ParticleSystem", sop.ParticleSystem); |
1344 | writer.WriteElementString("PayPrice0", sop.PayPrice[0].ToString()); | 1358 | writer.WriteElementString("PayPrice0", sop.PayPrice[0].ToString()); |