From 032e3b49eb4f669ffb74a0209aefafcc86f4f6c7 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 8 May 2009 15:47:59 +0000 Subject: * refactor: Break out original xml object serialization into a separate class * No functional change --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 93 +--------------------- 1 file changed, 1 insertion(+), 92 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 99e6e1e..b0de405 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -406,96 +406,6 @@ namespace OpenSim.Region.Framework.Scenes SetRootPart(part); } - public SceneObjectGroup(string xmlData, bool isOriginalXmlFormat) - : this(UUID.Zero, xmlData, isOriginalXmlFormat) - { - } - - /// - /// Create an object using serialized data in OpenSim's original xml format. - /// - /// - /// If applicable, the user inventory item id from which this object was rezzed. If not applicable then this - /// should be UUID.Zero - /// - /// - /// - /// This parameter only exists to separate the two different xml constructors. In the future, versions should - /// be specified within the xml itself. - /// - public SceneObjectGroup(UUID fromUserInventoryItemID, string xmlData, bool isOriginalXmlFormat) - { - - if (!isOriginalXmlFormat) - throw new Exception("This constructor must specify the xml is in OpenSim's original format"); - - //m_log.DebugFormat("[SOG]: Starting deserialization of SOG"); - //int time = System.Environment.TickCount; - - // libomv.types changes UUID to Guid - xmlData = xmlData.Replace("", ""); - xmlData = xmlData.Replace("", ""); - - // Handle Nested property - xmlData = xmlData.Replace("", ""); - xmlData = xmlData.Replace("", ""); - - try - { - - StringReader sr; - XmlTextReader reader; - XmlNodeList parts; - XmlDocument doc; - int linkNum; - - doc = new XmlDocument(); - doc.LoadXml(xmlData); - parts = doc.GetElementsByTagName("RootPart"); - - if (parts.Count == 0) - { - throw new Exception("[SCENE] Invalid Xml format - no root part"); - } - else - { - sr = new StringReader(parts[0].InnerXml); - reader = new XmlTextReader(sr); - SetRootPart(SceneObjectPart.FromXml(fromUserInventoryItemID, reader)); - reader.Close(); - sr.Close(); - } - - parts = doc.GetElementsByTagName("Part"); - - for (int i=0; i /// Create an object using serialized data in OpenSim's xml2 format. /// @@ -585,7 +495,7 @@ namespace OpenSim.Region.Framework.Scenes { } - private void LoadScriptState(XmlDocument doc) + public void LoadScriptState(XmlDocument doc) { XmlNodeList nodes = doc.GetElementsByTagName("SavedScriptState"); if (nodes.Count > 0) @@ -745,7 +655,6 @@ namespace OpenSim.Region.Framework.Scenes #endregion - public string ToXmlString() { using (StringWriter sw = new StringWriter()) -- cgit v1.1