From af6a7cf95df76708d013932d8ef92c9bbeda0e5d Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Tue, 22 Jan 2013 11:59:20 +0200 Subject: Added DynAttrs to the serialized XML format of prims. When copying prims, use deep copy for DynAttrs. --- OpenSim/Framework/DAMap.cs | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/DAMap.cs b/OpenSim/Framework/DAMap.cs index c256230..291c8b8 100644 --- a/OpenSim/Framework/DAMap.cs +++ b/OpenSim/Framework/DAMap.cs @@ -67,7 +67,7 @@ namespace OpenSim.Framework public void ReadXml(string rawXml) { - //System.Console.WriteLine("Trying to deserialize [{0}]", rawXml); + // System.Console.WriteLine("Trying to deserialize [{0}]", rawXml); lock (this) m_map = (OSDMap)OSDParser.DeserializeLLSDXml(rawXml); @@ -87,7 +87,29 @@ namespace OpenSim.Framework public void WriteXml(XmlWriter writer) { 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); + } + } /// /// Returns the number of data stores. -- cgit v1.1