Add region heartbeat start event to complement heartbeat end event.
This allows object modification before the usual heartbeat operation.cpu-performance
parent
3aa2fb9928
commit
439f11cc3c
|
@ -969,6 +969,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public delegate void RegionStarted(Scene scene);
|
public delegate void RegionStarted(Scene scene);
|
||||||
public event RegionStarted OnRegionStarted;
|
public event RegionStarted OnRegionStarted;
|
||||||
|
|
||||||
|
public delegate void RegionHeartbeatStart(Scene scene);
|
||||||
|
public event RegionHeartbeatStart OnRegionHeartbeatStart;
|
||||||
public delegate void RegionHeartbeatEnd(Scene scene);
|
public delegate void RegionHeartbeatEnd(Scene scene);
|
||||||
public event RegionHeartbeatEnd OnRegionHeartbeatEnd;
|
public event RegionHeartbeatEnd OnRegionHeartbeatEnd;
|
||||||
|
|
||||||
|
@ -3068,6 +3070,27 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void TriggerRegionHeartbeatStart(Scene scene)
|
||||||
|
{
|
||||||
|
RegionHeartbeatStart handler = OnRegionHeartbeatStart;
|
||||||
|
|
||||||
|
if (handler != null)
|
||||||
|
{
|
||||||
|
foreach (RegionHeartbeatStart d in handler.GetInvocationList())
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
d(scene);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat("[EVENT MANAGER]: Delegate for OnRegionHeartbeatStart failed - continuing {0} - {1}",
|
||||||
|
e.Message, e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void TriggerRegionHeartbeatEnd(Scene scene)
|
public void TriggerRegionHeartbeatEnd(Scene scene)
|
||||||
{
|
{
|
||||||
RegionHeartbeatEnd handler = OnRegionHeartbeatEnd;
|
RegionHeartbeatEnd handler = OnRegionHeartbeatEnd;
|
||||||
|
|
|
@ -1517,6 +1517,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
EventManager.TriggerRegionHeartbeatStart(this);
|
||||||
|
|
||||||
// Apply taints in terrain module to terrain in physics scene
|
// Apply taints in terrain module to terrain in physics scene
|
||||||
if (Frame % m_update_terrain == 0)
|
if (Frame % m_update_terrain == 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue