aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/ChildAgentDataUpdate.cs
diff options
context:
space:
mode:
authoropensim mirror account2010-10-29 13:20:04 -0700
committeropensim mirror account2010-10-29 13:20:04 -0700
commit8d8a795b28c3955df309a4f8cfd3b092489cb15f (patch)
tree672d0d8327d521dfefb44dc5d7d1d49ed8642ee0 /OpenSim/Framework/ChildAgentDataUpdate.cs
parentMerge branch 'master' of /var/git/opensim/ (diff)
parentMerge branch 'dev-appearance' (diff)
downloadopensim-SC-8d8a795b28c3955df309a4f8cfd3b092489cb15f.zip
opensim-SC-8d8a795b28c3955df309a4f8cfd3b092489cb15f.tar.gz
opensim-SC-8d8a795b28c3955df309a4f8cfd3b092489cb15f.tar.bz2
opensim-SC-8d8a795b28c3955df309a4f8cfd3b092489cb15f.tar.xz
Merge branch 'master' of /var/git/opensim/
Diffstat (limited to 'OpenSim/Framework/ChildAgentDataUpdate.cs')
-rw-r--r--OpenSim/Framework/ChildAgentDataUpdate.cs70
1 files changed, 21 insertions, 49 deletions
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs
index 0dc5dbc..fdebba3 100644
--- a/OpenSim/Framework/ChildAgentDataUpdate.cs
+++ b/OpenSim/Framework/ChildAgentDataUpdate.cs
@@ -225,46 +225,6 @@ namespace OpenSim.Framework
225 } 225 }
226 } 226 }
227 227
228 public class AttachmentData
229 {
230 public int AttachPoint;
231 public UUID ItemID;
232 public UUID AssetID;
233
234 public AttachmentData(int point, UUID item, UUID asset)
235 {
236 AttachPoint = point;
237 ItemID = item;
238 AssetID = asset;
239 }
240
241 public AttachmentData(OSDMap args)
242 {
243 UnpackUpdateMessage(args);
244 }
245
246 public OSDMap PackUpdateMessage()
247 {
248 OSDMap attachdata = new OSDMap();
249 attachdata["point"] = OSD.FromInteger(AttachPoint);
250 attachdata["item"] = OSD.FromUUID(ItemID);
251 attachdata["asset"] = OSD.FromUUID(AssetID);
252
253 return attachdata;
254 }
255
256
257 public void UnpackUpdateMessage(OSDMap args)
258 {
259 if (args["point"] != null)
260 AttachPoint = args["point"].AsInteger();
261 if (args["item"] != null)
262 ItemID = args["item"].AsUUID();
263 if (args["asset"] != null)
264 AssetID = args["asset"].AsUUID();
265 }
266 }
267
268 public class ControllerData 228 public class ControllerData
269 { 229 {
270 public UUID ItemID; 230 public UUID ItemID;
@@ -348,11 +308,14 @@ namespace OpenSim.Framework
348 public UUID GranterID; 308 public UUID GranterID;
349 309
350 // Appearance 310 // Appearance
311 public AvatarAppearance Appearance;
312
313/*
351 public byte[] AgentTextures; 314 public byte[] AgentTextures;
352 public byte[] VisualParams; 315 public byte[] VisualParams;
353 public UUID[] Wearables; 316 public UUID[] Wearables;
354 public AttachmentData[] Attachments; 317 public AvatarAttachment[] Attachments;
355 318*/
356 // Scripted 319 // Scripted
357 public ControllerData[] Controllers; 320 public ControllerData[] Controllers;
358 321
@@ -413,6 +376,9 @@ namespace OpenSim.Framework
413 args["animations"] = anims; 376 args["animations"] = anims;
414 } 377 }
415 378
379 if (Appearance != null)
380 args["packed_appearance"] = Appearance.Pack();
381
416 //if ((AgentTextures != null) && (AgentTextures.Length > 0)) 382 //if ((AgentTextures != null) && (AgentTextures.Length > 0))
417 //{ 383 //{
418 // OSDArray textures = new OSDArray(AgentTextures.Length); 384 // OSDArray textures = new OSDArray(AgentTextures.Length);
@@ -421,7 +387,7 @@ namespace OpenSim.Framework
421 // args["agent_textures"] = textures; 387 // args["agent_textures"] = textures;
422 //} 388 //}
423 389
424 390/*
425 if ((AgentTextures != null) && (AgentTextures.Length > 0)) 391 if ((AgentTextures != null) && (AgentTextures.Length > 0))
426 args["texture_entry"] = OSD.FromBinary(AgentTextures); 392 args["texture_entry"] = OSD.FromBinary(AgentTextures);
427 393
@@ -441,11 +407,11 @@ namespace OpenSim.Framework
441 if ((Attachments != null) && (Attachments.Length > 0)) 407 if ((Attachments != null) && (Attachments.Length > 0))
442 { 408 {
443 OSDArray attachs = new OSDArray(Attachments.Length); 409 OSDArray attachs = new OSDArray(Attachments.Length);
444 foreach (AttachmentData att in Attachments) 410 foreach (AvatarAttachment att in Attachments)
445 attachs.Add(att.PackUpdateMessage()); 411 attachs.Add(att.Pack());
446 args["attachments"] = attachs; 412 args["attachments"] = attachs;
447 } 413 }
448 414*/
449 if ((Controllers != null) && (Controllers.Length > 0)) 415 if ((Controllers != null) && (Controllers.Length > 0))
450 { 416 {
451 OSDArray controls = new OSDArray(Controllers.Length); 417 OSDArray controls = new OSDArray(Controllers.Length);
@@ -581,6 +547,12 @@ namespace OpenSim.Framework
581 // AgentTextures[i++] = o.AsUUID(); 547 // AgentTextures[i++] = o.AsUUID();
582 //} 548 //}
583 549
550 if (args["packed_appearance"] != null)
551 Appearance = new AvatarAppearance(AgentID,(OSDMap)args["packed_appearance"]);
552 else
553 Appearance = new AvatarAppearance(AgentID);
554
555/*
584 if (args["texture_entry"] != null) 556 if (args["texture_entry"] != null)
585 AgentTextures = args["texture_entry"].AsBinary(); 557 AgentTextures = args["texture_entry"].AsBinary();
586 558
@@ -599,17 +571,17 @@ namespace OpenSim.Framework
599 if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array) 571 if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array)
600 { 572 {
601 OSDArray attachs = (OSDArray)(args["attachments"]); 573 OSDArray attachs = (OSDArray)(args["attachments"]);
602 Attachments = new AttachmentData[attachs.Count]; 574 Attachments = new AvatarAttachment[attachs.Count];
603 int i = 0; 575 int i = 0;
604 foreach (OSD o in attachs) 576 foreach (OSD o in attachs)
605 { 577 {
606 if (o.Type == OSDType.Map) 578 if (o.Type == OSDType.Map)
607 { 579 {
608 Attachments[i++] = new AttachmentData((OSDMap)o); 580 Attachments[i++] = new AvatarAttachment((OSDMap)o);
609 } 581 }
610 } 582 }
611 } 583 }
612 584*/
613 if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array) 585 if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array)
614 { 586 {
615 OSDArray controls = (OSDArray)(args["controllers"]); 587 OSDArray controls = (OSDArray)(args["controllers"]);