aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/ChildAgentDataUpdate.cs
diff options
context:
space:
mode:
authorMaster ScienceSim2010-10-25 14:11:47 -0700
committerMaster ScienceSim2010-10-25 14:11:47 -0700
commit6e58c3d563b50c5797d1cfffbaec3fe82f18c2ea (patch)
tree56be5d0a766ee1449ef37f169bdbd421cd9218ac /OpenSim/Framework/ChildAgentDataUpdate.cs
parentIntermediate commit for backward compatability; does not compile yet (diff)
downloadopensim-SC_OLD-6e58c3d563b50c5797d1cfffbaec3fe82f18c2ea.zip
opensim-SC_OLD-6e58c3d563b50c5797d1cfffbaec3fe82f18c2ea.tar.gz
opensim-SC_OLD-6e58c3d563b50c5797d1cfffbaec3fe82f18c2ea.tar.bz2
opensim-SC_OLD-6e58c3d563b50c5797d1cfffbaec3fe82f18c2ea.tar.xz
Half of the compatibility is working. Login into a new region with
old data works. Teleport out of a new region with old data works. Teleport into a new region with old data does not trigger the necessary rebake.
Diffstat (limited to 'OpenSim/Framework/ChildAgentDataUpdate.cs')
-rw-r--r--OpenSim/Framework/ChildAgentDataUpdate.cs33
1 files changed, 22 insertions, 11 deletions
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs
index d7a7d1e..215682f 100644
--- a/OpenSim/Framework/ChildAgentDataUpdate.cs
+++ b/OpenSim/Framework/ChildAgentDataUpdate.cs
@@ -390,8 +390,11 @@ namespace OpenSim.Framework
390 // The code to pack textures, visuals, wearables and attachments 390 // The code to pack textures, visuals, wearables and attachments
391 // should be removed; packed appearance contains the full appearance 391 // should be removed; packed appearance contains the full appearance
392 // This is retained for backward compatibility only 392 // This is retained for backward compatibility only
393 if ((Appearance.Texture != null) && (Appearance.Texture.Length > 0)) 393 if (Appearance.Texture != null)
394 args["texture_entry"] = OSD.FromBinary(Appearance.Texture); 394 {
395 byte[] rawtextures = Appearance.Texture.GetBytes();
396 args["texture_entry"] = OSD.FromBinary(rawtextures);
397 }
395 398
396 if ((Appearance.VisualParams != null) && (Appearance.VisualParams.Length > 0)) 399 if ((Appearance.VisualParams != null) && (Appearance.VisualParams.Length > 0))
397 args["visual_params"] = OSD.FromBinary(Appearance.VisualParams); 400 args["visual_params"] = OSD.FromBinary(Appearance.VisualParams);
@@ -408,10 +411,10 @@ namespace OpenSim.Framework
408 args["wearables"] = wears; 411 args["wearables"] = wears;
409 } 412 }
410 413
411 List<AvatarAttachments> attachments = Appearance.GetAttachments(); 414 List<AvatarAttachment> attachments = Appearance.GetAttachments();
412 if ((attachments != null) && (attachments.Length > 0)) 415 if ((attachments != null) && (attachments.Count > 0))
413 { 416 {
414 OSDArray attachs = new OSDArray(attachments.Length); 417 OSDArray attachs = new OSDArray(attachments.Count);
415 foreach (AvatarAttachment att in attachments) 418 foreach (AvatarAttachment att in attachments)
416 attachs.Add(att.Pack()); 419 attachs.Add(att.Pack());
417 args["attachments"] = attachs; 420 args["attachments"] = attachs;
@@ -560,7 +563,11 @@ namespace OpenSim.Framework
560 // should be removed; packed appearance contains the full appearance 563 // should be removed; packed appearance contains the full appearance
561 // This is retained for backward compatibility only 564 // This is retained for backward compatibility only
562 if (args["texture_entry"] != null) 565 if (args["texture_entry"] != null)
563 Appearance.SetTextureEntries(args["texture_entry"].AsBinary()); 566 {
567 byte[] rawtextures = args["texture_entry"].AsBinary();
568 Primitive.TextureEntry textures = new Primitive.TextureEntry(rawtextures,0,rawtextures.Length);
569 Appearance.SetTextureEntries(textures);
570 }
564 571
565 if (args["visual_params"] != null) 572 if (args["visual_params"] != null)
566 Appearance.SetVisualParams(args["visual_params"].AsBinary()); 573 Appearance.SetVisualParams(args["visual_params"].AsBinary());
@@ -578,21 +585,25 @@ namespace OpenSim.Framework
578 if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array) 585 if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array)
579 { 586 {
580 OSDArray attachs = (OSDArray)(args["attachments"]); 587 OSDArray attachs = (OSDArray)(args["attachments"]);
581 AvatarAttachment[] attachments = new AvatarAttachment[attachs.Count];
582 int i = 0;
583 foreach (OSD o in attachs) 588 foreach (OSD o in attachs)
584 { 589 {
585 if (o.Type == OSDType.Map) 590 if (o.Type == OSDType.Map)
586 { 591 {
587 attachments[i++] = new AvatarAttachment((OSDMap)o); 592 // We know all of these must end up as attachments so we
593 // append rather than replace to ensure multiple attachments
594 // per point continues to work
595 Appearance.AppendAttachment(new AvatarAttachment((OSDMap)o));
588 } 596 }
589 } 597 }
590 Appearance.SetAttachments(attachments);
591 } 598 }
592 // end of code to remove 599 // end of code to remove
593 600
594 if (args["packed_appearance"] != null) 601 if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map)
595 Appearance = new AvatarAppearance(AgentID,(OSDMap)args["packed_appearance"]); 602 Appearance = new AvatarAppearance(AgentID,(OSDMap)args["packed_appearance"]);
603// DEBUG ON
604 else
605 System.Console.WriteLine("No packed appearance in AgentUpdate");
606// DEBUG OFF
596 607
597 if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array) 608 if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array)
598 { 609 {