aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/ChildAgentDataUpdate.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/ChildAgentDataUpdate.cs')
-rw-r--r--OpenSim/Framework/ChildAgentDataUpdate.cs70
1 files changed, 41 insertions, 29 deletions
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs
index fdebba3..d7a7d1e 100644
--- a/OpenSim/Framework/ChildAgentDataUpdate.cs
+++ b/OpenSim/Framework/ChildAgentDataUpdate.cs
@@ -387,31 +387,37 @@ namespace OpenSim.Framework
387 // args["agent_textures"] = textures; 387 // args["agent_textures"] = textures;
388 //} 388 //}
389 389
390/* 390 // The code to pack textures, visuals, wearables and attachments
391 if ((AgentTextures != null) && (AgentTextures.Length > 0)) 391 // should be removed; packed appearance contains the full appearance
392 args["texture_entry"] = OSD.FromBinary(AgentTextures); 392 // This is retained for backward compatibility only
393 if ((Appearance.Texture != null) && (Appearance.Texture.Length > 0))
394 args["texture_entry"] = OSD.FromBinary(Appearance.Texture);
393 395
394 if ((VisualParams != null) && (VisualParams.Length > 0)) 396 if ((Appearance.VisualParams != null) && (Appearance.VisualParams.Length > 0))
395 args["visual_params"] = OSD.FromBinary(VisualParams); 397 args["visual_params"] = OSD.FromBinary(Appearance.VisualParams);
396 398
397 // We might not pass this in all cases... 399 // We might not pass this in all cases...
398 if ((Wearables != null) && (Wearables.Length > 0)) 400 if ((Appearance.Wearables != null) && (Appearance.Wearables.Length > 0))
399 { 401 {
400 OSDArray wears = new OSDArray(Wearables.Length); 402 OSDArray wears = new OSDArray(Appearance.Wearables.Length * 2);
401 foreach (UUID uuid in Wearables) 403 foreach (AvatarWearable awear in Appearance.Wearables)
402 wears.Add(OSD.FromUUID(uuid)); 404 {
405 wears.Add(OSD.FromUUID(awear.ItemID));
406 wears.Add(OSD.FromUUID(awear.AssetID));
407 }
403 args["wearables"] = wears; 408 args["wearables"] = wears;
404 } 409 }
405 410
406 411 List<AvatarAttachments> attachments = Appearance.GetAttachments();
407 if ((Attachments != null) && (Attachments.Length > 0)) 412 if ((attachments != null) && (attachments.Length > 0))
408 { 413 {
409 OSDArray attachs = new OSDArray(Attachments.Length); 414 OSDArray attachs = new OSDArray(attachments.Length);
410 foreach (AvatarAttachment att in Attachments) 415 foreach (AvatarAttachment att in attachments)
411 attachs.Add(att.Pack()); 416 attachs.Add(att.Pack());
412 args["attachments"] = attachs; 417 args["attachments"] = attachs;
413 } 418 }
414*/ 419 // End of code to remove
420
415 if ((Controllers != null) && (Controllers.Length > 0)) 421 if ((Controllers != null) && (Controllers.Length > 0))
416 { 422 {
417 OSDArray controls = new OSDArray(Controllers.Length); 423 OSDArray controls = new OSDArray(Controllers.Length);
@@ -547,41 +553,47 @@ namespace OpenSim.Framework
547 // AgentTextures[i++] = o.AsUUID(); 553 // AgentTextures[i++] = o.AsUUID();
548 //} 554 //}
549 555
550 if (args["packed_appearance"] != null) 556
551 Appearance = new AvatarAppearance(AgentID,(OSDMap)args["packed_appearance"]); 557 Appearance = new AvatarAppearance(AgentID);
552 else 558
553 Appearance = new AvatarAppearance(AgentID); 559 // The code to pack textures, visuals, wearables and attachments
554 560 // should be removed; packed appearance contains the full appearance
555/* 561 // This is retained for backward compatibility only
556 if (args["texture_entry"] != null) 562 if (args["texture_entry"] != null)
557 AgentTextures = args["texture_entry"].AsBinary(); 563 Appearance.SetTextureEntries(args["texture_entry"].AsBinary());
558 564
559 if (args["visual_params"] != null) 565 if (args["visual_params"] != null)
560 VisualParams = args["visual_params"].AsBinary(); 566 Appearance.SetVisualParams(args["visual_params"].AsBinary());
561 567
562 if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array) 568 if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array)
563 { 569 {
564 OSDArray wears = (OSDArray)(args["wearables"]); 570 OSDArray wears = (OSDArray)(args["wearables"]);
565 Wearables = new UUID[wears.Count]; 571 for (int i = 0; i < wears.Count / 2; i++)
566 int i = 0; 572 {
567 foreach (OSD o in wears) 573 Appearance.Wearables[i].ItemID = wears[i*2].AsUUID();
568 Wearables[i++] = o.AsUUID(); 574 Appearance.Wearables[i].AssetID = wears[(i*2)+1].AsUUID();
575 }
569 } 576 }
570 577
571 if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array) 578 if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array)
572 { 579 {
573 OSDArray attachs = (OSDArray)(args["attachments"]); 580 OSDArray attachs = (OSDArray)(args["attachments"]);
574 Attachments = new AvatarAttachment[attachs.Count]; 581 AvatarAttachment[] attachments = new AvatarAttachment[attachs.Count];
575 int i = 0; 582 int i = 0;
576 foreach (OSD o in attachs) 583 foreach (OSD o in attachs)
577 { 584 {
578 if (o.Type == OSDType.Map) 585 if (o.Type == OSDType.Map)
579 { 586 {
580 Attachments[i++] = new AvatarAttachment((OSDMap)o); 587 attachments[i++] = new AvatarAttachment((OSDMap)o);
581 } 588 }
582 } 589 }
590 Appearance.SetAttachments(attachments);
583 } 591 }
584*/ 592 // end of code to remove
593
594 if (args["packed_appearance"] != null)
595 Appearance = new AvatarAppearance(AgentID,(OSDMap)args["packed_appearance"]);
596
585 if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array) 597 if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array)
586 { 598 {
587 OSDArray controls = (OSDArray)(args["controllers"]); 599 OSDArray controls = (OSDArray)(args["controllers"]);