diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 6fd479c230..d28d65a881 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -961,6 +961,30 @@ namespace OpenSim m_console.Notice("Shared region module: " + irm.Name); } break; + case "unload": + if (cmdparams.Length > 1) + { + foreach (IRegionModule rm in new System.Collections.ArrayList(m_moduleLoader.GetLoadedSharedModules)) + { + if (rm.Name.ToLower() == cmdparams[1].ToLower()) + { + m_console.Notice("Unloading module: " + rm.Name); + m_moduleLoader.UnloadModule(rm); + } + } + } + break; + case "load": + if (cmdparams.Length > 1) + { + foreach (Scene s in new System.Collections.ArrayList(m_sceneManager.Scenes)) + { + + m_console.Notice("Loading module: " + cmdparams[1]); + m_moduleLoader.LoadRegionModules(cmdparams[1], s); + } + } + break; } } diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs index bc0bbafe0b..1200c8df39 100644 --- a/OpenSim/Region/Environment/ModuleLoader.cs +++ b/OpenSim/Region/Environment/ModuleLoader.cs @@ -294,5 +294,12 @@ namespace OpenSim.Region.Environment { LoadedAssemblys.Clear(); } + + public void UnloadModule(IRegionModule rm) + { + rm.Close(); + + m_loadedModules.Remove(rm); + } } } \ No newline at end of file diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs index 0b88050d77..490f8086c2 100644 --- a/OpenSim/Region/Environment/Scenes/SceneManager.cs +++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs @@ -45,6 +45,11 @@ namespace OpenSim.Region.Environment.Scenes private readonly List m_localScenes; private Scene m_currentScene = null; + public List Scenes + { + get { return m_localScenes; } + } + public Scene CurrentScene { get { return m_currentScene; }