diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/AvatarAppearance.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/AvatarAppearance.cs | 49 |
1 files changed, 46 insertions, 3 deletions
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 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | using System; | ||
29 | using libsecondlife; | 30 | using libsecondlife; |
30 | using libsecondlife.Packets; | 31 | using libsecondlife.Packets; |
31 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
32 | 33 | using System.Runtime.Serialization; | |
34 | using System.Security.Permissions; | ||
33 | namespace OpenSim.Region.Environment.Scenes | 35 | namespace OpenSim.Region.Environment.Scenes |
34 | { | 36 | { |
35 | public class AvatarAppearance | 37 | [Serializable] |
38 | public class AvatarAppearance : ISerializable | ||
36 | { | 39 | { |
37 | protected LLUUID m_scenePresenceID; | 40 | protected LLUUID m_scenePresenceID; |
38 | 41 | ||
@@ -149,5 +152,45 @@ namespace OpenSim.Region.Environment.Scenes | |||
149 | textu.CreateFace(6).TextureID = new LLUUID("00000000-0000-1111-9999-000000000011"); | 152 | textu.CreateFace(6).TextureID = new LLUUID("00000000-0000-1111-9999-000000000011"); |
150 | return textu; | 153 | return textu; |
151 | } | 154 | } |
155 | |||
156 | protected AvatarAppearance(SerializationInfo info, StreamingContext context) | ||
157 | { | ||
158 | //System.Console.WriteLine("AvatarAppearance Deserialize BGN"); | ||
159 | |||
160 | if (info == null) | ||
161 | { | ||
162 | throw new System.ArgumentNullException("info"); | ||
163 | } | ||
164 | |||
165 | m_scenePresenceID = new LLUUID((Guid)info.GetValue("m_scenePresenceID", typeof(Guid))); | ||
166 | m_wearablesSerial = (int)info.GetValue("m_wearablesSerial", typeof(int)); | ||
167 | m_visualParams = (byte[])info.GetValue("m_visualParams", typeof(byte[])); | ||
168 | m_wearables = (AvatarWearable[])info.GetValue("m_wearables", typeof(AvatarWearable[])); | ||
169 | |||
170 | byte[] m_textureEntry_work = (byte[])info.GetValue("m_textureEntry", typeof(byte[])); | ||
171 | m_textureEntry = new LLObject.TextureEntry(m_textureEntry_work, 0, m_textureEntry_work.Length); | ||
172 | |||
173 | m_avatarHeight = (float)info.GetValue("m_avatarHeight", typeof(float)); | ||
174 | |||
175 | //System.Console.WriteLine("AvatarAppearance Deserialize END"); | ||
176 | } | ||
177 | |||
178 | [SecurityPermission(SecurityAction.LinkDemand, | ||
179 | Flags = SecurityPermissionFlag.SerializationFormatter)] | ||
180 | public virtual void GetObjectData( | ||
181 | SerializationInfo info, StreamingContext context) | ||
182 | { | ||
183 | if (info == null) | ||
184 | { | ||
185 | throw new System.ArgumentNullException("info"); | ||
186 | } | ||
187 | |||
188 | info.AddValue("m_scenePresenceID", m_scenePresenceID.UUID); | ||
189 | info.AddValue("m_wearablesSerial", m_wearablesSerial); | ||
190 | info.AddValue("m_visualParams", m_visualParams); | ||
191 | info.AddValue("m_wearables", m_wearables); | ||
192 | info.AddValue("m_textureEntry", m_textureEntry.ToBytes()); | ||
193 | info.AddValue("m_avatarHeight", m_avatarHeight); | ||
194 | } | ||
152 | } | 195 | } |
153 | } \ No newline at end of file | 196 | } |