From 279e0061c515ee0a03036bef68eea9738273d785 Mon Sep 17 00:00:00 2001 From: Johan Berntsson Date: Tue, 4 Mar 2008 05:31:54 +0000 Subject: Merged 3Di code that provides scene and avatar serialization, and plugin support for region move/split/merge. See ThirdParty/3Di/README.txt. Unless the new modules are used there should be no noticeable changes when running OpenSim. --- .../Region/Environment/Scenes/AvatarAppearance.cs | 49 ++++++++++++++++++++-- 1 file changed, 46 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/AvatarAppearance.cs') diff --git a/OpenSim/Region/Environment/Scenes/AvatarAppearance.cs b/OpenSim/Region/Environment/Scenes/AvatarAppearance.cs index b54f777..fcc8fdf 100644 --- a/OpenSim/Region/Environment/Scenes/AvatarAppearance.cs +++ b/OpenSim/Region/Environment/Scenes/AvatarAppearance.cs @@ -26,13 +26,16 @@ * */ +using System; using libsecondlife; using libsecondlife.Packets; using OpenSim.Framework; - +using System.Runtime.Serialization; +using System.Security.Permissions; namespace OpenSim.Region.Environment.Scenes { - public class AvatarAppearance + [Serializable] + public class AvatarAppearance : ISerializable { protected LLUUID m_scenePresenceID; @@ -149,5 +152,45 @@ namespace OpenSim.Region.Environment.Scenes textu.CreateFace(6).TextureID = new LLUUID("00000000-0000-1111-9999-000000000011"); return textu; } + + protected AvatarAppearance(SerializationInfo info, StreamingContext context) + { + //System.Console.WriteLine("AvatarAppearance Deserialize BGN"); + + if (info == null) + { + throw new System.ArgumentNullException("info"); + } + + m_scenePresenceID = new LLUUID((Guid)info.GetValue("m_scenePresenceID", typeof(Guid))); + m_wearablesSerial = (int)info.GetValue("m_wearablesSerial", typeof(int)); + m_visualParams = (byte[])info.GetValue("m_visualParams", typeof(byte[])); + m_wearables = (AvatarWearable[])info.GetValue("m_wearables", typeof(AvatarWearable[])); + + byte[] m_textureEntry_work = (byte[])info.GetValue("m_textureEntry", typeof(byte[])); + m_textureEntry = new LLObject.TextureEntry(m_textureEntry_work, 0, m_textureEntry_work.Length); + + m_avatarHeight = (float)info.GetValue("m_avatarHeight", typeof(float)); + + //System.Console.WriteLine("AvatarAppearance Deserialize END"); + } + + [SecurityPermission(SecurityAction.LinkDemand, + Flags = SecurityPermissionFlag.SerializationFormatter)] + public virtual void GetObjectData( + SerializationInfo info, StreamingContext context) + { + if (info == null) + { + throw new System.ArgumentNullException("info"); + } + + info.AddValue("m_scenePresenceID", m_scenePresenceID.UUID); + info.AddValue("m_wearablesSerial", m_wearablesSerial); + info.AddValue("m_visualParams", m_visualParams); + info.AddValue("m_wearables", m_wearables); + info.AddValue("m_textureEntry", m_textureEntry.ToBytes()); + info.AddValue("m_avatarHeight", m_avatarHeight); + } } -} \ No newline at end of file +} -- cgit v1.1