diff options
author | Master ScienceSim | 2010-10-21 16:48:58 -0700 |
---|---|---|
committer | Master ScienceSim | 2010-10-21 16:48:58 -0700 |
commit | 267f18925d06ca05e2a5ffbfbb63582783762439 (patch) | |
tree | 3f2d00b3269a97ad75094f58137f56ebbb36aa35 /OpenSim/ApplicationPlugins | |
parent | Major refactoring of appearance handling. (diff) | |
download | opensim-SC-267f18925d06ca05e2a5ffbfbb63582783762439.zip opensim-SC-267f18925d06ca05e2a5ffbfbb63582783762439.tar.gz opensim-SC-267f18925d06ca05e2a5ffbfbb63582783762439.tar.bz2 opensim-SC-267f18925d06ca05e2a5ffbfbb63582783762439.tar.xz |
First attempt to get multiple attachments working to support viewer2.
The attachment code appears to work correctly for 1.23 viewers so, in
spite of some big changes in the internal representation, there don't
appear to be regressions. That being said, I still can't get a viewer2
avatar to show correctly.
Diffstat (limited to 'OpenSim/ApplicationPlugins')
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 8 | ||||
-rw-r--r-- | OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs | 25 |
2 files changed, 14 insertions, 19 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 0589748..1829c8d 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -1614,12 +1614,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1614 | } | 1614 | } |
1615 | 1615 | ||
1616 | // Attachments | 1616 | // Attachments |
1617 | Dictionary<int, AvatarAttachment> attachments = avatarAppearance.Attachments; | 1617 | List<AvatarAttachment> attachments = avatarAppearance.GetAttachments(); |
1618 | 1618 | ||
1619 | foreach (KeyValuePair<int, AvatarAttachment> attachment in attachments) | 1619 | foreach (AvatarAttachment attachment in attachments) |
1620 | { | 1620 | { |
1621 | int attachpoint = attachment.Value.AttachPoint; | 1621 | int attachpoint = attachment.AttachPoint; |
1622 | UUID itemID = attachment.Value.ItemID; | 1622 | UUID itemID = attachment.ItemID; |
1623 | 1623 | ||
1624 | if (itemID != UUID.Zero) | 1624 | if (itemID != UUID.Zero) |
1625 | { | 1625 | { |
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs index 8271d76..3f6d4d6 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | ||
30 | using System.Xml; | 31 | using System.Xml; |
31 | using OpenMetaverse; | 32 | using OpenMetaverse; |
32 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
@@ -765,25 +766,19 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory | |||
765 | FormatPart(rdata, "UnderShirt", rdata.userAppearance.UnderShirtItem, rdata.userAppearance.UnderShirtAsset); | 766 | FormatPart(rdata, "UnderShirt", rdata.userAppearance.UnderShirtItem, rdata.userAppearance.UnderShirtAsset); |
766 | FormatPart(rdata, "UnderPants", rdata.userAppearance.UnderPantsItem, rdata.userAppearance.UnderPantsAsset); | 767 | FormatPart(rdata, "UnderPants", rdata.userAppearance.UnderPantsItem, rdata.userAppearance.UnderPantsAsset); |
767 | 768 | ||
768 | Hashtable attachments = rdata.userAppearance.GetAttachments(); | 769 | Rest.Log.DebugFormat("{0} FormatUserAppearance: Formatting attachments", MsgId); |
769 | 770 | ||
770 | if (attachments != null) | 771 | rdata.writer.WriteStartElement("Attachments"); |
772 | List<AvatarAttachment> attachments = rdata.userAppearance.GetAttachments(); | ||
773 | foreach (AvatarAttachment attach in attachments) | ||
771 | { | 774 | { |
772 | 775 | rdata.writer.WriteStartElement("Attachment"); | |
773 | Rest.Log.DebugFormat("{0} FormatUserAppearance: Formatting attachments", MsgId); | 776 | rdata.writer.WriteAttributeString("AtPoint", attach.AttachPoint.ToString()); |
774 | 777 | rdata.writer.WriteAttributeString("Item", attach.ItemID.ToString()); | |
775 | rdata.writer.WriteStartElement("Attachments"); | 778 | rdata.writer.WriteAttributeString("Asset", attach.AssetID.ToString()); |
776 | for (int i = 0; i < attachments.Count; i++) | ||
777 | { | ||
778 | Hashtable attachment = attachments[i] as Hashtable; | ||
779 | rdata.writer.WriteStartElement("Attachment"); | ||
780 | rdata.writer.WriteAttributeString("AtPoint", i.ToString()); | ||
781 | rdata.writer.WriteAttributeString("Item", (string) attachment["item"]); | ||
782 | rdata.writer.WriteAttributeString("Asset", (string) attachment["asset"]); | ||
783 | rdata.writer.WriteEndElement(); | ||
784 | } | ||
785 | rdata.writer.WriteEndElement(); | 779 | rdata.writer.WriteEndElement(); |
786 | } | 780 | } |
781 | rdata.writer.WriteEndElement(); | ||
787 | 782 | ||
788 | Primitive.TextureEntry texture = rdata.userAppearance.Texture; | 783 | Primitive.TextureEntry texture = rdata.userAppearance.Texture; |
789 | 784 | ||