diff options
author | onefang | 2019-05-19 21:24:15 +1000 |
---|---|---|
committer | onefang | 2019-05-19 21:24:15 +1000 |
commit | 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch) | |
tree | a9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs | |
parent | Add a build script. (diff) | |
download | opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2 opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz |
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs index f45158b..abcb573 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs | |||
@@ -78,7 +78,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
78 | List<SceneObjectGroup> coaObjects = coa.Objects; | 78 | List<SceneObjectGroup> coaObjects = coa.Objects; |
79 | 79 | ||
80 | // m_log.DebugFormat( | 80 | // m_log.DebugFormat( |
81 | // "[COALESCED SCENE OBJECTS SERIALIZER]: Writing {0} objects for coalesced object", | 81 | // "[COALESCED SCENE OBJECTS SERIALIZER]: Writing {0} objects for coalesced object", |
82 | // coaObjects.Count); | 82 | // coaObjects.Count); |
83 | 83 | ||
84 | // This is weak - we're relying on the set of coalesced objects still being identical | 84 | // This is weak - we're relying on the set of coalesced objects still being identical |
@@ -86,9 +86,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
86 | 86 | ||
87 | writer.WriteStartElement("CoalescedObject"); | 87 | writer.WriteStartElement("CoalescedObject"); |
88 | 88 | ||
89 | writer.WriteAttributeString("x", size.X.ToString()); | 89 | writer.WriteAttributeString("x", size.X.ToString(Culture.FormatProvider)); |
90 | writer.WriteAttributeString("y", size.Y.ToString()); | 90 | writer.WriteAttributeString("y", size.Y.ToString(Culture.FormatProvider)); |
91 | writer.WriteAttributeString("z", size.Z.ToString()); | 91 | writer.WriteAttributeString("z", size.Z.ToString(Culture.FormatProvider)); |
92 | 92 | ||
93 | // Embed the offsets into the group XML | 93 | // Embed the offsets into the group XML |
94 | for (int i = 0; i < coaObjects.Count; i++) | 94 | for (int i = 0; i < coaObjects.Count; i++) |
@@ -96,13 +96,13 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
96 | SceneObjectGroup obj = coaObjects[i]; | 96 | SceneObjectGroup obj = coaObjects[i]; |
97 | 97 | ||
98 | // m_log.DebugFormat( | 98 | // m_log.DebugFormat( |
99 | // "[COALESCED SCENE OBJECTS SERIALIZER]: Writing offset for object {0}, {1}", | 99 | // "[COALESCED SCENE OBJECTS SERIALIZER]: Writing offset for object {0}, {1}", |
100 | // i, obj.Name); | 100 | // i, obj.Name); |
101 | 101 | ||
102 | writer.WriteStartElement("SceneObjectGroup"); | 102 | writer.WriteStartElement("SceneObjectGroup"); |
103 | writer.WriteAttributeString("offsetx", offsets[i].X.ToString()); | 103 | writer.WriteAttributeString("offsetx", offsets[i].X.ToString(Culture.FormatProvider)); |
104 | writer.WriteAttributeString("offsety", offsets[i].Y.ToString()); | 104 | writer.WriteAttributeString("offsety", offsets[i].Y.ToString(Culture.FormatProvider)); |
105 | writer.WriteAttributeString("offsetz", offsets[i].Z.ToString()); | 105 | writer.WriteAttributeString("offsetz", offsets[i].Z.ToString(Culture.FormatProvider)); |
106 | 106 | ||
107 | SceneObjectSerializer.ToOriginalXmlFormat(obj, writer, doScriptStates); | 107 | SceneObjectSerializer.ToOriginalXmlFormat(obj, writer, doScriptStates); |
108 | 108 | ||
@@ -133,12 +133,14 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
133 | { | 133 | { |
134 | using (XmlTextReader reader = new XmlTextReader(sr)) | 134 | using (XmlTextReader reader = new XmlTextReader(sr)) |
135 | { | 135 | { |
136 | reader.ProhibitDtd = true; | ||
137 | |||
136 | reader.MoveToContent(); // skip possible xml declaration | 138 | reader.MoveToContent(); // skip possible xml declaration |
137 | 139 | ||
138 | if (reader.Name != "CoalescedObject") | 140 | if (reader.Name != "CoalescedObject") |
139 | { | 141 | { |
140 | // m_log.DebugFormat( | 142 | // m_log.DebugFormat( |
141 | // "[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() root element was {0} so returning false", | 143 | // "[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() root element was {0} so returning false", |
142 | // reader.Name); | 144 | // reader.Name); |
143 | 145 | ||
144 | return false; | 146 | return false; |
@@ -147,6 +149,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
147 | } | 149 | } |
148 | 150 | ||
149 | XmlDocument doc = new XmlDocument(); | 151 | XmlDocument doc = new XmlDocument(); |
152 | doc.XmlResolver=null; | ||
150 | doc.LoadXml(xml); | 153 | doc.LoadXml(xml); |
151 | XmlElement e = (XmlElement)doc.SelectSingleNode("/CoalescedObject"); | 154 | XmlElement e = (XmlElement)doc.SelectSingleNode("/CoalescedObject"); |
152 | if (e == null) | 155 | if (e == null) |
@@ -166,10 +169,10 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
166 | } | 169 | } |
167 | else | 170 | else |
168 | { | 171 | { |
169 | // XXX: Possibly we should fail outright here rather than continuing if a particular component of the | 172 | // XXX: Possibly we should fail outright here rather than continuing if a particular component of the |
170 | // coalesced object fails to load. | 173 | // coalesced object fails to load. |
171 | m_log.WarnFormat( | 174 | m_log.WarnFormat( |
172 | "[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml for component {0} failed. Continuing.", | 175 | "[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml for component {0} failed. Continuing.", |
173 | i); | 176 | i); |
174 | } | 177 | } |
175 | 178 | ||
@@ -178,9 +181,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
178 | } | 181 | } |
179 | catch (Exception e) | 182 | catch (Exception e) |
180 | { | 183 | { |
181 | m_log.Error("[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml failed "); | 184 | m_log.Error("[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml failed ", e); |
182 | //// m_log.Error("[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml failed ", e); | 185 | Util.LogFailedXML("[COALESCED SCENE OBJECTS SERIALIZER]:", xml); |
183 | //// Util.LogFailedXML("[COALESCED SCENE OBJECTS SERIALIZER]:", xml); | ||
184 | return false; | 186 | return false; |
185 | } | 187 | } |
186 | 188 | ||