Added EventManager.OnRegionStarted which is triggered when Heartbeat is started.

iar_mods
Dan Lake 2012-01-04 12:01:18 -08:00
parent ecf9824b63
commit fc391d4b10
2 changed files with 25 additions and 0 deletions

View File

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

View File

@ -1194,6 +1194,7 @@ namespace OpenSim.Region.Framework.Scenes
try try
{ {
m_eventManager.TriggerOnRegionStarted(this);
while (!shuttingdown) while (!shuttingdown)
Update(); Update();