aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-04-17 00:00:45 +0100
committerJustin Clark-Casey (justincc)2010-04-17 00:00:45 +0100
commit26e38842372e934937be36a21d8a99742cd485fe (patch)
treeb29eedfcae9ef10194a1c3053b63bbadd3e1e9e7 /OpenSim/Region
parentrefactor: remove now unused internal method SendAttachEvent() (diff)
downloadopensim-SC_OLD-26e38842372e934937be36a21d8a99742cd485fe.zip
opensim-SC_OLD-26e38842372e934937be36a21d8a99742cd485fe.tar.gz
opensim-SC_OLD-26e38842372e934937be36a21d8a99742cd485fe.tar.bz2
opensim-SC_OLD-26e38842372e934937be36a21d8a99742cd485fe.tar.xz
refactor: move DeatchObject() into the AttachmentsModule
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs10
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs10
3 files changed, 24 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index f8fb7ca..c87a383 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -323,6 +323,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
323 } 323 }
324 } 324 }
325 325
326 public void DetachObject(uint objectLocalID, IClientAPI remoteClient)
327 {
328 SceneObjectGroup group = m_scene.GetGroupByPrim(objectLocalID);
329 if (group != null)
330 {
331 //group.DetachToGround();
332 ShowDetachInUserInventory(group.GetFromItemID(), remoteClient);
333 }
334 }
335
326 public void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient) 336 public void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient)
327 { 337 {
328 ScenePresence presence; 338 ScenePresence presence;
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
index d43ce1f..f8af367 100644
--- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
@@ -94,6 +94,16 @@ namespace OpenSim.Region.Framework.Interfaces
94 RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects); 94 RezMultipleAttachmentsFromInvPacket.ObjectDataBlock[] objects);
95 95
96 /// <summary> 96 /// <summary>
97 /// Detach an object from the avatar.
98 /// </summary>
99 ///
100 /// This method is called in response to a client's detach request, so we only update the information in
101 /// inventory
102 /// <param name="objectLocalID"></param>
103 /// <param name="remoteClient"></param>
104 void DetachObject(uint objectLocalID, IClientAPI remoteClient);
105
106 /// <summary>
97 /// Detach the given item to the ground. 107 /// Detach the given item to the ground.
98 /// </summary> 108 /// </summary>
99 /// <param name="itemID"></param> 109 /// <param name="itemID"></param>
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index d4da2cb..a34f57e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2769,14 +2769,13 @@ namespace OpenSim.Region.Framework.Scenes
2769 } 2769 }
2770 2770
2771 public virtual void SubscribeToClientAttachmentEvents(IClientAPI client) 2771 public virtual void SubscribeToClientAttachmentEvents(IClientAPI client)
2772 { 2772 {
2773 client.OnObjectDetach += m_sceneGraph.DetachObject;
2774
2775 if (AttachmentsModule != null) 2773 if (AttachmentsModule != null)
2776 { 2774 {
2777 client.OnRezSingleAttachmentFromInv += AttachmentsModule.RezSingleAttachmentFromInventory; 2775 client.OnRezSingleAttachmentFromInv += AttachmentsModule.RezSingleAttachmentFromInventory;
2778 client.OnRezMultipleAttachmentsFromInv += AttachmentsModule.RezMultipleAttachmentsFromInventory; 2776 client.OnRezMultipleAttachmentsFromInv += AttachmentsModule.RezMultipleAttachmentsFromInventory;
2779 client.OnObjectAttach += AttachmentsModule.AttachObject; 2777 client.OnObjectAttach += AttachmentsModule.AttachObject;
2778 client.OnObjectDetach += AttachmentsModule.DetachObject;
2780 client.OnDetachAttachmentIntoInv += AttachmentsModule.ShowDetachInUserInventory; 2779 client.OnDetachAttachmentIntoInv += AttachmentsModule.ShowDetachInUserInventory;
2781 } 2780 }
2782 } 2781 }
@@ -2925,14 +2924,13 @@ namespace OpenSim.Region.Framework.Scenes
2925 } 2924 }
2926 2925
2927 public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client) 2926 public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client)
2928 { 2927 {
2929 client.OnObjectDetach -= m_sceneGraph.DetachObject;
2930
2931 if (AttachmentsModule != null) 2928 if (AttachmentsModule != null)
2932 { 2929 {
2933 client.OnRezSingleAttachmentFromInv -= AttachmentsModule.RezSingleAttachmentFromInventory; 2930 client.OnRezSingleAttachmentFromInv -= AttachmentsModule.RezSingleAttachmentFromInventory;
2934 client.OnRezMultipleAttachmentsFromInv -= AttachmentsModule.RezMultipleAttachmentsFromInventory; 2931 client.OnRezMultipleAttachmentsFromInv -= AttachmentsModule.RezMultipleAttachmentsFromInventory;
2935 client.OnObjectAttach -= AttachmentsModule.AttachObject; 2932 client.OnObjectAttach -= AttachmentsModule.AttachObject;
2933 client.OnObjectDetach -= AttachmentsModule.DetachObject;
2936 client.OnDetachAttachmentIntoInv -= AttachmentsModule.ShowDetachInUserInventory; 2934 client.OnDetachAttachmentIntoInv -= AttachmentsModule.ShowDetachInUserInventory;
2937 } 2935 }
2938 } 2936 }