Add event RegionHeartbeatEnd for modules interested in coordinating activity with region heartbeats

iar_mods
Dan Lake 2012-02-01 16:27:20 -08:00
parent c10193c72b
commit 0ce9ad4a56
2 changed files with 36 additions and 10 deletions

View File

@ -407,6 +407,9 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void RegionStarted(Scene scene);
public event RegionStarted OnRegionStarted;
public delegate void RegionHeartbeatEnd(Scene scene);
public event RegionHeartbeatEnd OnRegionHeartbeatEnd;
public delegate void LoginsEnabled(string regionName);
public event LoginsEnabled OnLoginsEnabled;
@ -2291,6 +2294,27 @@ namespace OpenSim.Region.Framework.Scenes
}
}
public void TriggerRegionHeartbeatEnd(Scene scene)
{
RegionHeartbeatEnd handler = OnRegionHeartbeatEnd;
if (handler != null)
{
foreach (RegionHeartbeatEnd d in handler.GetInvocationList())
{
try
{
d(scene);
}
catch (Exception e)
{
m_log.ErrorFormat("[EVENT MANAGER]: Delegate for OnRegionHeartbeatEnd failed - continuing {0} - {1}",
e.Message, e.StackTrace);
}
}
}
}
public void TriggerLoginsEnabled (string regionName)
{
LoginsEnabled handler = OnLoginsEnabled;

View File

@ -1385,6 +1385,8 @@ namespace OpenSim.Region.Framework.Scenes
RegionInfo.RegionName, e.Message, e.StackTrace);
}
EventManager.TriggerRegionHeartbeatEnd(this);
maintc = Util.EnvironmentTickCountSubtract(maintc);
maintc = (int)(MinFrameTime * 1000) - maintc;