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 37b5776..7f06e82 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
@@ -1435,6 +1440,26 @@ namespace OpenSim.Region.Framework.Scenes
1435 } 1440 }
1436 } 1441 }
1437 } 1442 }
1443 public void TriggerTerrainUpdate()
1444 {
1445 OnTerrainUpdateDelegate handlerTerrainUpdate = OnTerrainUpdate;
1446 if (handlerTerrainUpdate != null)
1447 {
1448 foreach (OnTerrainUpdateDelegate d in handlerTerrainUpdate.GetInvocationList())
1449 {
1450 try
1451 {
1452 d();
1453 }
1454 catch (Exception e)
1455 {
1456 m_log.ErrorFormat(
1457 "[EVENT MANAGER]: Delegate for TriggerTerrainUpdate failed - continuing. {0} {1}",
1458 e.Message, e.StackTrace);
1459 }
1460 }
1461 }
1462 }
1438 1463
1439 public void TriggerTerrainTick() 1464 public void TriggerTerrainTick()
1440 { 1465 {
@@ -1767,6 +1792,7 @@ namespace OpenSim.Region.Framework.Scenes
1767 m_log.ErrorFormat( 1792 m_log.ErrorFormat(
1768 "[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing. {0} {1}", 1793 "[EVENT MANAGER]: Delegate for TriggerRemoveScript failed - continuing. {0} {1}",
1769 e.Message, e.StackTrace); 1794 e.Message, e.StackTrace);
1795 m_log.ErrorFormat(Environment.StackTrace);
1770 } 1796 }
1771 } 1797 }
1772 } 1798 }
@@ -3045,6 +3071,7 @@ namespace OpenSim.Region.Framework.Scenes
3045 { 3071 {
3046 foreach (Action<Scene> d in handler.GetInvocationList()) 3072 foreach (Action<Scene> d in handler.GetInvocationList())
3047 { 3073 {
3074 m_log.InfoFormat("[EVENT MANAGER]: TriggerSceneShuttingDown invoque {0}", d.Method.Name.ToString());
3048 try 3075 try
3049 { 3076 {
3050 d(s); 3077 d(s);
@@ -3057,6 +3084,7 @@ namespace OpenSim.Region.Framework.Scenes
3057 } 3084 }
3058 } 3085 }
3059 } 3086 }
3087 m_log.Info("[EVENT MANAGER]: TriggerSceneShuttingDown done");
3060 } 3088 }
3061 3089
3062 public void TriggerOnRegionStarted(Scene scene) 3090 public void TriggerOnRegionStarted(Scene scene)
@@ -3248,6 +3276,15 @@ namespace OpenSim.Region.Framework.Scenes
3248 } 3276 }
3249 } 3277 }
3250 3278
3279 public void TriggerThrottleUpdate(ScenePresence scenePresence)
3280 {
3281 ThrottleUpdate handler = OnThrottleUpdate;
3282 if (handler != null)
3283 {
3284 handler(scenePresence);
3285 }
3286 }
3287
3251// public void TriggerGatherUuids(SceneObjectPart sop, IDictionary<UUID, AssetType> assetUuids) 3288// public void TriggerGatherUuids(SceneObjectPart sop, IDictionary<UUID, AssetType> assetUuids)
3252// { 3289// {
3253// GatherUuids handler = OnGatherUuids; 3290// GatherUuids handler = OnGatherUuids;