aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs66
-rw-r--r--OpenSim/Framework/AvatarWearable.cs35
2 files changed, 27 insertions, 74 deletions
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index a6cec76..9e33ebc 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -34,8 +34,7 @@ using OpenMetaverse;
34 34
35namespace OpenSim.Framework 35namespace OpenSim.Framework
36{ 36{
37 [Serializable] 37 public class AvatarAppearance
38 public class AvatarAppearance : ISerializable
39 { 38 {
40// private static readonly ILog m_log 39// private static readonly ILog m_log
41// = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 40// = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -105,102 +104,127 @@ namespace OpenSim.Framework
105 get { return m_wearables[BODY].ItemID; } 104 get { return m_wearables[BODY].ItemID; }
106 set { m_wearables[BODY].ItemID = value; } 105 set { m_wearables[BODY].ItemID = value; }
107 } 106 }
107
108 public virtual UUID BodyAsset { 108 public virtual UUID BodyAsset {
109 get { return m_wearables[BODY].AssetID; } 109 get { return m_wearables[BODY].AssetID; }
110 set { m_wearables[BODY].AssetID = value; } 110 set { m_wearables[BODY].AssetID = value; }
111 } 111 }
112
112 public virtual UUID SkinItem { 113 public virtual UUID SkinItem {
113 get { return m_wearables[SKIN].ItemID; } 114 get { return m_wearables[SKIN].ItemID; }
114 set { m_wearables[SKIN].ItemID = value; } 115 set { m_wearables[SKIN].ItemID = value; }
115 } 116 }
117
116 public virtual UUID SkinAsset { 118 public virtual UUID SkinAsset {
117 get { return m_wearables[SKIN].AssetID; } 119 get { return m_wearables[SKIN].AssetID; }
118 set { m_wearables[SKIN].AssetID = value; } 120 set { m_wearables[SKIN].AssetID = value; }
119 } 121 }
122
120 public virtual UUID HairItem { 123 public virtual UUID HairItem {
121 get { return m_wearables[HAIR].ItemID; } 124 get { return m_wearables[HAIR].ItemID; }
122 set { m_wearables[HAIR].ItemID = value; } 125 set { m_wearables[HAIR].ItemID = value; }
123 } 126 }
127
124 public virtual UUID HairAsset { 128 public virtual UUID HairAsset {
125 get { return m_wearables[HAIR].AssetID; } 129 get { return m_wearables[HAIR].AssetID; }
126 set { m_wearables[HAIR].AssetID = value; } 130 set { m_wearables[HAIR].AssetID = value; }
127 } 131 }
132
128 public virtual UUID EyesItem { 133 public virtual UUID EyesItem {
129 get { return m_wearables[EYES].ItemID; } 134 get { return m_wearables[EYES].ItemID; }
130 set { m_wearables[EYES].ItemID = value; } 135 set { m_wearables[EYES].ItemID = value; }
131 } 136 }
137
132 public virtual UUID EyesAsset { 138 public virtual UUID EyesAsset {
133 get { return m_wearables[EYES].AssetID; } 139 get { return m_wearables[EYES].AssetID; }
134 set { m_wearables[EYES].AssetID = value; } 140 set { m_wearables[EYES].AssetID = value; }
135 } 141 }
142
136 public virtual UUID ShirtItem { 143 public virtual UUID ShirtItem {
137 get { return m_wearables[SHIRT].ItemID; } 144 get { return m_wearables[SHIRT].ItemID; }
138 set { m_wearables[SHIRT].ItemID = value; } 145 set { m_wearables[SHIRT].ItemID = value; }
139 } 146 }
147
140 public virtual UUID ShirtAsset { 148 public virtual UUID ShirtAsset {
141 get { return m_wearables[SHIRT].AssetID; } 149 get { return m_wearables[SHIRT].AssetID; }
142 set { m_wearables[SHIRT].AssetID = value; } 150 set { m_wearables[SHIRT].AssetID = value; }
143 } 151 }
152
144 public virtual UUID PantsItem { 153 public virtual UUID PantsItem {
145 get { return m_wearables[PANTS].ItemID; } 154 get { return m_wearables[PANTS].ItemID; }
146 set { m_wearables[PANTS].ItemID = value; } 155 set { m_wearables[PANTS].ItemID = value; }
147 } 156 }
157
148 public virtual UUID PantsAsset { 158 public virtual UUID PantsAsset {
149 get { return m_wearables[PANTS].AssetID; } 159 get { return m_wearables[PANTS].AssetID; }
150 set { m_wearables[PANTS].AssetID = value; } 160 set { m_wearables[PANTS].AssetID = value; }
151 } 161 }
162
152 public virtual UUID ShoesItem { 163 public virtual UUID ShoesItem {
153 get { return m_wearables[SHOES].ItemID; } 164 get { return m_wearables[SHOES].ItemID; }
154 set { m_wearables[SHOES].ItemID = value; } 165 set { m_wearables[SHOES].ItemID = value; }
155 } 166 }
167
156 public virtual UUID ShoesAsset { 168 public virtual UUID ShoesAsset {
157 get { return m_wearables[SHOES].AssetID; } 169 get { return m_wearables[SHOES].AssetID; }
158 set { m_wearables[SHOES].AssetID = value; } 170 set { m_wearables[SHOES].AssetID = value; }
159 } 171 }
172
160 public virtual UUID SocksItem { 173 public virtual UUID SocksItem {
161 get { return m_wearables[SOCKS].ItemID; } 174 get { return m_wearables[SOCKS].ItemID; }
162 set { m_wearables[SOCKS].ItemID = value; } 175 set { m_wearables[SOCKS].ItemID = value; }
163 } 176 }
177
164 public virtual UUID SocksAsset { 178 public virtual UUID SocksAsset {
165 get { return m_wearables[SOCKS].AssetID; } 179 get { return m_wearables[SOCKS].AssetID; }
166 set { m_wearables[SOCKS].AssetID = value; } 180 set { m_wearables[SOCKS].AssetID = value; }
167 } 181 }
182
168 public virtual UUID JacketItem { 183 public virtual UUID JacketItem {
169 get { return m_wearables[JACKET].ItemID; } 184 get { return m_wearables[JACKET].ItemID; }
170 set { m_wearables[JACKET].ItemID = value; } 185 set { m_wearables[JACKET].ItemID = value; }
171 } 186 }
187
172 public virtual UUID JacketAsset { 188 public virtual UUID JacketAsset {
173 get { return m_wearables[JACKET].AssetID; } 189 get { return m_wearables[JACKET].AssetID; }
174 set { m_wearables[JACKET].AssetID = value; } 190 set { m_wearables[JACKET].AssetID = value; }
175 } 191 }
192
176 public virtual UUID GlovesItem { 193 public virtual UUID GlovesItem {
177 get { return m_wearables[GLOVES].ItemID; } 194 get { return m_wearables[GLOVES].ItemID; }
178 set { m_wearables[GLOVES].ItemID = value; } 195 set { m_wearables[GLOVES].ItemID = value; }
179 } 196 }
197
180 public virtual UUID GlovesAsset { 198 public virtual UUID GlovesAsset {
181 get { return m_wearables[GLOVES].AssetID; } 199 get { return m_wearables[GLOVES].AssetID; }
182 set { m_wearables[GLOVES].AssetID = value; } 200 set { m_wearables[GLOVES].AssetID = value; }
183 } 201 }
202
184 public virtual UUID UnderShirtItem { 203 public virtual UUID UnderShirtItem {
185 get { return m_wearables[UNDERSHIRT].ItemID; } 204 get { return m_wearables[UNDERSHIRT].ItemID; }
186 set { m_wearables[UNDERSHIRT].ItemID = value; } 205 set { m_wearables[UNDERSHIRT].ItemID = value; }
187 } 206 }
207
188 public virtual UUID UnderShirtAsset { 208 public virtual UUID UnderShirtAsset {
189 get { return m_wearables[UNDERSHIRT].AssetID; } 209 get { return m_wearables[UNDERSHIRT].AssetID; }
190 set { m_wearables[UNDERSHIRT].AssetID = value; } 210 set { m_wearables[UNDERSHIRT].AssetID = value; }
191 } 211 }
212
192 public virtual UUID UnderPantsItem { 213 public virtual UUID UnderPantsItem {
193 get { return m_wearables[UNDERPANTS].ItemID; } 214 get { return m_wearables[UNDERPANTS].ItemID; }
194 set { m_wearables[UNDERPANTS].ItemID = value; } 215 set { m_wearables[UNDERPANTS].ItemID = value; }
195 } 216 }
217
196 public virtual UUID UnderPantsAsset { 218 public virtual UUID UnderPantsAsset {
197 get { return m_wearables[UNDERPANTS].AssetID; } 219 get { return m_wearables[UNDERPANTS].AssetID; }
198 set { m_wearables[UNDERPANTS].AssetID = value; } 220 set { m_wearables[UNDERPANTS].AssetID = value; }
199 } 221 }
222
200 public virtual UUID SkirtItem { 223 public virtual UUID SkirtItem {
201 get { return m_wearables[SKIRT].ItemID; } 224 get { return m_wearables[SKIRT].ItemID; }
202 set { m_wearables[SKIRT].ItemID = value; } 225 set { m_wearables[SKIRT].ItemID = value; }
203 } 226 }
227
204 public virtual UUID SkirtAsset { 228 public virtual UUID SkirtAsset {
205 get { return m_wearables[SKIRT].AssetID; } 229 get { return m_wearables[SKIRT].AssetID; }
206 set { m_wearables[SKIRT].AssetID = value; } 230 set { m_wearables[SKIRT].AssetID = value; }
@@ -333,26 +357,6 @@ namespace OpenSim.Framework
333 return s; 357 return s;
334 } 358 }
335 359
336 protected AvatarAppearance(SerializationInfo info, StreamingContext context)
337 {
338 if (info == null)
339 {
340 throw new ArgumentNullException("info");
341 }
342
343 m_owner = new UUID((Guid)info.GetValue("m_scenePresenceID", typeof(Guid)));
344 m_serial = (int)info.GetValue("m_wearablesSerial", typeof(int));
345 m_visualparams = (byte[])info.GetValue("m_visualParams", typeof(byte[]));
346 m_wearables = (AvatarWearable[])info.GetValue("m_wearables", typeof(AvatarWearable[]));
347
348 byte[] m_textureEntry_work = (byte[])info.GetValue("m_textureEntry", typeof(byte[]));
349 m_texture = new Primitive.TextureEntry(m_textureEntry_work, 0, m_textureEntry_work.Length);
350
351 m_avatarHeight = (float)info.GetValue("m_avatarHeight", typeof(float));
352
353 //m_log.Debug("AvatarAppearance Deserialize END");
354 }
355
356 // this is used for OGS1 360 // this is used for OGS1
357 public virtual Hashtable ToHashTable() 361 public virtual Hashtable ToHashTable()
358 { 362 {
@@ -444,24 +448,6 @@ namespace OpenSim.Framework
444 } 448 }
445 } 449 }
446 450
447 [SecurityPermission(SecurityAction.LinkDemand,
448 Flags = SecurityPermissionFlag.SerializationFormatter)]
449 public virtual void GetObjectData(
450 SerializationInfo info, StreamingContext context)
451 {
452 if (info == null)
453 {
454 throw new ArgumentNullException("info");
455 }
456
457 info.AddValue("m_scenePresenceID", m_owner.Guid);
458 info.AddValue("m_wearablesSerial", m_serial);
459 info.AddValue("m_visualParams", m_visualparams);
460 info.AddValue("m_wearables", m_wearables);
461 info.AddValue("m_textureEntry", m_texture.ToBytes());
462 info.AddValue("m_avatarHeight", m_avatarHeight);
463 }
464
465 private Dictionary<int, UUID[]> m_attachments = new Dictionary<int, UUID[]>(); 451 private Dictionary<int, UUID[]> m_attachments = new Dictionary<int, UUID[]>();
466 452
467 public void SetAttachments(Hashtable data) 453 public void SetAttachments(Hashtable data)
diff --git a/OpenSim/Framework/AvatarWearable.cs b/OpenSim/Framework/AvatarWearable.cs
index 1d015e5..82b74ce 100644
--- a/OpenSim/Framework/AvatarWearable.cs
+++ b/OpenSim/Framework/AvatarWearable.cs
@@ -32,8 +32,7 @@ using OpenMetaverse;
32 32
33namespace OpenSim.Framework 33namespace OpenSim.Framework
34{ 34{
35 [Serializable] 35 public class AvatarWearable
36 public class AvatarWearable : ISerializable
37 { 36 {
38 public UUID AssetID = new UUID("00000000-0000-0000-0000-000000000000"); 37 public UUID AssetID = new UUID("00000000-0000-0000-0000-000000000000");
39 public UUID ItemID = new UUID("00000000-0000-0000-0000-000000000000"); 38 public UUID ItemID = new UUID("00000000-0000-0000-0000-000000000000");
@@ -48,20 +47,6 @@ namespace OpenSim.Framework
48 ItemID = itemId; 47 ItemID = itemId;
49 } 48 }
50 49
51 protected AvatarWearable(SerializationInfo info, StreamingContext context)
52 {
53 //m_log.Debug("AvatarWearable Deserialize BGN");
54 if (info == null)
55 {
56 throw new ArgumentNullException("info");
57 }
58
59 AssetID = new UUID((Guid) info.GetValue("AssetID", typeof (Guid)));
60 ItemID = new UUID((Guid) info.GetValue("ItemID", typeof (Guid)));
61
62 //m_log.Debug("AvatarWearable Deserialize END");
63 }
64
65 public static AvatarWearable[] DefaultWearables 50 public static AvatarWearable[] DefaultWearables
66 { 51 {
67 get 52 get
@@ -91,23 +76,5 @@ namespace OpenSim.Framework
91 return defaultWearables; 76 return defaultWearables;
92 } 77 }
93 } 78 }
94
95 #region ISerializable Members
96
97 [SecurityPermission(SecurityAction.LinkDemand,
98 Flags = SecurityPermissionFlag.SerializationFormatter)]
99 public virtual void GetObjectData(
100 SerializationInfo info, StreamingContext context)
101 {
102 if (info == null)
103 {
104 throw new ArgumentNullException("info");
105 }
106
107 info.AddValue("AssetID", AssetID.Guid);
108 info.AddValue("ItemID", ItemID.Guid);
109 }
110
111 #endregion
112 } 79 }
113} 80}