From 0756e01475f05663e23fc2e328620750d981dd40 Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Sun, 10 Feb 2008 19:03:38 +0000 Subject: [PATCH] Removed some ScriptEngine config debugging. Added experimental console command to: * unload module (note: module probably doesn't support it) * load module Not visible in help (needs testing first). --- OpenSim/Region/Application/OpenSimMain.cs | 24 +++++++++++++++++++ OpenSim/Region/Environment/ModuleLoader.cs | 7 ++++++ .../Region/Environment/Scenes/SceneManager.cs | 5 ++++ 3 files changed, 36 insertions(+) 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; }