diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index cceb444..fd2d746 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -407,78 +407,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
407 | } | 407 | } |
408 | 408 | ||
409 | /// <summary> | 409 | /// <summary> |
410 | /// Create an object using serialized data in OpenSim's xml2 format. | ||
411 | /// </summary> | ||
412 | public SceneObjectGroup(string xmlData) | ||
413 | { | ||
414 | SetFromXml(xmlData); | ||
415 | } | ||
416 | |||
417 | protected void SetFromXml(string xmlData) | ||
418 | { | ||
419 | |||
420 | //m_log.DebugFormat("[SOG]: Starting deserialization of SOG"); | ||
421 | //int time = System.Environment.TickCount; | ||
422 | |||
423 | // libomv.types changes UUID to Guid | ||
424 | xmlData = xmlData.Replace("<UUID>", "<Guid>"); | ||
425 | xmlData = xmlData.Replace("</UUID>", "</Guid>"); | ||
426 | |||
427 | // Handle Nested <UUID><UUID> property | ||
428 | xmlData = xmlData.Replace("<Guid><Guid>", "<UUID><Guid>"); | ||
429 | xmlData = xmlData.Replace("</Guid></Guid>", "</Guid></UUID>"); | ||
430 | |||
431 | try | ||
432 | { | ||
433 | |||
434 | XmlDocument doc = new XmlDocument(); | ||
435 | doc.LoadXml(xmlData); | ||
436 | |||
437 | XmlNodeList parts = doc.GetElementsByTagName("SceneObjectPart"); | ||
438 | |||
439 | // Process the root part first | ||
440 | if (parts.Count > 0) | ||
441 | { | ||
442 | StringReader sr = new StringReader(parts[0].OuterXml); | ||
443 | XmlTextReader reader = new XmlTextReader(sr); | ||
444 | SetRootPart(CreatePartFromXml(reader)); | ||
445 | reader.Close(); | ||
446 | sr.Close(); | ||
447 | } | ||
448 | |||
449 | // Then deal with the rest | ||
450 | for (int i=1; i<parts.Count; i++) | ||
451 | { | ||
452 | StringReader sr = new StringReader(parts[i].OuterXml); | ||
453 | XmlTextReader reader = new XmlTextReader(sr); | ||
454 | SceneObjectPart part = CreatePartFromXml(reader); | ||
455 | AddPart(part); | ||
456 | part.StoreUndoState(); | ||
457 | reader.Close(); | ||
458 | sr.Close(); | ||
459 | } | ||
460 | |||
461 | // Script state may, or may not, exist. Not having any, is NOT | ||
462 | // ever a problem. | ||
463 | |||
464 | LoadScriptState(doc); | ||
465 | |||
466 | } | ||
467 | catch (Exception e) | ||
468 | { | ||
469 | m_log.ErrorFormat("[SCENE]: Deserialization of xml failed with {0}. xml was {1}", e, xmlData); | ||
470 | } | ||
471 | |||
472 | //m_log.DebugFormat("[SOG]: Finished deserialization of SOG {0}, {1}ms", Name, System.Environment.TickCount - time); | ||
473 | } | ||
474 | |||
475 | protected virtual SceneObjectPart CreatePartFromXml(XmlTextReader reader) | ||
476 | { | ||
477 | SceneObjectPart part = SceneObjectPart.FromXml(reader); | ||
478 | return part; | ||
479 | } | ||
480 | |||
481 | /// <summary> | ||
482 | /// Constructor. This object is added to the scene later via AttachToScene() | 410 | /// Constructor. This object is added to the scene later via AttachToScene() |
483 | /// </summary> | 411 | /// </summary> |
484 | public SceneObjectGroup(UUID ownerID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape) | 412 | public SceneObjectGroup(UUID ownerID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape) |