aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/EventManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/EventManager.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs43
1 files changed, 40 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 902ded1..ac5f433 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
@@ -815,6 +816,10 @@ namespace OpenSim.Region.Framework.Scenes
815 public event ParcelPrimCountTainted OnParcelPrimCountTainted; 816 public event ParcelPrimCountTainted OnParcelPrimCountTainted;
816 public event GetScriptRunning OnGetScriptRunning; 817 public event GetScriptRunning OnGetScriptRunning;
817 818
819 public delegate void ThrottleUpdate(ScenePresence scenePresence);
820
821 public event ThrottleUpdate OnThrottleUpdate;
822
818 /// <summary> 823 /// <summary>
819 /// RegisterCapsEvent is called by Scene after the Caps object 824 /// RegisterCapsEvent is called by Scene after the Caps object
820 /// has been instantiated and before it is return to the 825 /// has been instantiated and before it is return to the
@@ -1396,6 +1401,26 @@ namespace OpenSim.Region.Framework.Scenes
1396 } 1401 }
1397 } 1402 }
1398 } 1403 }
1404 public void TriggerTerrainUpdate()
1405 {
1406 OnTerrainUpdateDelegate handlerTerrainUpdate = OnTerrainUpdate;
1407 if (handlerTerrainUpdate != null)
1408 {
1409 foreach (OnTerrainUpdateDelegate d in handlerTerrainUpdate.GetInvocationList())
1410 {
1411 try
1412 {
1413 d();
1414 }
1415 catch (Exception e)
1416 {
1417 m_log.ErrorFormat(
1418 "[EVENT MANAGER]: Delegate for TriggerTerrainUpdate failed - continuing. {0} {1}",
1419 e.Message, e.StackTrace);
1420 }
1421 }
1422 }
1423 }
1399 1424
1400 public void TriggerTerrainTick() 1425 public void TriggerTerrainTick()
1401 { 1426 {
@@ -1686,6 +1711,7 @@ namespace OpenSim.Region.Framework.Scenes
1686 m_log.ErrorFormat( 1711 m_log.ErrorFormat(
1687 "[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing. {0} {1}", 1712 "[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing. {0} {1}",
1688 e.Message, e.StackTrace); 1713 e.Message, e.StackTrace);
1714 m_log.ErrorFormat(Environment.StackTrace);
1689 } 1715 }
1690 } 1716 }
1691 } 1717 }
@@ -2922,6 +2948,7 @@ namespace OpenSim.Region.Framework.Scenes
2922 { 2948 {
2923 foreach (Action<Scene> d in handler.GetInvocationList()) 2949 foreach (Action<Scene> d in handler.GetInvocationList())
2924 { 2950 {
2951 m_log.InfoFormat("[EVENT MANAGER]: TriggerSceneShuttingDown invoque {0}", d.Method.Name.ToString());
2925 try 2952 try
2926 { 2953 {
2927 d(s); 2954 d(s);
@@ -2934,6 +2961,7 @@ namespace OpenSim.Region.Framework.Scenes
2934 } 2961 }
2935 } 2962 }
2936 } 2963 }
2964 m_log.Info("[EVENT MANAGER]: TriggerSceneShuttingDown done");
2937 } 2965 }
2938 2966
2939 public void TriggerOnRegionStarted(Scene scene) 2967 public void TriggerOnRegionStarted(Scene scene)
@@ -3103,5 +3131,14 @@ namespace OpenSim.Region.Framework.Scenes
3103 } 3131 }
3104 } 3132 }
3105 } 3133 }
3134
3135 public void TriggerThrottleUpdate(ScenePresence scenePresence)
3136 {
3137 ThrottleUpdate handler = OnThrottleUpdate;
3138 if (handler != null)
3139 {
3140 handler(scenePresence);
3141 }
3142 }
3106 } 3143 }
3107} 3144}