diff options
author | Justin Clark-Casey (justincc) | 2011-03-23 21:50:56 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-03-23 21:53:14 +0000 |
commit | d011896341d09ce6c10a801264e663b6a19f0b48 (patch) | |
tree | 02369e0c5a2103e8f42f5bf6128814de9e2afaf5 /OpenSim/Region/Framework/Scenes/EventManager.cs | |
parent | Fix a typo in the SQLite DLL config and amend the instructions for running on... (diff) | |
download | opensim-SC-d011896341d09ce6c10a801264e663b6a19f0b48.zip opensim-SC-d011896341d09ce6c10a801264e663b6a19f0b48.tar.gz opensim-SC-d011896341d09ce6c10a801264e663b6a19f0b48.tar.bz2 opensim-SC-d011896341d09ce6c10a801264e663b6a19f0b48.tar.xz |
Add generic EventManager.OnObjectAddedToScene and get PrimCountModule to listen for that rather than EventManager.OnParcelPrimCountAdd
OnParcelPrimCountAdd had the wrong semantics for the PrimCountModule - it was invoked for every entity in the scene, not just new ones, which would screw up the untainted count.
Extend automated test for this scenario.
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 c321a15..fd62535 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -242,7 +242,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
242 | public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID); | 242 | public delegate void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID); |
243 | 243 | ||
244 | public event EstateToolsSunUpdate OnEstateToolsSunUpdate; | 244 | public event EstateToolsSunUpdate OnEstateToolsSunUpdate; |
245 | |||
246 | /// <summary> | ||
247 | /// Triggered when an object is added to the scene. | ||
248 | /// </summary> | ||
249 | public event Action<SceneObjectGroup> OnObjectAddedToScene; | ||
245 | 250 | ||
251 | /// <summary> | ||
252 | /// Triggered when an object is removed from the scene. | ||
253 | /// </summary> | ||
246 | public delegate void ObjectBeingRemovedFromScene(SceneObjectGroup obj); | 254 | public delegate void ObjectBeingRemovedFromScene(SceneObjectGroup obj); |
247 | public event ObjectBeingRemovedFromScene OnObjectBeingRemovedFromScene; | 255 | public event ObjectBeingRemovedFromScene OnObjectBeingRemovedFromScene; |
248 | 256 | ||
@@ -345,6 +353,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
345 | public delegate void Attach(uint localID, UUID itemID, UUID avatarID); | 353 | public delegate void Attach(uint localID, UUID itemID, UUID avatarID); |
346 | public event Attach OnAttach; | 354 | public event Attach OnAttach; |
347 | 355 | ||
356 | |||
348 | /// <summary> | 357 | /// <summary> |
349 | /// Called immediately after an object is loaded from storage. | 358 | /// Called immediately after an object is loaded from storage. |
350 | /// </summary> | 359 | /// </summary> |
@@ -800,6 +809,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
800 | } | 809 | } |
801 | } | 810 | } |
802 | 811 | ||
812 | public void TriggerObjectAddedToScene(SceneObjectGroup obj) | ||
813 | { | ||
814 | Action<SceneObjectGroup> handler = OnObjectAddedToScene; | ||
815 | if (handler != null) | ||
816 | { | ||
817 | foreach (Action<SceneObjectGroup> d in handler.GetInvocationList()) | ||
818 | { | ||
819 | try | ||
820 | { | ||
821 | d(obj); | ||
822 | } | ||
823 | catch (Exception e) | ||
824 | { | ||
825 | m_log.ErrorFormat( | ||
826 | "[EVENT MANAGER]: Delegate for TriggerObjectAddedToScene failed - continuing. {0} {1}", | ||
827 | e.Message, e.StackTrace); | ||
828 | } | ||
829 | } | ||
830 | } | ||
831 | } | ||
832 | |||
803 | public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj) | 833 | public void TriggerObjectBeingRemovedFromScene(SceneObjectGroup obj) |
804 | { | 834 | { |
805 | ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene; | 835 | ObjectBeingRemovedFromScene handlerObjectBeingRemovedFromScene = OnObjectBeingRemovedFromScene; |