- Add new RegionModulesControllerPlugin to the application modules

- Change several classes to use the new plugin for handling of region-modules
  (NOTE: No regionmodule is using this yet)
- Add necessary prebuild parts (don't forget to runprebuild)
Attention: Work in progress. This shouldn't break anything, but you never know...
This commit is contained in:
Homer Horwitz
2009-04-05 17:08:11 +00:00
parent 50aa775ea7
commit 648452dd91
12 changed files with 530 additions and 20 deletions

View File

@@ -517,7 +517,7 @@ namespace OpenSim
IClientNetworkServer clientServer;
Scene scene = SetupScene(regionInfo, proxyOffset, m_config.Source, out clientServer);
m_log.Info("[MODULES]: Loading Region's modules");
m_log.Info("[MODULES]: Loading Region's modules (old style)");
List<IRegionModule> modules = m_moduleLoader.PickupModules(scene, ".");
@@ -525,6 +525,15 @@ namespace OpenSim
// script module can pick up events exposed by a module
m_moduleLoader.InitialiseSharedModules(scene);
// Use this in the future, the line above will be deprecated soon
m_log.Info("[MODULES]: Loading Region's modules (new style)");
IRegionModulesController controller;
if (ApplicationRegistry.TryGet(out controller))
{
controller.AddRegionToModules(scene);
}
else m_log.Error("[MODULES]: The new RegionModulesController is missing...");
scene.SetModuleInterfaces();
// Prims have to be loaded after module configuration since some modules may be invoked during the load
@@ -571,11 +580,22 @@ namespace OpenSim
module.PostInitialise();
}
}
scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); };
mscene = scene;
return clientServer;
}
private void ShutdownRegion(Scene scene)
{
m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName);
IRegionModulesController controller;
if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller))
{
controller.RemoveRegionFromModules(scene);
}
}
public void RemoveRegion(Scene scene, bool cleanup)
{
// only need to check this if we are not at the