diff options
author | Justin Clark-Casey (justincc) | 2011-04-21 18:12:29 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-04-21 18:12:29 +0100 |
commit | 63c1b7e4754271ec898592ba6209dbc776469370 (patch) | |
tree | dddf614b34185cb8690997c0328399d07b97d818 | |
parent | Get Viewer 2 voice working with OpenSim. (diff) | |
download | opensim-SC_OLD-63c1b7e4754271ec898592ba6209dbc776469370.zip opensim-SC_OLD-63c1b7e4754271ec898592ba6209dbc776469370.tar.gz opensim-SC_OLD-63c1b7e4754271ec898592ba6209dbc776469370.tar.bz2 opensim-SC_OLD-63c1b7e4754271ec898592ba6209dbc776469370.tar.xz |
Alter uuid gather so that it properly analyzes coalesced objects.
This should correct save all the assets required for the items within the coalesced objects in an IAR. This should also correctly gather the items on hypergrid takes.
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs | 47 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/UuidGatherer.cs | 18 |
2 files changed, 43 insertions, 22 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs index babcb54..55455cc 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/CoalescedSceneObjectsSerializer.cs | |||
@@ -117,29 +117,40 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
117 | { | 117 | { |
118 | using (XmlTextReader reader = new XmlTextReader(sr)) | 118 | using (XmlTextReader reader = new XmlTextReader(sr)) |
119 | { | 119 | { |
120 | reader.Read(); | 120 | try |
121 | if (reader.Name != "CoalescedObject") | ||
122 | { | 121 | { |
123 | // m_log.DebugFormat( | 122 | reader.Read(); |
124 | // "[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() root element was {0} so returning false", | 123 | if (reader.Name != "CoalescedObject") |
125 | // reader.Name); | 124 | { |
125 | // m_log.DebugFormat( | ||
126 | // "[COALESCED SCENE OBJECTS SERIALIZER]: TryFromXml() root element was {0} so returning false", | ||
127 | // reader.Name); | ||
128 | |||
129 | return false; | ||
130 | } | ||
126 | 131 | ||
127 | return false; | 132 | coa = new CoalescedSceneObjects(UUID.Zero); |
128 | } | 133 | reader.Read(); |
129 | 134 | ||
130 | coa = new CoalescedSceneObjects(UUID.Zero); | 135 | while (reader.NodeType != XmlNodeType.EndElement && reader.Name != "CoalescedObject") |
131 | reader.Read(); | ||
132 | |||
133 | while (reader.NodeType != XmlNodeType.EndElement && reader.Name != "CoalescedObject") | ||
134 | { | ||
135 | if (reader.Name == "SceneObjectGroup") | ||
136 | { | 136 | { |
137 | string soXml = reader.ReadOuterXml(); | 137 | if (reader.Name == "SceneObjectGroup") |
138 | coa.Add(SceneObjectSerializer.FromOriginalXmlFormat(soXml)); | 138 | { |
139 | string soXml = reader.ReadOuterXml(); | ||
140 | coa.Add(SceneObjectSerializer.FromOriginalXmlFormat(soXml)); | ||
141 | } | ||
139 | } | 142 | } |
143 | |||
144 | reader.ReadEndElement(); // CoalescedObject | ||
140 | } | 145 | } |
141 | 146 | catch (Exception e) | |
142 | reader.ReadEndElement(); // CoalescedObject | 147 | { |
148 | m_log.ErrorFormat( | ||
149 | "[COALESCED SCENE OBJECTS SERIALIZER]: Deserialization of xml failed with {0} {1}", | ||
150 | e.Message, e.StackTrace); | ||
151 | |||
152 | return false; | ||
153 | } | ||
143 | } | 154 | } |
144 | } | 155 | } |
145 | 156 | ||
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index 83906d7..77b1535 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs | |||
@@ -298,10 +298,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
298 | if (null != objectAsset) | 298 | if (null != objectAsset) |
299 | { | 299 | { |
300 | string xml = Utils.BytesToString(objectAsset.Data); | 300 | string xml = Utils.BytesToString(objectAsset.Data); |
301 | SceneObjectGroup sog = SceneObjectSerializer.FromOriginalXmlFormat(xml); | 301 | |
302 | 302 | CoalescedSceneObjects coa; | |
303 | if (null != sog) | 303 | if (CoalescedSceneObjectsSerializer.TryFromXml(xml, out coa)) |
304 | GatherAssetUuids(sog, assetUuids); | 304 | { |
305 | foreach (SceneObjectGroup sog in coa.Objects) | ||
306 | GatherAssetUuids(sog, assetUuids); | ||
307 | } | ||
308 | else | ||
309 | { | ||
310 | SceneObjectGroup sog = SceneObjectSerializer.FromOriginalXmlFormat(xml); | ||
311 | |||
312 | if (null != sog) | ||
313 | GatherAssetUuids(sog, assetUuids); | ||
314 | } | ||
305 | } | 315 | } |
306 | } | 316 | } |
307 | 317 | ||