aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/ChildAgentDataUpdate.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/ChildAgentDataUpdate.cs103
1 files changed, 63 insertions, 40 deletions
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs
index 967278e..91df64d 100644
--- a/OpenSim/Framework/ChildAgentDataUpdate.cs
+++ b/OpenSim/Framework/ChildAgentDataUpdate.cs
@@ -171,9 +171,10 @@ namespace OpenSim.Framework
171 /// Soon to be decommissioned 171 /// Soon to be decommissioned
172 /// </summary> 172 /// </summary>
173 /// <param name="cAgent"></param> 173 /// <param name="cAgent"></param>
174 public void CopyFrom(ChildAgentDataUpdate cAgent) 174 public void CopyFrom(ChildAgentDataUpdate cAgent, UUID sid)
175 { 175 {
176 AgentID = new UUID(cAgent.AgentID); 176 AgentID = new UUID(cAgent.AgentID);
177 SessionID = sid;
177 178
178 // next: ??? 179 // next: ???
179 Size = new Vector3(); 180 Size = new Vector3();
@@ -291,7 +292,13 @@ namespace OpenSim.Framework
291 public Vector3 AtAxis; 292 public Vector3 AtAxis;
292 public Vector3 LeftAxis; 293 public Vector3 LeftAxis;
293 public Vector3 UpAxis; 294 public Vector3 UpAxis;
294 public bool ChangedGrid; 295
296 /// <summary>
297 /// Signal on a V2 teleport that Scene.IncomingChildAgentDataUpdate(AgentData ad) should wait for the
298 /// scene presence to become root (triggered when the viewer sends a CompleteAgentMovement UDP packet after
299 /// establishing the connection triggered by it's receipt of a TeleportFinish EQ message).
300 /// </summary>
301 public bool SenderWantsToWaitForRoot;
295 302
296 public float Far; 303 public float Far;
297 public float Aspect; 304 public float Aspect;
@@ -362,8 +369,9 @@ namespace OpenSim.Framework
362 args["left_axis"] = OSD.FromString(LeftAxis.ToString()); 369 args["left_axis"] = OSD.FromString(LeftAxis.ToString());
363 args["up_axis"] = OSD.FromString(UpAxis.ToString()); 370 args["up_axis"] = OSD.FromString(UpAxis.ToString());
364 371
365 372 //backwards compatibility
366 args["changed_grid"] = OSD.FromBoolean(ChangedGrid); 373 args["changed_grid"] = OSD.FromBoolean(SenderWantsToWaitForRoot);
374 args["wait_for_root"] = OSD.FromBoolean(SenderWantsToWaitForRoot);
367 args["far"] = OSD.FromReal(Far); 375 args["far"] = OSD.FromReal(Far);
368 args["aspect"] = OSD.FromReal(Aspect); 376 args["aspect"] = OSD.FromReal(Aspect);
369 377
@@ -423,6 +431,8 @@ namespace OpenSim.Framework
423 // The code to pack textures, visuals, wearables and attachments 431 // The code to pack textures, visuals, wearables and attachments
424 // should be removed; packed appearance contains the full appearance 432 // should be removed; packed appearance contains the full appearance
425 // This is retained for backward compatibility only 433 // This is retained for backward compatibility only
434
435/* then lets remove
426 if (Appearance.Texture != null) 436 if (Appearance.Texture != null)
427 { 437 {
428 byte[] rawtextures = Appearance.Texture.GetBytes(); 438 byte[] rawtextures = Appearance.Texture.GetBytes();
@@ -451,7 +461,7 @@ namespace OpenSim.Framework
451 args["attachments"] = attachs; 461 args["attachments"] = attachs;
452 } 462 }
453 // End of code to remove 463 // End of code to remove
454 464*/
455 if ((Controllers != null) && (Controllers.Length > 0)) 465 if ((Controllers != null) && (Controllers.Length > 0))
456 { 466 {
457 OSDArray controls = new OSDArray(Controllers.Length); 467 OSDArray controls = new OSDArray(Controllers.Length);
@@ -536,8 +546,8 @@ namespace OpenSim.Framework
536 if (args["up_axis"] != null) 546 if (args["up_axis"] != null)
537 Vector3.TryParse(args["up_axis"].AsString(), out AtAxis); 547 Vector3.TryParse(args["up_axis"].AsString(), out AtAxis);
538 548
539 if (args["changed_grid"] != null) 549 if (args.ContainsKey("wait_for_root") && args["wait_for_root"] != null)
540 ChangedGrid = args["changed_grid"].AsBoolean(); 550 SenderWantsToWaitForRoot = args["wait_for_root"].AsBoolean();
541 551
542 if (args["far"] != null) 552 if (args["far"] != null)
543 Far = (float)(args["far"].AsReal()); 553 Far = (float)(args["far"].AsReal());
@@ -639,58 +649,71 @@ namespace OpenSim.Framework
639 // AgentTextures[i++] = o.AsUUID(); 649 // AgentTextures[i++] = o.AsUUID();
640 //} 650 //}
641 651
642 Appearance = new AvatarAppearance();
643 652
644 // The code to unpack textures, visuals, wearables and attachments 653 // packed_appearence should contain all appearance information
645 // should be removed; packed appearance contains the full appearance 654 if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map)
646 // This is retained for backward compatibility only
647 if (args["texture_entry"] != null)
648 { 655 {
649 byte[] rawtextures = args["texture_entry"].AsBinary(); 656 m_log.WarnFormat("[CHILDAGENTDATAUPDATE] got packed appearance");
650 Primitive.TextureEntry textures = new Primitive.TextureEntry(rawtextures,0,rawtextures.Length); 657 Appearance = new AvatarAppearance((OSDMap)args["packed_appearance"]);
651 Appearance.SetTextureEntries(textures);
652 } 658 }
659 else
660 {
661 // if missing try the old pack method
662 m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance, checking old method");
653 663
654 if (args["visual_params"] != null) 664 Appearance = new AvatarAppearance();
655 Appearance.SetVisualParams(args["visual_params"].AsBinary());
656 665
657 if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array) 666 // The code to unpack textures, visuals, wearables and attachments
658 { 667 // should be removed; packed appearance contains the full appearance
659 OSDArray wears = (OSDArray)(args["wearables"]); 668 // This is retained for backward compatibility only
669 if (args["texture_entry"] != null)
670 {
671 byte[] rawtextures = args["texture_entry"].AsBinary();
672 Primitive.TextureEntry textures = new Primitive.TextureEntry(rawtextures, 0, rawtextures.Length);
673 Appearance.SetTextureEntries(textures);
674 }
660 675
661 int count = wears.Count; 676 if (args["visual_params"] != null)
662 if (count > AvatarWearable.MAX_WEARABLES) 677 Appearance.SetVisualParams(args["visual_params"].AsBinary());
663 count = AvatarWearable.MAX_WEARABLES;
664 678
665 for (int i = 0; i < count / 2; i++) 679 if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array)
666 { 680 {
667 AvatarWearable awear = new AvatarWearable((OSDArray)wears[i]); 681 OSDArray wears = (OSDArray)(args["wearables"]);
668 Appearance.SetWearable(i,awear); 682
683 int count = wears.Count;
684 if (count > AvatarWearable.MAX_WEARABLES)
685 count = AvatarWearable.MAX_WEARABLES;
686
687 for (int i = 0; i < count / 2; i++)
688 {
689 AvatarWearable awear = new AvatarWearable((OSDArray)wears[i]);
690 Appearance.SetWearable(i, awear);
691 }
669 } 692 }
670 }
671 693
672 if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array) 694 if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array)
673 {
674 OSDArray attachs = (OSDArray)(args["attachments"]);
675 foreach (OSD o in attachs)
676 { 695 {
677 if (o.Type == OSDType.Map) 696 OSDArray attachs = (OSDArray)(args["attachments"]);
697 foreach (OSD o in attachs)
678 { 698 {
679 // We know all of these must end up as attachments so we 699 if (o.Type == OSDType.Map)
680 // append rather than replace to ensure multiple attachments 700 {
681 // per point continues to work 701 // We know all of these must end up as attachments so we
682// m_log.DebugFormat("[CHILDAGENTDATAUPDATE]: Appending attachments for {0}", AgentID); 702 // append rather than replace to ensure multiple attachments
683 Appearance.AppendAttachment(new AvatarAttachment((OSDMap)o)); 703 // per point continues to work
704 // m_log.DebugFormat("[CHILDAGENTDATAUPDATE]: Appending attachments for {0}", AgentID);
705 Appearance.AppendAttachment(new AvatarAttachment((OSDMap)o));
706 }
684 } 707 }
685 } 708 }
709 // end of code to remove
686 } 710 }
687 // end of code to remove 711/* moved above
688
689 if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map) 712 if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map)
690 Appearance = new AvatarAppearance((OSDMap)args["packed_appearance"]); 713 Appearance = new AvatarAppearance((OSDMap)args["packed_appearance"]);
691 else 714 else
692 m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance"); 715 m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance");
693 716*/
694 if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array) 717 if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array)
695 { 718 {
696 OSDArray controls = (OSDArray)(args["controllers"]); 719 OSDArray controls = (OSDArray)(args["controllers"]);