mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
Merge branch 'dynamic-attributes2'
This commit is contained in:
@@ -37,6 +37,7 @@ using System.Xml.Serialization;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
using OpenMetaverse.StructuredData;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes.Scripting;
|
||||
@@ -124,6 +125,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// Dynamic attributes can be created and deleted as required.
|
||||
/// </summary>
|
||||
public DAMap DynAttrs { get; set; }
|
||||
|
||||
/// <value>
|
||||
/// Is this a root part?
|
||||
/// </value>
|
||||
@@ -335,6 +341,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_particleSystem = Utils.EmptyBytes;
|
||||
Rezzed = DateTime.UtcNow;
|
||||
Description = String.Empty;
|
||||
DynAttrs = new DAMap();
|
||||
|
||||
// Prims currently only contain a single folder (Contents). From looking at the Second Life protocol,
|
||||
// this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from
|
||||
@@ -1618,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)
|
||||
{
|
||||
/*
|
||||
@@ -4598,4 +4607,4 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user