diff options
author | Justin Clark-Casey (justincc) | 2012-07-18 21:52:07 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-18 21:52:07 +0100 |
commit | 4973fddc51a4a9e3952bd2decd0ea1842b742141 (patch) | |
tree | 8e525f6fbc4ea5ccfd9e8acbf36959c6f6249268 /OpenSim/Region/Framework/Scenes | |
parent | Pass entire scene object in OnLoginsEnabled event rather than just the region... (diff) | |
download | opensim-SC_OLD-4973fddc51a4a9e3952bd2decd0ea1842b742141.zip opensim-SC_OLD-4973fddc51a4a9e3952bd2decd0ea1842b742141.tar.gz opensim-SC_OLD-4973fddc51a4a9e3952bd2decd0ea1842b742141.tar.bz2 opensim-SC_OLD-4973fddc51a4a9e3952bd2decd0ea1842b742141.tar.xz |
Establish EventManager.OnRegionReady event. This will only be triggerred once when the region is ready.
Switch MapImageServiceModule to use this.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/EventManager.cs | 37 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 1 |
2 files changed, 35 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index e2380b7..714d70d 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -505,6 +505,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
505 | public delegate void LoginsEnabled(IScene scene); | 505 | public delegate void LoginsEnabled(IScene scene); |
506 | public event LoginsEnabled OnLoginsEnabled; | 506 | public event LoginsEnabled OnLoginsEnabled; |
507 | 507 | ||
508 | /// <summary> | ||
509 | /// Fired when a region is considered ready for use. | ||
510 | /// </summary> | ||
511 | /// <remarks> | ||
512 | /// A region is considered ready when startup operations such as loading of scripts already on the region | ||
513 | /// have been completed. | ||
514 | /// </remarks> | ||
515 | public delegate void RegionReady(IScene scene); | ||
516 | public event RegionReady OnRegionReady; | ||
517 | |||
508 | public delegate void PrimsLoaded(Scene s); | 518 | public delegate void PrimsLoaded(Scene s); |
509 | public event PrimsLoaded OnPrimsLoaded; | 519 | public event PrimsLoaded OnPrimsLoaded; |
510 | 520 | ||
@@ -2476,11 +2486,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2476 | } | 2486 | } |
2477 | } | 2487 | } |
2478 | 2488 | ||
2479 | public void TriggerLoginsEnabled(Scene scene) | 2489 | public void TriggerLoginsEnabled(IScene scene) |
2480 | { | 2490 | { |
2481 | LoginsEnabled handler = OnLoginsEnabled; | 2491 | LoginsEnabled handler = OnLoginsEnabled; |
2482 | 2492 | ||
2483 | if ( handler != null) | 2493 | if (handler != null) |
2484 | { | 2494 | { |
2485 | foreach (LoginsEnabled d in handler.GetInvocationList()) | 2495 | foreach (LoginsEnabled d in handler.GetInvocationList()) |
2486 | { | 2496 | { |
@@ -2490,7 +2500,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
2490 | } | 2500 | } |
2491 | catch (Exception e) | 2501 | catch (Exception e) |
2492 | { | 2502 | { |
2493 | m_log.ErrorFormat("[EVENT MANAGER]: Delegate for LoginsEnabled failed - continuing {0} - {1}", | 2503 | m_log.ErrorFormat("[EVENT MANAGER]: Delegate for OnLoginsEnabled failed - continuing {0} - {1}", |
2504 | e.Message, e.StackTrace); | ||
2505 | } | ||
2506 | } | ||
2507 | } | ||
2508 | } | ||
2509 | |||
2510 | public void TriggerRegionReady(IScene scene) | ||
2511 | { | ||
2512 | RegionReady handler = OnRegionReady; | ||
2513 | |||
2514 | if (handler != null) | ||
2515 | { | ||
2516 | foreach (RegionReady d in handler.GetInvocationList()) | ||
2517 | { | ||
2518 | try | ||
2519 | { | ||
2520 | d(scene); | ||
2521 | } | ||
2522 | catch (Exception e) | ||
2523 | { | ||
2524 | m_log.ErrorFormat("[EVENT MANAGER]: Delegate for OnRegionReady failed - continuing {0} - {1}", | ||
2494 | e.Message, e.StackTrace); | 2525 | e.Message, e.StackTrace); |
2495 | } | 2526 | } |
2496 | } | 2527 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 8a28ee4..12cc0d3 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1501,6 +1501,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1501 | { | 1501 | { |
1502 | m_log.InfoFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName); | 1502 | m_log.InfoFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName); |
1503 | LoginsDisabled = false; | 1503 | LoginsDisabled = false; |
1504 | EventManager.TriggerRegionReady(this); | ||
1504 | } | 1505 | } |
1505 | 1506 | ||
1506 | m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo); | 1507 | m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo); |