Add event RegionHeartbeatEnd for modules interested in coordinating activity with region heartbeats
parent
c10193c72b
commit
0ce9ad4a56
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue