From af7c6c5f39dc05dccb891e7bc19ec158de7718a9 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Fri, 2 Sep 2011 00:50:16 +0100 Subject: [PATCH] stop passing FromUserInventoryItemID right down into the deserializer. the code becomes simpler if this is set from the outside - only one place needs to do this. --- .../InventoryAccess/InventoryAccessModule.cs | 6 ++---- .../Region/Framework/Scenes/SceneObjectPart.cs | 15 ++------------- .../Serialization/SceneObjectSerializer.cs | 16 +++------------- 3 files changed, 7 insertions(+), 30 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index f8515b49ae..e6b58b3693 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -732,8 +732,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess XmlElement e = (XmlElement)doc.SelectSingleNode("/CoalescedObject"); if (e == null || attachment) // Single { - SceneObjectGroup g = - SceneObjectSerializer.FromOriginalXmlFormat(UUID.Zero, xmlData); + SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); objlist.Add(g); veclist.Add(new Vector3(0, 0, 0)); @@ -762,8 +761,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess XmlNodeList groups = e.SelectNodes("SceneObjectGroup"); foreach (XmlNode n in groups) { - SceneObjectGroup g = - SceneObjectSerializer.FromOriginalXmlFormat(UUID.Zero, n.OuterXml); + SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(n.OuterXml); objlist.Add(g); XmlElement el = (XmlElement)n; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 9d573dbd78..04fef83961 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1903,23 +1903,12 @@ namespace OpenSim.Region.Framework.Scenes /// /// public static SceneObjectPart FromXml(XmlTextReader xmlReader) - { - return FromXml(UUID.Zero, xmlReader); - } - - /// - /// Restore this part from the serialized xml representation. - /// - /// The inventory id from which this part came, if applicable - /// - /// - public static SceneObjectPart FromXml(UUID fromUserInventoryItemId, XmlTextReader xmlReader) { SceneObjectPart part = SceneObjectSerializer.Xml2ToSOP(xmlReader); - part.m_fromUserInventoryItemID = fromUserInventoryItemId; // for tempOnRez objects, we have to fix the Expire date. - if ((part.Flags & PrimFlags.TemporaryOnRez) != 0) part.ResetExpire(); + if ((part.Flags & PrimFlags.TemporaryOnRez) != 0) + part.ResetExpire(); return part; } diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index a60ee9bd84..e06a222b15 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs @@ -53,19 +53,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization /// /// Deserialize a scene object from the original xml format /// - /// + /// /// - public static SceneObjectGroup FromOriginalXmlFormat(string serialization) - { - return FromOriginalXmlFormat(UUID.Zero, serialization); - } - - /// - /// Deserialize a scene object from the original xml format - /// - /// - /// - public static SceneObjectGroup FromOriginalXmlFormat(UUID fromUserInventoryItemID, string xmlData) + public static SceneObjectGroup FromOriginalXmlFormat(string xmlData) { //m_log.DebugFormat("[SOG]: Starting deserialization of SOG"); //int time = System.Environment.TickCount; @@ -87,7 +77,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization sr = new StringReader(parts[0].InnerXml); reader = new XmlTextReader(sr); - SceneObjectGroup sceneObject = new SceneObjectGroup(SceneObjectPart.FromXml(fromUserInventoryItemID, reader)); + SceneObjectGroup sceneObject = new SceneObjectGroup(SceneObjectPart.FromXml(reader)); reader.Close(); sr.Close();