diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/EventManager.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index a246319..4fec44f 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -90,6 +90,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
90 | /// </remarks> | 90 | /// </remarks> |
91 | public event OnTerrainTickDelegate OnTerrainTick; | 91 | public event OnTerrainTickDelegate OnTerrainTick; |
92 | 92 | ||
93 | public delegate void OnTerrainUpdateDelegate(); | ||
94 | |||
95 | public event OnTerrainUpdateDelegate OnTerrainUpdate; | ||
96 | |||
93 | public delegate void OnBackupDelegate(ISimulationDataService datastore, bool forceBackup); | 97 | public delegate void OnBackupDelegate(ISimulationDataService datastore, bool forceBackup); |
94 | 98 | ||
95 | /// <summary> | 99 | /// <summary> |
@@ -339,8 +343,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
339 | /// in <see cref="Scene.SetScriptRunning"/> | 343 | /// in <see cref="Scene.SetScriptRunning"/> |
340 | /// via <see cref="OpenSim.Framework.IClientAPI.OnSetScriptRunning"/>, | 344 | /// via <see cref="OpenSim.Framework.IClientAPI.OnSetScriptRunning"/>, |
341 | /// via <see cref="OpenSim.Region.ClientStack.LindenUDP.HandleSetScriptRunning"/> | 345 | /// via <see cref="OpenSim.Region.ClientStack.LindenUDP.HandleSetScriptRunning"/> |
342 | /// XXX: This is only triggered when it is the client that starts the script, not in other situations where | ||
343 | /// a script is started, unlike OnStopScript! | ||
344 | /// </remarks> | 346 | /// </remarks> |
345 | public event StartScript OnStartScript; | 347 | public event StartScript OnStartScript; |
346 | 348 | ||
@@ -354,7 +356,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
354 | /// in <see cref="SceneObjectPartInventory.CreateScriptInstance"/>, | 356 | /// in <see cref="SceneObjectPartInventory.CreateScriptInstance"/>, |
355 | /// <see cref="SceneObjectPartInventory.StopScriptInstance"/>, | 357 | /// <see cref="SceneObjectPartInventory.StopScriptInstance"/>, |
356 | /// <see cref="Scene.SetScriptRunning"/> | 358 | /// <see cref="Scene.SetScriptRunning"/> |
357 | /// XXX: This is triggered when a sciprt is stopped for any reason, unlike OnStartScript! | ||
358 | /// </remarks> | 359 | /// </remarks> |
359 | public event StopScript OnStopScript; | 360 | public event StopScript OnStopScript; |
360 | 361 | ||
@@ -842,6 +843,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
842 | public event ParcelPrimCountTainted OnParcelPrimCountTainted; | 843 | public event ParcelPrimCountTainted OnParcelPrimCountTainted; |
843 | public event GetScriptRunning OnGetScriptRunning; | 844 | public event GetScriptRunning OnGetScriptRunning; |
844 | 845 | ||
846 | public delegate void ThrottleUpdate(ScenePresence scenePresence); | ||
847 | |||
848 | public event ThrottleUpdate OnThrottleUpdate; | ||
849 | |||
845 | /// <summary> | 850 | /// <summary> |
846 | /// RegisterCapsEvent is called by Scene after the Caps object | 851 | /// RegisterCapsEvent is called by Scene after the Caps object |
847 | /// has been instantiated and before it is return to the | 852 | /// has been instantiated and before it is return to the |
@@ -1425,6 +1430,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
1425 | } | 1430 | } |
1426 | } | 1431 | } |
1427 | } | 1432 | } |
1433 | public void TriggerTerrainUpdate() | ||
1434 | { | ||
1435 | OnTerrainUpdateDelegate handlerTerrainUpdate = OnTerrainUpdate; | ||
1436 | if (handlerTerrainUpdate != null) | ||
1437 | { | ||
1438 | foreach (OnTerrainUpdateDelegate d in handlerTerrainUpdate.GetInvocationList()) | ||
1439 | { | ||
1440 | try | ||
1441 | { | ||
1442 | d(); | ||
1443 | } | ||
1444 | catch (Exception e) | ||
1445 | { | ||
1446 | m_log.ErrorFormat( | ||
1447 | "[EVENT MANAGER]: Delegate for TriggerTerrainUpdate failed - continuing. {0} {1}", | ||
1448 | e.Message, e.StackTrace); | ||
1449 | } | ||
1450 | } | ||
1451 | } | ||
1452 | } | ||
1428 | 1453 | ||
1429 | public void TriggerTerrainTick() | 1454 | public void TriggerTerrainTick() |
1430 | { | 1455 | { |
@@ -1757,6 +1782,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1757 | m_log.ErrorFormat( | 1782 | m_log.ErrorFormat( |
1758 | "[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing. {0} {1}", | 1783 | "[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing. {0} {1}", |
1759 | e.Message, e.StackTrace); | 1784 | e.Message, e.StackTrace); |
1785 | m_log.ErrorFormat(Environment.StackTrace); | ||
1760 | } | 1786 | } |
1761 | } | 1787 | } |
1762 | } | 1788 | } |
@@ -3035,6 +3061,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3035 | { | 3061 | { |
3036 | foreach (Action<Scene> d in handler.GetInvocationList()) | 3062 | foreach (Action<Scene> d in handler.GetInvocationList()) |
3037 | { | 3063 | { |
3064 | m_log.InfoFormat("[EVENT MANAGER]: TriggerSceneShuttingDown invoque {0}", d.Method.Name.ToString()); | ||
3038 | try | 3065 | try |
3039 | { | 3066 | { |
3040 | d(s); | 3067 | d(s); |
@@ -3047,6 +3074,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3047 | } | 3074 | } |
3048 | } | 3075 | } |
3049 | } | 3076 | } |
3077 | m_log.Info("[EVENT MANAGER]: TriggerSceneShuttingDown done"); | ||
3050 | } | 3078 | } |
3051 | 3079 | ||
3052 | public void TriggerOnRegionStarted(Scene scene) | 3080 | public void TriggerOnRegionStarted(Scene scene) |
@@ -3237,5 +3265,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
3237 | } | 3265 | } |
3238 | } | 3266 | } |
3239 | } | 3267 | } |
3268 | |||
3269 | public void TriggerThrottleUpdate(ScenePresence scenePresence) | ||
3270 | { | ||
3271 | ThrottleUpdate handler = OnThrottleUpdate; | ||
3272 | if (handler != null) | ||
3273 | { | ||
3274 | handler(scenePresence); | ||
3275 | } | ||
3276 | } | ||
3240 | } | 3277 | } |
3241 | } | 3278 | } |