diff options
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/EventManager.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index f24c53c..4ce7a6c 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -246,7 +246,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
246 | public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID); | 246 | public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID); |
247 | 247 | ||
248 | public event EstateToolsSunUpdate OnEstateToolsSunUpdate; | 248 | public event EstateToolsSunUpdate OnEstateToolsSunUpdate; |
249 | |||
250 | /// <summary> | ||
251 | /// Triggered when an object is added to the scene. | ||
252 | /// </summary> | ||
253 | public event Action<SceneObjectGroup> OnObjectAddedToScene; | ||
249 | 254 | ||
255 | /// <summary> | ||
256 | /// Triggered when an object is removed from the scene. | ||
257 | /// </summary> | ||
250 | public delegate void ObjectBeingRemovedFromScene(SceneObjectGroup obj); | 258 | public delegate void ObjectBeingRemovedFromScene(SceneObjectGroup obj); |
251 | public event ObjectBeingRemovedFromScene OnObjectBeingRemovedFromScene; | 259 | public event ObjectBeingRemovedFromScene OnObjectBeingRemovedFromScene; |
252 | 260 | ||
@@ -349,6 +357,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
349 | public delegate void Attach(uint localID, UUID itemID, UUID avatarID); | 357 | public delegate void Attach(uint localID, UUID itemID, UUID avatarID); |
350 | public event Attach OnAttach; | 358 | public event Attach OnAttach; |
351 | 359 | ||
360 | |||
352 | /// <summary> | 361 | /// <summary> |
353 | /// Called immediately after an object is loaded from storage. | 362 | /// Called immediately after an object is loaded from storage. |
354 | /// </summary> | 363 | /// </summary> |
@@ -824,6 +833,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
824 | } | 833 | } |
825 | } | 834 | } |
826 | 835 | ||
836 | public void TriggerObjectAddedToScene(SceneObjectGroup obj) | ||
837 | { | ||
838 | Action<SceneObjectGroup> handler = OnObjectAddedToScene; | ||
839 | if (handler != null) | ||
840 | { | ||
841 | foreach (Action<SceneObjectGroup> d in handler.GetInvocationList()) | ||
842 | { | ||
843 | try | ||
844 | { | ||
845 | d(obj); | ||
846 | } | ||
847 | catch (Exception e) | ||
848 | { | ||
849 | m_log.ErrorFormat( | ||
850 | "[EVENT MANAGER]: Delegate for TriggerObjectAddedToScene failed - continuing. {0} {1}", | ||
851 | e.Message, e.StackTrace); | ||
852 | } | ||
853 | } | ||
854 | } | ||
855 | } | ||
856 | |||
827 | public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj) | 857 | public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj) |
828 | { | 858 | { |
829 | ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene; | 859 | ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene; |