diff options
author | Justin Clark-Casey (justincc) | 2010-07-30 21:41:44 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-07-30 21:41:44 +0100 |
commit | 424b4b2b8663f0f6780d2d3a2656e5b298418711 (patch) | |
tree | f608b701dc73df59161a0585a65c297b9c069bc4 /OpenSim/Region/CoreModules/Avatar | |
parent | remove unused BasicQuadTreeNode (diff) | |
download | opensim-SC_OLD-424b4b2b8663f0f6780d2d3a2656e5b298418711.zip opensim-SC_OLD-424b4b2b8663f0f6780d2d3a2656e5b298418711.tar.gz opensim-SC_OLD-424b4b2b8663f0f6780d2d3a2656e5b298418711.tar.bz2 opensim-SC_OLD-424b4b2b8663f0f6780d2d3a2656e5b298418711.tar.xz |
move attachment subscription events into AttachmentsModule from scene.
restored to some heavy casting in order to preserve RegionCombinerModule semantics, pending better events.
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 1187e91..d895bb1 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -56,11 +56,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
56 | { | 56 | { |
57 | m_scene = scene; | 57 | m_scene = scene; |
58 | m_scene.RegisterModuleInterface<IAttachmentsModule>(this); | 58 | m_scene.RegisterModuleInterface<IAttachmentsModule>(this); |
59 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; | ||
60 | // TODO: Should probably be subscribing to CloseClient too, but this doesn't yet give us IClientAPI | ||
59 | } | 61 | } |
60 | 62 | ||
61 | public void RemoveRegion(Scene scene) | 63 | public void RemoveRegion(Scene scene) |
62 | { | 64 | { |
63 | m_scene.UnregisterModuleInterface<IAttachmentsModule>(this); | 65 | m_scene.UnregisterModuleInterface<IAttachmentsModule>(this); |
66 | m_scene.EventManager.OnNewClient -= SubscribeToClientEvents; | ||
64 | } | 67 | } |
65 | 68 | ||
66 | public void RegionLoaded(Scene scene) {} | 69 | public void RegionLoaded(Scene scene) {} |
@@ -69,7 +72,25 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
69 | { | 72 | { |
70 | RemoveRegion(m_scene); | 73 | RemoveRegion(m_scene); |
71 | } | 74 | } |
72 | 75 | ||
76 | public void SubscribeToClientEvents(IClientAPI client) | ||
77 | { | ||
78 | client.OnRezSingleAttachmentFromInv += RezSingleAttachmentFromInventory; | ||
79 | client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachmentsFromInventory; | ||
80 | client.OnObjectAttach += AttachObject; | ||
81 | client.OnObjectDetach += DetachObject; | ||
82 | client.OnDetachAttachmentIntoInv += ShowDetachInUserInventory; | ||
83 | } | ||
84 | |||
85 | public void UnsubscribeFromClientEvents(IClientAPI client) | ||
86 | { | ||
87 | client.OnRezSingleAttachmentFromInv -= RezSingleAttachmentFromInventory; | ||
88 | client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachmentsFromInventory; | ||
89 | client.OnObjectAttach -= AttachObject; | ||
90 | client.OnObjectDetach -= DetachObject; | ||
91 | client.OnDetachAttachmentIntoInv -= ShowDetachInUserInventory; | ||
92 | } | ||
93 | |||
73 | /// <summary> | 94 | /// <summary> |
74 | /// Called by client | 95 | /// Called by client |
75 | /// </summary> | 96 | /// </summary> |