aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs22
1 files changed, 21 insertions, 1 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index f24cf99..fd3549e 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -517,7 +517,7 @@ namespace OpenSim
517 IClientNetworkServer clientServer; 517 IClientNetworkServer clientServer;
518 Scene scene = SetupScene(regionInfo, proxyOffset, m_config.Source, out clientServer); 518 Scene scene = SetupScene(regionInfo, proxyOffset, m_config.Source, out clientServer);
519 519
520 m_log.Info("[MODULES]: Loading Region's modules"); 520 m_log.Info("[MODULES]: Loading Region's modules (old style)");
521 521
522 List<IRegionModule> modules = m_moduleLoader.PickupModules(scene, "."); 522 List<IRegionModule> modules = m_moduleLoader.PickupModules(scene, ".");
523 523
@@ -525,6 +525,15 @@ namespace OpenSim
525 // script module can pick up events exposed by a module 525 // script module can pick up events exposed by a module
526 m_moduleLoader.InitialiseSharedModules(scene); 526 m_moduleLoader.InitialiseSharedModules(scene);
527 527
528 // Use this in the future, the line above will be deprecated soon
529 m_log.Info("[MODULES]: Loading Region's modules (new style)");
530 IRegionModulesController controller;
531 if (ApplicationRegistry.TryGet(out controller))
532 {
533 controller.AddRegionToModules(scene);
534 }
535 else m_log.Error("[MODULES]: The new RegionModulesController is missing...");
536
528 scene.SetModuleInterfaces(); 537 scene.SetModuleInterfaces();
529 538
530 // Prims have to be loaded after module configuration since some modules may be invoked during the load 539 // Prims have to be loaded after module configuration since some modules may be invoked during the load
@@ -571,11 +580,22 @@ namespace OpenSim
571 module.PostInitialise(); 580 module.PostInitialise();
572 } 581 }
573 } 582 }
583 scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); };
574 584
575 mscene = scene; 585 mscene = scene;
576 return clientServer; 586 return clientServer;
577 } 587 }
578 588
589 private void ShutdownRegion(Scene scene)
590 {
591 m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName);
592 IRegionModulesController controller;
593 if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller))
594 {
595 controller.RemoveRegionFromModules(scene);
596 }
597 }
598
579 public void RemoveRegion(Scene scene, bool cleanup) 599 public void RemoveRegion(Scene scene, bool cleanup)
580 { 600 {
581 // only need to check this if we are not at the 601 // only need to check this if we are not at the