From 0eef82291edd7d0c691aa3d08ad6e5a7968110f9 Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 4 Sep 2007 17:09:47 +0000 Subject: Added "show modules" command that if at root level will display a list of loaded "shared modules" (modules instances that are shared by multiple regions) or if a region is set then will display the list of local modules loaded in that region. Can now use "show users" when a region is set, to have a list of users in just that region displayed. --- OpenSim/Region/Application/OpenSimMain.cs | 7 ++++ OpenSim/Region/Environment/Scenes/Scene.cs | 53 ++++++++++++++++++++++++++++-- 2 files changed, 57 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index f84e8fc..c94d328 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -585,6 +585,13 @@ namespace OpenSim } } break; + case "modules": + m_log.Error("The currently loaded shared modules are:"); + foreach (OpenSim.Region.Environment.Interfaces.IRegionModule module in m_moduleLoader.LoadedSharedModules.Values) + { + m_log.Error("Shared Module: " + module.GetName()); + } + break; } } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 3122c5d..f8d17b4 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -92,9 +92,9 @@ namespace OpenSim.Region.Environment.Scenes // this most likely shouldn't be handled as a API method like this, but doing it for testing purposes public ModuleAPIMethod2 AddXferFile = null; - + private ISimChat m_simChatModule = null; - + #region Properties public AgentCircuitManager AuthenticateHandler @@ -1133,7 +1133,7 @@ namespace OpenSim.Region.Environment.Scenes return false; } - public void RegisterModuleInterface( M mod) + public void RegisterModuleInterface(M mod) { if (!this.ModuleInterfaces.ContainsKey(typeof(M))) { @@ -1231,6 +1231,12 @@ namespace OpenSim.Region.Environment.Scenes { switch (command) { + case "show": + if (cmdparams.Length > 0) + { + Show(cmdparams[0]); + } + break; case "save-xml": if (cmdparams.Length > 0) { @@ -1271,6 +1277,47 @@ namespace OpenSim.Region.Environment.Scenes } } + public void Show(string ShowWhat) + { + switch (ShowWhat) + { + case "users": + MainLog.Instance.Error("Current Region: " + RegionInfo.RegionName); + MainLog.Instance.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}{6,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP", "World")); + + foreach (EntityBase entity in Entities.Values) + { + if (entity is ScenePresence) + { + ScenePresence scenePrescence = entity as ScenePresence; + if (!scenePrescence.childAgent) + { + MainLog.Instance.Error( + String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}", + scenePrescence.Firstname, + scenePrescence.Lastname, + scenePrescence.UUID, + scenePrescence.ControllingClient.AgentId, + "Unknown", + "Unknown", + RegionInfo.RegionName)); + } + } + } + break; + case "modules": + MainLog.Instance.Error("The currently loaded modules in " + this.RegionInfo.RegionName + " are:"); + foreach (OpenSim.Region.Environment.Interfaces.IRegionModule module in this.Modules.Values) + { + if (!module.IsSharedModule()) + { + MainLog.Instance.Error("Region Module: " + module.GetName()); + } + } + break; + } + } + #region Script Engine private List ScriptEngines = new List(); public void AddScriptEngine(OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface ScriptEngine, LogBase m_logger) -- cgit v1.1