diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/AgentCircuitData.cs | 13 | ||||
-rw-r--r-- | OpenSim/Framework/AvatarAppearance.cs | 2 | ||||
-rw-r--r-- | OpenSim/Framework/ChildAgentDataUpdate.cs | 33 |
3 files changed, 28 insertions, 20 deletions
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs index 30a9548..098b33c 100644 --- a/OpenSim/Framework/AgentCircuitData.cs +++ b/OpenSim/Framework/AgentCircuitData.cs | |||
@@ -368,15 +368,12 @@ namespace OpenSim.Framework | |||
368 | } | 368 | } |
369 | } | 369 | } |
370 | 370 | ||
371 | if (args["packed_appearance"] != null) | 371 | if (args.ContainsKey("packed_appearance") && (args["packed_appearance"].Type == OSDType.Map)) |
372 | { | 372 | { |
373 | if (args["packed_appearance"].Type == OSDType.Map) | 373 | Appearance.Unpack((OSDMap)args["packed_appearance"]); |
374 | { | 374 | // DEBUG ON |
375 | Appearance.Unpack((OSDMap)args["packed_appearance"]); | 375 | m_log.WarnFormat("[AGENTCIRCUITDATA] unpacked appearance"); |
376 | m_log.WarnFormat("[AGENTCIRCUITDATA] unpacked appearance"); | 376 | // DEBUG OFF |
377 | } | ||
378 | else | ||
379 | m_log.WarnFormat("[AGENTCIRCUITDATA] packed_appearance is not a map:\n{0}",args["packed_appearance"].ToString()); | ||
380 | } | 377 | } |
381 | // DEBUG ON | 378 | // DEBUG ON |
382 | else | 379 | else |
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index ba0cad2..05330c7 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs | |||
@@ -389,7 +389,7 @@ namespace OpenSim.Framework | |||
389 | changed = true; | 389 | changed = true; |
390 | // DEBUG ON | 390 | // DEBUG ON |
391 | if (newface != null) | 391 | if (newface != null) |
392 | m_log.WarnFormat("[SCENEPRESENCE] index {0}, new texture id {1}",i,newface.TextureID); | 392 | m_log.WarnFormat("[AVATAR APPEARANCE] index {0}, new texture id {1}",i,newface.TextureID); |
393 | // DEBUG OFF | 393 | // DEBUG OFF |
394 | } | 394 | } |
395 | 395 | ||
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 | { |