diff options
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 23 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 2 |
2 files changed, 25 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 59d0148..a246319 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -969,6 +969,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
969 | public delegate void RegionStarted(Scene scene); | 969 | public delegate void RegionStarted(Scene scene); |
970 | public event RegionStarted OnRegionStarted; | 970 | public event RegionStarted OnRegionStarted; |
971 | 971 | ||
972 | public delegate void RegionHeartbeatStart(Scene scene); | ||
973 | public event RegionHeartbeatStart OnRegionHeartbeatStart; | ||
972 | public delegate void RegionHeartbeatEnd(Scene scene); | 974 | public delegate void RegionHeartbeatEnd(Scene scene); |
973 | public event RegionHeartbeatEnd OnRegionHeartbeatEnd; | 975 | public event RegionHeartbeatEnd OnRegionHeartbeatEnd; |
974 | 976 | ||
@@ -3068,6 +3070,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
3068 | } | 3070 | } |
3069 | } | 3071 | } |
3070 | 3072 | ||
3073 | public void TriggerRegionHeartbeatStart(Scene scene) | ||
3074 | { | ||
3075 | RegionHeartbeatStart handler = OnRegionHeartbeatStart; | ||
3076 | |||
3077 | if (handler != null) | ||
3078 | { | ||
3079 | foreach (RegionHeartbeatStart d in handler.GetInvocationList()) | ||
3080 | { | ||
3081 | try | ||
3082 | { | ||
3083 | d(scene); | ||
3084 | } | ||
3085 | catch (Exception e) | ||
3086 | { | ||
3087 | m_log.ErrorFormat("[EVENT MANAGER]: Delegate for OnRegionHeartbeatStart failed - continuing {0} - {1}", | ||
3088 | e.Message, e.StackTrace); | ||
3089 | } | ||
3090 | } | ||
3091 | } | ||
3092 | } | ||
3093 | |||
3071 | public void TriggerRegionHeartbeatEnd(Scene scene) | 3094 | public void TriggerRegionHeartbeatEnd(Scene scene) |
3072 | { | 3095 | { |
3073 | RegionHeartbeatEnd handler = OnRegionHeartbeatEnd; | 3096 | RegionHeartbeatEnd handler = OnRegionHeartbeatEnd; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5dea634..0743ce7 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1517,6 +1517,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1517 | 1517 | ||
1518 | try | 1518 | try |
1519 | { | 1519 | { |
1520 | EventManager.TriggerRegionHeartbeatStart(this); | ||
1521 | |||
1520 | // Apply taints in terrain module to terrain in physics scene | 1522 | // Apply taints in terrain module to terrain in physics scene |
1521 | if (Frame % m_update_terrain == 0) | 1523 | if (Frame % m_update_terrain == 0) |
1522 | { | 1524 | { |