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.
remove-scene-viewer
Justin Clark-Casey (justincc) 2011-09-02 00:50:16 +01:00
parent 9c0a03731d
commit af7c6c5f39
3 changed files with 7 additions and 30 deletions

View File

@ -732,8 +732,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
XmlElement e = (XmlElement)doc.SelectSingleNode("/CoalescedObject"); XmlElement e = (XmlElement)doc.SelectSingleNode("/CoalescedObject");
if (e == null || attachment) // Single if (e == null || attachment) // Single
{ {
SceneObjectGroup g = SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
SceneObjectSerializer.FromOriginalXmlFormat(UUID.Zero, xmlData);
objlist.Add(g); objlist.Add(g);
veclist.Add(new Vector3(0, 0, 0)); veclist.Add(new Vector3(0, 0, 0));
@ -762,8 +761,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
XmlNodeList groups = e.SelectNodes("SceneObjectGroup"); XmlNodeList groups = e.SelectNodes("SceneObjectGroup");
foreach (XmlNode n in groups) foreach (XmlNode n in groups)
{ {
SceneObjectGroup g = SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(n.OuterXml);
SceneObjectSerializer.FromOriginalXmlFormat(UUID.Zero, n.OuterXml);
objlist.Add(g); objlist.Add(g);
XmlElement el = (XmlElement)n; XmlElement el = (XmlElement)n;

View File

@ -1903,23 +1903,12 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="xmlReader"></param> /// <param name="xmlReader"></param>
/// <returns></returns> /// <returns></returns>
public static SceneObjectPart FromXml(XmlTextReader xmlReader) public static SceneObjectPart FromXml(XmlTextReader xmlReader)
{
return FromXml(UUID.Zero, xmlReader);
}
/// <summary>
/// Restore this part from the serialized xml representation.
/// </summary>
/// <param name="fromUserInventoryItemId">The inventory id from which this part came, if applicable</param>
/// <param name="xmlReader"></param>
/// <returns></returns>
public static SceneObjectPart FromXml(UUID fromUserInventoryItemId, XmlTextReader xmlReader)
{ {
SceneObjectPart part = SceneObjectSerializer.Xml2ToSOP(xmlReader); SceneObjectPart part = SceneObjectSerializer.Xml2ToSOP(xmlReader);
part.m_fromUserInventoryItemID = fromUserInventoryItemId;
// for tempOnRez objects, we have to fix the Expire date. // 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; return part;
} }

View File

@ -53,19 +53,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
/// <summary> /// <summary>
/// Deserialize a scene object from the original xml format /// Deserialize a scene object from the original xml format
/// </summary> /// </summary>
/// <param name="serialization"></param> /// <param name="xmlData"></param>
/// <returns></returns> /// <returns></returns>
public static SceneObjectGroup FromOriginalXmlFormat(string serialization) public static SceneObjectGroup FromOriginalXmlFormat(string xmlData)
{
return FromOriginalXmlFormat(UUID.Zero, serialization);
}
/// <summary>
/// Deserialize a scene object from the original xml format
/// </summary>
/// <param name="serialization"></param>
/// <returns></returns>
public static SceneObjectGroup FromOriginalXmlFormat(UUID fromUserInventoryItemID, string xmlData)
{ {
//m_log.DebugFormat("[SOG]: Starting deserialization of SOG"); //m_log.DebugFormat("[SOG]: Starting deserialization of SOG");
//int time = System.Environment.TickCount; //int time = System.Environment.TickCount;
@ -87,7 +77,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
sr = new StringReader(parts[0].InnerXml); sr = new StringReader(parts[0].InnerXml);
reader = new XmlTextReader(sr); reader = new XmlTextReader(sr);
SceneObjectGroup sceneObject = new SceneObjectGroup(SceneObjectPart.FromXml(fromUserInventoryItemID, reader)); SceneObjectGroup sceneObject = new SceneObjectGroup(SceneObjectPart.FromXml(reader));
reader.Close(); reader.Close();
sr.Close(); sr.Close();