diff options
author | Justin Clark-Casey (justincc) | 2010-03-05 23:29:24 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-03-05 23:29:24 +0000 |
commit | b72c2dc6e88fa2ea6bb97e0b32d0cdbb2ea78c4a (patch) | |
tree | c10be55d7244e593f44deaf608b0d8d921995848 /OpenSim/Region | |
parent | revert accidental Standalone.ini change (diff) | |
download | opensim-SC_OLD-b72c2dc6e88fa2ea6bb97e0b32d0cdbb2ea78c4a.zip opensim-SC_OLD-b72c2dc6e88fa2ea6bb97e0b32d0cdbb2ea78c4a.tar.gz opensim-SC_OLD-b72c2dc6e88fa2ea6bb97e0b32d0cdbb2ea78c4a.tar.bz2 opensim-SC_OLD-b72c2dc6e88fa2ea6bb97e0b32d0cdbb2ea78c4a.tar.xz |
refactor: move user inventory side of RezSingleAttachment to module
Diffstat (limited to 'OpenSim/Region')
3 files changed, 43 insertions, 29 deletions
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 | |||
137 | 137 | ||
138 | return true; | 138 | return true; |
139 | } | 139 | } |
140 | |||
141 | /// <summary> | ||
142 | /// Update the user inventory to reflect an attachment | ||
143 | /// </summary> | ||
144 | /// <param name="att"></param> | ||
145 | /// <param name="remoteClient"></param> | ||
146 | /// <param name="itemID"></param> | ||
147 | /// <param name="AttachmentPt"></param> | ||
148 | /// <returns></returns> | ||
149 | public UUID SetAttachmentInventoryStatus( | ||
150 | SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt) | ||
151 | { | ||
152 | m_log.DebugFormat( | ||
153 | "[USER INVENTORY]: Updating inventory of {0} to show attachment of {1} (item ID {2})", | ||
154 | remoteClient.Name, att.Name, itemID); | ||
155 | |||
156 | if (!att.IsDeleted) | ||
157 | AttachmentPt = att.RootPart.AttachmentPoint; | ||
158 | |||
159 | ScenePresence presence; | ||
160 | if (m_scene.TryGetAvatar(remoteClient.AgentId, out presence)) | ||
161 | { | ||
162 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | ||
163 | item = m_scene.InventoryService.GetItem(item); | ||
164 | |||
165 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); | ||
166 | } | ||
167 | |||
168 | return att.UUID; | ||
169 | } | ||
140 | } | 170 | } |
141 | } \ No newline at end of file | 171 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index c965bcf..5e5df4b 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using OpenMetaverse; | 29 | using OpenMetaverse; |
30 | using OpenSim.Framework; | 30 | using OpenSim.Framework; |
31 | using OpenSim.Region.Framework.Scenes; | ||
31 | 32 | ||
32 | namespace OpenSim.Region.Framework.Interfaces | 33 | namespace OpenSim.Region.Framework.Interfaces |
33 | { | 34 | { |
@@ -45,5 +46,16 @@ namespace OpenSim.Region.Framework.Interfaces | |||
45 | /// <returns>true if the object was successfully attached, false otherwise</returns> | 46 | /// <returns>true if the object was successfully attached, false otherwise</returns> |
46 | bool AttachObject( | 47 | bool AttachObject( |
47 | IClientAPI controllingClient, uint localID, uint attachPoint, Quaternion rot, Vector3 pos, bool silent); | 48 | IClientAPI controllingClient, uint localID, uint attachPoint, Quaternion rot, Vector3 pos, bool silent); |
49 | |||
50 | /// <summary> | ||
51 | /// Update the user inventory to the attachment of an item | ||
52 | /// </summary> | ||
53 | /// <param name="att"></param> | ||
54 | /// <param name="remoteClient"></param> | ||
55 | /// <param name="itemID"></param> | ||
56 | /// <param name="AttachmentPt"></param> | ||
57 | /// <returns></returns> | ||
58 | UUID SetAttachmentInventoryStatus( | ||
59 | SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt); | ||
48 | } | 60 | } |
49 | } \ No newline at end of file | 61 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 474fba9..6a5dc56 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1862,35 +1862,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1862 | return UUID.Zero; | 1862 | return UUID.Zero; |
1863 | } | 1863 | } |
1864 | 1864 | ||
1865 | return RezSingleAttachment(att, remoteClient, itemID, AttachmentPt); | 1865 | return AttachmentsModule.SetAttachmentInventoryStatus(att, remoteClient, itemID, AttachmentPt); |
1866 | } | ||
1867 | |||
1868 | /// <summary> | ||
1869 | /// Update the user inventory to reflect an attachment | ||
1870 | /// </summary> | ||
1871 | /// <param name="att"></param> | ||
1872 | /// <param name="remoteClient"></param> | ||
1873 | /// <param name="itemID"></param> | ||
1874 | /// <param name="AttachmentPt"></param> | ||
1875 | /// <returns></returns> | ||
1876 | public UUID RezSingleAttachment(SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt) | ||
1877 | { | ||
1878 | m_log.DebugFormat( | ||
1879 | "[USER INVENTORY]: Updating inventory of {0} to show attachment of {1} (item ID {2})", | ||
1880 | remoteClient.Name, att.Name, itemID); | ||
1881 | |||
1882 | if (!att.IsDeleted) | ||
1883 | AttachmentPt = att.RootPart.AttachmentPoint; | ||
1884 | |||
1885 | ScenePresence presence; | ||
1886 | if (TryGetAvatar(remoteClient.AgentId, out presence)) | ||
1887 | { | ||
1888 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | ||
1889 | item = InventoryService.GetItem(item); | ||
1890 | |||
1891 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/); | ||
1892 | } | ||
1893 | return att.UUID; | ||
1894 | } | 1866 | } |
1895 | 1867 | ||
1896 | public void RezMultipleAttachments(IClientAPI remoteClient, RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header, | 1868 | public void RezMultipleAttachments(IClientAPI remoteClient, RezMultipleAttachmentsFromInvPacket.HeaderDataBlock header, |