mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Add coalesced scene objects class and serializer. This is currently only used by the TestRezCoalescedObject() regression test.
This structure matches the existing one for SceneObjects and will allow code to be reused by the uuid gatherer, other tests, etc. Test is not yet fully implemented due to a bug in rezzing coalesced objects where they all get the same name as the item. Only one object should get the same name as the item, which appears to be the one selected last when the the objects were coalesced in the first place. This bug will be addressed shortly.
This commit is contained in:
@@ -139,6 +139,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
return sw.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Serialize a scene object to the original xml format
|
||||
@@ -146,11 +147,25 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
/// <param name="sceneObject"></param>
|
||||
/// <returns></returns>
|
||||
public static void ToOriginalXmlFormat(SceneObjectGroup sceneObject, XmlTextWriter writer)
|
||||
{
|
||||
ToOriginalXmlFormat(sceneObject, writer, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Serialize a scene object to the original xml format
|
||||
/// </summary>
|
||||
/// <param name="sceneObject"></param>
|
||||
/// <param name="writer"></param>
|
||||
/// <param name="noRootElement">If false, don't write the enclosing SceneObjectGroup element</param>
|
||||
/// <returns></returns>
|
||||
public static void ToOriginalXmlFormat(SceneObjectGroup sceneObject, XmlTextWriter writer, bool noRootElement)
|
||||
{
|
||||
//m_log.DebugFormat("[SERIALIZER]: Starting serialization of {0}", Name);
|
||||
//int time = System.Environment.TickCount;
|
||||
|
||||
writer.WriteStartElement(String.Empty, "SceneObjectGroup", String.Empty);
|
||||
if (!noRootElement)
|
||||
writer.WriteStartElement(String.Empty, "SceneObjectGroup", String.Empty);
|
||||
|
||||
writer.WriteStartElement(String.Empty, "RootPart", String.Empty);
|
||||
ToXmlFormat(sceneObject.RootPart, writer);
|
||||
writer.WriteEndElement();
|
||||
@@ -170,10 +185,12 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
|
||||
writer.WriteEndElement(); // OtherParts
|
||||
sceneObject.SaveScriptedState(writer);
|
||||
writer.WriteEndElement(); // SceneObjectGroup
|
||||
|
||||
if (!noRootElement)
|
||||
writer.WriteEndElement(); // SceneObjectGroup
|
||||
|
||||
//m_log.DebugFormat("[SERIALIZER]: Finished serialization of SOG {0}, {1}ms", Name, System.Environment.TickCount - time);
|
||||
}
|
||||
}
|
||||
|
||||
protected static void ToXmlFormat(SceneObjectPart part, XmlTextWriter writer)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user