From f80ce30f4b866d8d856c02ce3f555c62099c3e73 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 27 Feb 2013 22:31:47 +0000 Subject: [PATCH] Get "show modules" console command to obey selected command line region/s --- OpenSim/Region/Application/OpenSim.cs | 21 +-------------- .../Region/Framework/Scenes/SceneManager.cs | 27 ++++++++----------- 2 files changed, 12 insertions(+), 36 deletions(-) diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 91e50b65b3..06487f283e 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -827,26 +827,7 @@ namespace OpenSim break; case "modules": - MainConsole.Instance.Output("The currently loaded shared modules are:"); - foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules) - { - MainConsole.Instance.Output("Shared Module: " + module.Name); - } - - SceneManager.ForEachScene( - delegate(Scene scene) { - m_log.Error("The currently loaded modules in " + scene.RegionInfo.RegionName + " are:"); - foreach (IRegionModule module in scene.Modules.Values) - { - if (!module.IsSharedModule) - { - m_log.Error("Region Module: " + module.Name); - } - } - } - ); - - SceneManager.ForEachScene( + SceneManager.ForEachSelectedScene( scene => { MainConsole.Instance.OutputFormat("Loaded region modules in {0} are:", scene.Name); diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs index b4924ef6f7..8e25740f63 100644 --- a/OpenSim/Region/Framework/Scenes/SceneManager.cs +++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs @@ -345,35 +345,30 @@ namespace OpenSim.Region.Framework.Scenes public void SendCommandToPluginModules(string[] cmdparams) { - ForEachCurrentScene(delegate(Scene scene) { scene.SendCommandToPlugins(cmdparams); }); + ForEachSelectedScene(delegate(Scene scene) { scene.SendCommandToPlugins(cmdparams); }); } public void SetBypassPermissionsOnCurrentScene(bool bypassPermissions) { - ForEachCurrentScene(delegate(Scene scene) { scene.Permissions.SetBypassPermissions(bypassPermissions); }); + ForEachSelectedScene(delegate(Scene scene) { scene.Permissions.SetBypassPermissions(bypassPermissions); }); } - private void ForEachCurrentScene(Action func) + public void ForEachSelectedScene(Action func) { if (CurrentScene == null) - { - lock (m_localScenes) - m_localScenes.ForEach(func); - } + ForEachScene(func); else - { func(CurrentScene); - } } public void RestartCurrentScene() { - ForEachCurrentScene(delegate(Scene scene) { scene.RestartNow(); }); + ForEachSelectedScene(delegate(Scene scene) { scene.RestartNow(); }); } public void BackupCurrentScene() { - ForEachCurrentScene(delegate(Scene scene) { scene.Backup(true); }); + ForEachSelectedScene(delegate(Scene scene) { scene.Backup(true); }); } public bool TrySetCurrentScene(string regionName) @@ -504,7 +499,7 @@ namespace OpenSim.Region.Framework.Scenes /// Name of avatar to debug public void SetDebugPacketLevelOnCurrentScene(int newDebug, string name) { - ForEachCurrentScene(scene => + ForEachSelectedScene(scene => scene.ForEachScenePresence(sp => { if (name == null || sp.Name == name) @@ -523,7 +518,7 @@ namespace OpenSim.Region.Framework.Scenes { List avatars = new List(); - ForEachCurrentScene( + ForEachSelectedScene( delegate(Scene scene) { scene.ForEachRootScenePresence(delegate(ScenePresence scenePresence) @@ -540,7 +535,7 @@ namespace OpenSim.Region.Framework.Scenes { List presences = new List(); - ForEachCurrentScene(delegate(Scene scene) + ForEachSelectedScene(delegate(Scene scene) { scene.ForEachScenePresence(delegate(ScenePresence sp) { @@ -569,12 +564,12 @@ namespace OpenSim.Region.Framework.Scenes public void ForceCurrentSceneClientUpdate() { - ForEachCurrentScene(delegate(Scene scene) { scene.ForceClientUpdate(); }); + ForEachSelectedScene(delegate(Scene scene) { scene.ForceClientUpdate(); }); } public void HandleEditCommandOnCurrentScene(string[] cmdparams) { - ForEachCurrentScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); }); + ForEachSelectedScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); }); } public bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar)