diff options
author | Justin Clark-Casey (justincc) | 2013-02-08 02:45:30 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-02-08 02:45:30 +0000 |
commit | c2bf91c5e3bda35034a49f4cfacc30f73c0ee688 (patch) | |
tree | 8d402d074557e86169dd1bfbb1e8430bb1a04504 /OpenSim/Region/Framework/Scenes/Serialization | |
parent | On IAR loading, if loading of a coaleseced item entirely fails, then continue... (diff) | |
download | opensim-SC-c2bf91c5e3bda35034a49f4cfacc30f73c0ee688.zip opensim-SC-c2bf91c5e3bda35034a49f4cfacc30f73c0ee688.tar.gz opensim-SC-c2bf91c5e3bda35034a49f4cfacc30f73c0ee688.tar.bz2 opensim-SC-c2bf91c5e3bda35034a49f4cfacc30f73c0ee688.tar.xz |
If a component of a coalesced object fails to deserialization, do not add a null where the object should be.
This prevents a later load IAR failure.
This code is currently only used by IAR loading.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Serialization')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs | 22 |
1 files changed, 18 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 | ||