diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 5989879..5ff0d72 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -234,6 +234,45 @@ namespace OpenSim.Region.Environment.Scenes | |||
234 | ScheduleGroupForFullUpdate(); | 234 | ScheduleGroupForFullUpdate(); |
235 | } | 235 | } |
236 | 236 | ||
237 | /// <summary> | ||
238 | /// | ||
239 | /// </summary> | ||
240 | public SceneObjectGroup(string xmlData) | ||
241 | { | ||
242 | StringReader sr = new StringReader(xmlData); | ||
243 | XmlTextReader reader = new XmlTextReader(sr); | ||
244 | reader.Read(); | ||
245 | reader.ReadStartElement("SceneObjectGroup"); | ||
246 | reader.ReadStartElement("RootPart"); | ||
247 | m_rootPart = SceneObjectPart.FromXml(reader); | ||
248 | reader.ReadEndElement(); | ||
249 | |||
250 | while (reader.Read()) | ||
251 | { | ||
252 | switch (reader.NodeType) | ||
253 | { | ||
254 | case XmlNodeType.Element: | ||
255 | if (reader.Name == "Part") | ||
256 | { | ||
257 | reader.Read(); | ||
258 | SceneObjectPart Part = SceneObjectPart.FromXml(reader); | ||
259 | AddPart(Part); | ||
260 | } | ||
261 | break; | ||
262 | case XmlNodeType.EndElement: | ||
263 | break; | ||
264 | } | ||
265 | } | ||
266 | reader.Close(); | ||
267 | sr.Close(); | ||
268 | m_rootPart.SetParent(this); | ||
269 | m_parts.Add(m_rootPart.UUID, m_rootPart); | ||
270 | m_rootPart.ParentID = 0; | ||
271 | UpdateParentIDs(); | ||
272 | |||
273 | ScheduleGroupForFullUpdate(); | ||
274 | } | ||
275 | |||
237 | private void AttachToBackup() | 276 | private void AttachToBackup() |
238 | { | 277 | { |
239 | if (InSceneBackup) | 278 | if (InSceneBackup) |