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 59d0148..4733547 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
@@ -1423,6 +1428,26 @@ namespace OpenSim.Region.Framework.Scenes
1423 } 1428 }
1424 } 1429 }
1425 } 1430 }
1431 public void TriggerTerrainUpdate()
1432 {
1433 OnTerrainUpdateDelegate handlerTerrainUpdate = OnTerrainUpdate;
1434 if (handlerTerrainUpdate != null)
1435 {
1436 foreach (OnTerrainUpdateDelegate d in handlerTerrainUpdate.GetInvocationList())
1437 {
1438 try
1439 {
1440 d();
1441 }
1442 catch (Exception e)
1443 {
1444 m_log.ErrorFormat(
1445 "[EVENT MANAGER]: Delegate for TriggerTerrainUpdate failed - continuing. {0} {1}",
1446 e.Message, e.StackTrace);
1447 }
1448 }
1449 }
1450 }
1426 1451
1427 public void TriggerTerrainTick() 1452 public void TriggerTerrainTick()
1428 { 1453 {
@@ -1755,6 +1780,7 @@ namespace OpenSim.Region.Framework.Scenes
1755 m_log.ErrorFormat( 1780 m_log.ErrorFormat(
1756 "[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing. {0} {1}", 1781 "[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing. {0} {1}",
1757 e.Message, e.StackTrace); 1782 e.Message, e.StackTrace);
1783 m_log.ErrorFormat(Environment.StackTrace);
1758 } 1784 }
1759 } 1785 }
1760 } 1786 }
@@ -3033,6 +3059,7 @@ namespace OpenSim.Region.Framework.Scenes
3033 { 3059 {
3034 foreach (Action<Scene> d in handler.GetInvocationList()) 3060 foreach (Action<Scene> d in handler.GetInvocationList())
3035 { 3061 {
3062 m_log.InfoFormat("[EVENT MANAGER]: TriggerSceneShuttingDown invoque {0}", d.Method.Name.ToString());
3036 try 3063 try
3037 { 3064 {
3038 d(s); 3065 d(s);
@@ -3045,6 +3072,7 @@ namespace OpenSim.Region.Framework.Scenes
3045 } 3072 }
3046 } 3073 }
3047 } 3074 }
3075 m_log.Info("[EVENT MANAGER]: TriggerSceneShuttingDown done");
3048 } 3076 }
3049 3077
3050 public void TriggerOnRegionStarted(Scene scene) 3078 public void TriggerOnRegionStarted(Scene scene)
@@ -3214,5 +3242,14 @@ namespace OpenSim.Region.Framework.Scenes
3214 } 3242 }
3215 } 3243 }
3216 } 3244 }
3245
3246 public void TriggerThrottleUpdate(ScenePresence scenePresence)
3247 {
3248 ThrottleUpdate handler = OnThrottleUpdate;
3249 if (handler != null)
3250 {
3251 handler(scenePresence);
3252 }
3253 }
3217 } 3254 }
3218} 3255}