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.
afrisby
MW 2007-09-04 17:09:47 +00:00
parent d7b7ff3d49
commit 0eef82291e
2 changed files with 57 additions and 3 deletions

View File

@ -585,6 +585,13 @@ namespace OpenSim
} }
} }
break; 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;
} }
} }

View File

@ -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 // this most likely shouldn't be handled as a API method like this, but doing it for testing purposes
public ModuleAPIMethod2<bool, string, byte[]> AddXferFile = null; public ModuleAPIMethod2<bool, string, byte[]> AddXferFile = null;
private ISimChat m_simChatModule = null; private ISimChat m_simChatModule = null;
#region Properties #region Properties
public AgentCircuitManager AuthenticateHandler public AgentCircuitManager AuthenticateHandler
@ -1133,7 +1133,7 @@ namespace OpenSim.Region.Environment.Scenes
return false; return false;
} }
public void RegisterModuleInterface<M>( M mod) public void RegisterModuleInterface<M>(M mod)
{ {
if (!this.ModuleInterfaces.ContainsKey(typeof(M))) if (!this.ModuleInterfaces.ContainsKey(typeof(M)))
{ {
@ -1231,6 +1231,12 @@ namespace OpenSim.Region.Environment.Scenes
{ {
switch (command) switch (command)
{ {
case "show":
if (cmdparams.Length > 0)
{
Show(cmdparams[0]);
}
break;
case "save-xml": case "save-xml":
if (cmdparams.Length > 0) 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 #region Script Engine
private List<OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface> ScriptEngines = new List<OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface>(); private List<OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface> ScriptEngines = new List<OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface>();
public void AddScriptEngine(OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface ScriptEngine, LogBase m_logger) public void AddScriptEngine(OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface ScriptEngine, LogBase m_logger)