From b72c2dc6e88fa2ea6bb97e0b32d0cdbb2ea78c4a Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 5 Mar 2010 23:29:24 +0000
Subject: refactor: move user inventory side of RezSingleAttachment to module
---
.../Avatar/Attachments/AttachmentsModule.cs | 30 ++++++++++++++++++++++
1 file changed, 30 insertions(+)
(limited to 'OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs')
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 103a813..0ea1f63 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -137,5 +137,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
return true;
}
+
+ ///
+ /// Update the user inventory to reflect an attachment
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public UUID SetAttachmentInventoryStatus(
+ SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
+ {
+ m_log.DebugFormat(
+ "[USER INVENTORY]: Updating inventory of {0} to show attachment of {1} (item ID {2})",
+ remoteClient.Name, att.Name, itemID);
+
+ if (!att.IsDeleted)
+ AttachmentPt = att.RootPart.AttachmentPoint;
+
+ ScenePresence presence;
+ if (m_scene.TryGetAvatar(remoteClient.AgentId, out presence))
+ {
+ InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
+ item = m_scene.InventoryService.GetItem(item);
+
+ presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
+ }
+
+ return att.UUID;
+ }
}
}
\ No newline at end of file
--
cgit v1.1