mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
Establish EventManager.OnRegionReady event. This will only be triggerred once when the region is ready.
Switch MapImageServiceModule to use this.
This commit is contained in:
@@ -505,6 +505,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public delegate void LoginsEnabled(IScene scene);
|
||||
public event LoginsEnabled OnLoginsEnabled;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when a region is considered ready for use.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A region is considered ready when startup operations such as loading of scripts already on the region
|
||||
/// have been completed.
|
||||
/// </remarks>
|
||||
public delegate void RegionReady(IScene scene);
|
||||
public event RegionReady OnRegionReady;
|
||||
|
||||
public delegate void PrimsLoaded(Scene s);
|
||||
public event PrimsLoaded OnPrimsLoaded;
|
||||
|
||||
@@ -2476,11 +2486,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
public void TriggerLoginsEnabled(Scene scene)
|
||||
public void TriggerLoginsEnabled(IScene scene)
|
||||
{
|
||||
LoginsEnabled handler = OnLoginsEnabled;
|
||||
|
||||
if ( handler != null)
|
||||
if (handler != null)
|
||||
{
|
||||
foreach (LoginsEnabled d in handler.GetInvocationList())
|
||||
{
|
||||
@@ -2490,7 +2500,28 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[EVENT MANAGER]: Delegate for LoginsEnabled failed - continuing {0} - {1}",
|
||||
m_log.ErrorFormat("[EVENT MANAGER]: Delegate for OnLoginsEnabled failed - continuing {0} - {1}",
|
||||
e.Message, e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TriggerRegionReady(IScene scene)
|
||||
{
|
||||
RegionReady handler = OnRegionReady;
|
||||
|
||||
if (handler != null)
|
||||
{
|
||||
foreach (RegionReady d in handler.GetInvocationList())
|
||||
{
|
||||
try
|
||||
{
|
||||
d(scene);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[EVENT MANAGER]: Delegate for OnRegionReady failed - continuing {0} - {1}",
|
||||
e.Message, e.StackTrace);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1501,6 +1501,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
m_log.InfoFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName);
|
||||
LoginsDisabled = false;
|
||||
EventManager.TriggerRegionReady(this);
|
||||
}
|
||||
|
||||
m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo);
|
||||
|
||||
Reference in New Issue
Block a user