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 9ee1520..052a05e 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
@@ -829,6 +830,10 @@ namespace OpenSim.Region.Framework.Scenes
829 public event ParcelPrimCountTainted OnParcelPrimCountTainted; 830 public event ParcelPrimCountTainted OnParcelPrimCountTainted;
830 public event GetScriptRunning OnGetScriptRunning; 831 public event GetScriptRunning OnGetScriptRunning;
831 832
833 public delegate void ThrottleUpdate(ScenePresence scenePresence);
834
835 public event ThrottleUpdate OnThrottleUpdate;
836
832 /// <summary> 837 /// <summary>
833 /// RegisterCapsEvent is called by Scene after the Caps object 838 /// RegisterCapsEvent is called by Scene after the Caps object
834 /// has been instantiated and before it is return to the 839 /// has been instantiated and before it is return to the
@@ -1410,6 +1415,26 @@ namespace OpenSim.Region.Framework.Scenes
1410 } 1415 }
1411 } 1416 }
1412 } 1417 }
1418 public void TriggerTerrainUpdate()
1419 {
1420 OnTerrainUpdateDelegate handlerTerrainUpdate = OnTerrainUpdate;
1421 if (handlerTerrainUpdate != null)
1422 {
1423 foreach (OnTerrainUpdateDelegate d in handlerTerrainUpdate.GetInvocationList())
1424 {
1425 try
1426 {
1427 d();
1428 }
1429 catch (Exception e)
1430 {
1431 m_log.ErrorFormat(
1432 "[EVENT MANAGER]: Delegate for TriggerTerrainUpdate failed - continuing. {0} {1}",
1433 e.Message, e.StackTrace);
1434 }
1435 }
1436 }
1437 }
1413 1438
1414 public void TriggerTerrainTick() 1439 public void TriggerTerrainTick()
1415 { 1440 {
@@ -1700,6 +1725,7 @@ namespace OpenSim.Region.Framework.Scenes
1700 m_log.ErrorFormat( 1725 m_log.ErrorFormat(
1701 "[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing. {0} {1}", 1726 "[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing. {0} {1}",
1702 e.Message, e.StackTrace); 1727 e.Message, e.StackTrace);
1728 m_log.ErrorFormat(Environment.StackTrace);
1703 } 1729 }
1704 } 1730 }
1705 } 1731 }
@@ -2978,6 +3004,7 @@ namespace OpenSim.Region.Framework.Scenes
2978 { 3004 {
2979 foreach (Action<Scene> d in handler.GetInvocationList()) 3005 foreach (Action<Scene> d in handler.GetInvocationList())
2980 { 3006 {
3007 m_log.InfoFormat("[EVENT MANAGER]: TriggerSceneShuttingDown invoque {0}", d.Method.Name.ToString());
2981 try 3008 try
2982 { 3009 {
2983 d(s); 3010 d(s);
@@ -2990,6 +3017,7 @@ namespace OpenSim.Region.Framework.Scenes
2990 } 3017 }
2991 } 3018 }
2992 } 3019 }
3020 m_log.Info("[EVENT MANAGER]: TriggerSceneShuttingDown done");
2993 } 3021 }
2994 3022
2995 public void TriggerOnRegionStarted(Scene scene) 3023 public void TriggerOnRegionStarted(Scene scene)
@@ -3159,5 +3187,14 @@ namespace OpenSim.Region.Framework.Scenes
3159 } 3187 }
3160 } 3188 }
3161 } 3189 }
3190
3191 public void TriggerThrottleUpdate(ScenePresence scenePresence)
3192 {
3193 ThrottleUpdate handler = OnThrottleUpdate;
3194 if (handler != null)
3195 {
3196 handler(scenePresence);
3197 }
3198 }
3162 } 3199 }
3163} 3200}