diff options
Diffstat (limited to 'OpenSim/ApplicationPlugins')
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 28 | ||||
-rw-r--r-- | OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs | 25 |
2 files changed, 20 insertions, 33 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index aeed467..1829c8d 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -1472,12 +1472,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1472 | { | 1472 | { |
1473 | m_log.DebugFormat("[RADMIN] Initializing inventory for {0} from {1}", destination, source); | 1473 | m_log.DebugFormat("[RADMIN] Initializing inventory for {0} from {1}", destination, source); |
1474 | Scene scene = m_application.SceneManager.CurrentOrFirstScene; | 1474 | Scene scene = m_application.SceneManager.CurrentOrFirstScene; |
1475 | AvatarAppearance avatarAppearance = null; | ||
1476 | AvatarData avatar = scene.AvatarService.GetAvatar(source); | ||
1477 | if (avatar != null) | ||
1478 | avatarAppearance = avatar.ToAvatarAppearance(source); | ||
1479 | 1475 | ||
1480 | // If the model has no associated appearance we're done. | 1476 | // If the model has no associated appearance we're done. |
1477 | AvatarAppearance avatarAppearance = scene.AvatarService.GetAppearance(source); | ||
1481 | if (avatarAppearance == null) | 1478 | if (avatarAppearance == null) |
1482 | return; | 1479 | return; |
1483 | 1480 | ||
@@ -1491,8 +1488,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1491 | { | 1488 | { |
1492 | CopyWearablesAndAttachments(destination, source, avatarAppearance); | 1489 | CopyWearablesAndAttachments(destination, source, avatarAppearance); |
1493 | 1490 | ||
1494 | AvatarData avatarData = new AvatarData(avatarAppearance); | 1491 | scene.AvatarService.SetAppearance(destination, avatarAppearance); |
1495 | scene.AvatarService.SetAvatar(destination, avatarData); | ||
1496 | } | 1492 | } |
1497 | catch (Exception e) | 1493 | catch (Exception e) |
1498 | { | 1494 | { |
@@ -1523,8 +1519,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1523 | } | 1519 | } |
1524 | } | 1520 | } |
1525 | 1521 | ||
1526 | AvatarData avatarData = new AvatarData(avatarAppearance); | 1522 | scene.AvatarService.SetAppearance(destination, avatarAppearance); |
1527 | scene.AvatarService.SetAvatar(destination, avatarData); | ||
1528 | } | 1523 | } |
1529 | catch (Exception e) | 1524 | catch (Exception e) |
1530 | { | 1525 | { |
@@ -1619,12 +1614,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1619 | } | 1614 | } |
1620 | 1615 | ||
1621 | // Attachments | 1616 | // Attachments |
1622 | Dictionary<int, UUID[]> attachments = avatarAppearance.GetAttachmentDictionary(); | 1617 | List<AvatarAttachment> attachments = avatarAppearance.GetAttachments(); |
1623 | 1618 | ||
1624 | foreach (KeyValuePair<int, UUID[]> attachment in attachments) | 1619 | foreach (AvatarAttachment attachment in attachments) |
1625 | { | 1620 | { |
1626 | int attachpoint = attachment.Key; | 1621 | int attachpoint = attachment.AttachPoint; |
1627 | UUID itemID = attachment.Value[0]; | 1622 | UUID itemID = attachment.ItemID; |
1628 | 1623 | ||
1629 | if (itemID != UUID.Zero) | 1624 | if (itemID != UUID.Zero) |
1630 | { | 1625 | { |
@@ -1908,10 +1903,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1908 | if (include) | 1903 | if (include) |
1909 | { | 1904 | { |
1910 | // Setup for appearance processing | 1905 | // Setup for appearance processing |
1911 | AvatarData avatarData = scene.AvatarService.GetAvatar(ID); | 1906 | avatarAppearance = scene.AvatarService.GetAppearance(ID); |
1912 | if (avatarData != null) | 1907 | if (avatarAppearance == null) |
1913 | avatarAppearance = avatarData.ToAvatarAppearance(ID); | ||
1914 | else | ||
1915 | avatarAppearance = new AvatarAppearance(); | 1908 | avatarAppearance = new AvatarAppearance(); |
1916 | 1909 | ||
1917 | AvatarWearable[] wearables = avatarAppearance.Wearables; | 1910 | AvatarWearable[] wearables = avatarAppearance.Wearables; |
@@ -2076,8 +2069,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2076 | m_log.DebugFormat("[RADMIN] Outfit {0} load completed", outfitName); | 2069 | m_log.DebugFormat("[RADMIN] Outfit {0} load completed", outfitName); |
2077 | } // foreach outfit | 2070 | } // foreach outfit |
2078 | m_log.DebugFormat("[RADMIN] Inventory update complete for {0}", name); | 2071 | m_log.DebugFormat("[RADMIN] Inventory update complete for {0}", name); |
2079 | AvatarData avatarData2 = new AvatarData(avatarAppearance); | 2072 | scene.AvatarService.SetAppearance(ID, avatarAppearance); |
2080 | scene.AvatarService.SetAvatar(ID, avatarData2); | ||
2081 | } | 2073 | } |
2082 | catch (Exception e) | 2074 | catch (Exception e) |
2083 | { | 2075 | { |
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 | ||