Added DynAttrs to the serialized XML format of prims. When copying prims, use deep copy for DynAttrs.

user_profiles
Oren Hurvitz 2013-01-22 11:59:20 +02:00 committed by Justin Clark-Casey (justincc)
parent 86802bcf93
commit af6a7cf95d
3 changed files with 40 additions and 2 deletions

View File

@ -89,6 +89,28 @@ namespace OpenSim.Framework
writer.WriteRaw(ToXml());
}
public void CopyFrom(DAMap other)
{
// Deep copy
string data = null;
lock (other)
{
if (other.Count > 0)
{
data = OSDParser.SerializeLLSDXmlString(other.m_map);
}
}
lock (this)
{
if (data == null)
Clear();
else
m_map = (OSDMap)OSDParser.DeserializeLLSDXml(data);
}
}
/// <summary>
/// Returns the number of data stores.
/// </summary>

View File

@ -1625,6 +1625,8 @@ namespace OpenSim.Region.Framework.Scenes
Array.Copy(Shape.ExtraParams, extraP, extraP.Length);
dupe.Shape.ExtraParams = extraP;
dupe.DynAttrs.CopyFrom(DynAttrs);
if (userExposed)
{
/*

View File

@ -359,6 +359,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
m_SOPXmlProcessors.Add("CollisionSound", ProcessCollisionSound);
m_SOPXmlProcessors.Add("CollisionSoundVolume", ProcessCollisionSoundVolume);
m_SOPXmlProcessors.Add("MediaUrl", ProcessMediaUrl);
m_SOPXmlProcessors.Add("DynAttrs", ProcessDynAttrs);
m_SOPXmlProcessors.Add("TextureAnimation", ProcessTextureAnimation);
m_SOPXmlProcessors.Add("ParticleSystem", ProcessParticleSystem);
m_SOPXmlProcessors.Add("PayPrice0", ProcessPayPrice0);
@ -722,6 +723,11 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
obj.MediaUrl = reader.ReadElementContentAsString("MediaUrl", String.Empty);
}
private static void ProcessDynAttrs(SceneObjectPart obj, XmlTextReader reader)
{
obj.DynAttrs.ReadXml(reader);
}
private static void ProcessTextureAnimation(SceneObjectPart obj, XmlTextReader reader)
{
obj.TextureAnimation = Convert.FromBase64String(reader.ReadElementContentAsString("TextureAnimation", String.Empty));
@ -1235,6 +1241,14 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString());
if (sop.MediaUrl != null)
writer.WriteElementString("MediaUrl", sop.MediaUrl.ToString());
if (sop.DynAttrs.Count > 0)
{
writer.WriteStartElement("DynAttrs");
sop.DynAttrs.WriteXml(writer);
writer.WriteEndElement();
}
WriteBytes(writer, "TextureAnimation", sop.TextureAnimation);
WriteBytes(writer, "ParticleSystem", sop.ParticleSystem);
writer.WriteElementString("PayPrice0", sop.PayPrice[0].ToString());