diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
index 4d820203a1..473991a9e8 100644
--- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs
+++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs
@@ -104,6 +104,16 @@ namespace OpenSim.Framework.Servers
/// Should be overriden and referenced by descendents if they need to perform extra shutdown processing
///
public virtual void ShutdownSpecific() {}
+
+ ///
+ /// Provides a list of help topics that are available. Overriding classes should append their topics to the
+ /// information returned when the base method is called.
+ ///
+ ///
+ ///
+ /// A list of strings that represent different help topics on which more information is available
+ ///
+ protected virtual List GetHelpTopics() { return new List(); }
///
/// Print statistics to the logfile, if they are active
@@ -310,11 +320,20 @@ namespace OpenSim.Framework.Servers
///
protected virtual void ShowHelp(string[] helpArgs)
{
+ Notice("");
+
if (helpArgs.Length == 0)
{
- Notice("");
- // TODO: not yet implemented
- //Notice("help [command] - display general help or specific command help. Try help help for more info.");
+ List helpTopics = GetHelpTopics();
+
+ if (helpTopics.Count > 0)
+ {
+ Notice(
+ "As well as the help information below, you can also type help to get more information on the following areas:");
+ Notice(string.Format(" {0}", string.Join(", ", helpTopics.ToArray())));
+ Notice("");
+ }
+
Notice("quit - equivalent to shutdown.");
Notice("set log level [level] - change the console logging level only. For example, off or debug.");
@@ -326,7 +345,8 @@ namespace OpenSim.Framework.Servers
Notice("show threads - list tracked threads");
Notice("show uptime - show server startup time and uptime.");
Notice("show version - show server version.");
- Notice("shutdown - shutdown the server.\n");
+ Notice("shutdown - shutdown the server.");
+ Notice("");
return;
}
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index ac6a5c176f..33621a9cad 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -496,6 +496,7 @@ namespace OpenSim
case "reset":
Reset(cmdparams);
break;
+
case "predecode-j2k":
if (cmdparams.Length > 0)
{
@@ -661,53 +662,62 @@ namespace OpenSim
{
base.ShowHelp(helpArgs);
- m_console.Notice("alert - send alert to a designated user or all users.");
- m_console.Notice(" alert [First] [Last] [Message] - send an alert to a user. Case sensitive.");
- m_console.Notice(" alert general [Message] - send an alert to all users.");
- m_console.Notice("backup - persist simulator objects to the database ahead of the normal schedule.");
- m_console.Notice("clear-assets - clear the asset cache");
- m_console.Notice("create-region - create a new region");
- m_console.Notice("change-region - select the region that single region commands operate upon.");
- m_console.Notice("command-script [filename] - Execute command in a file.");
- m_console.Notice("debug - debugging commands");
- m_console.Notice(" debug packet 0..255 - print incoming/outgoing packets (0=off)");
- m_console.Notice(" debug scene [scripting] [collision] [physics] - Enable/Disable debug stuff, each can be True/False");
- m_console.Notice("edit-scale [prim name] [x] [y] [z] - resize given prim");
- m_console.Notice("export-map [filename] - save image of world map");
- m_console.Notice("force-update - force an update of prims in the scene");
- m_console.Notice("restart - disconnects all clients and restarts the sims in the instance.");
- m_console.Notice("remove-region [name] - remove a region");
- m_console.Notice("delete-region [name] - delete a region and its associated region file");
- m_console.Notice("load-xml [filename] - load prims from XML (DEPRECATED)");
- m_console.Notice("save-xml [filename] - save prims to XML (DEPRECATED)");
- m_console.Notice("save-xml2 [filename] - save prims to XML using version 2 format");
- m_console.Notice("load-xml2 [filename] - load prims from XML using version 2 format");
- m_console.Notice("load-oar [filename] - load an OpenSimulator region archive. This replaces everything in the current region.");
- m_console.Notice("save-oar [filename] - Save the current region to an OpenSimulator region archive.");
- m_console.Notice("script - manually trigger scripts? or script commands?");
- m_console.Notice("show assets - show state of asset cache.");
- m_console.Notice("show modules - shows info about loaded modules.");
- m_console.Notice("show queues - show packet queues length for all clients.");
- m_console.Notice("show regions - show running region information.");
- m_console.Notice("show users - show info about connected users (only root agents).");
- m_console.Notice("show users full - show info about connected users (root and child agents).");
- m_console.Notice("config set section field value - set a config value");
- m_console.Notice("config get section field - get a config value");
- m_console.Notice("config save - save OpenSim.ini");
- m_console.Notice("terrain help - show help for terrain commands.");
- m_console.Notice("login-enable - Allows login at sim level");
- m_console.Notice("login-disable - Disable login at sim level");
- m_console.Notice("login-status - Show the actual login status");
- m_console.Notice("predecode-j2k - Precache assets,decode j2k layerdata, First parameter is threads to use");
+ if (helpArgs.Length == 0)
+ {
+ m_console.Notice("alert - send alert to a designated user or all users.");
+ m_console.Notice(" alert [First] [Last] [Message] - send an alert to a user. Case sensitive.");
+ m_console.Notice(" alert general [Message] - send an alert to all users.");
+ m_console.Notice("backup - persist simulator objects to the database ahead of the normal schedule.");
+ m_console.Notice("clear-assets - clear the asset cache");
+ m_console.Notice("create-region - create a new region");
+ m_console.Notice("change-region - select the region that single region commands operate upon.");
+ m_console.Notice("command-script [filename] - Execute command in a file.");
+ m_console.Notice("debug - debugging commands");
+ m_console.Notice(" debug packet 0..255 - print incoming/outgoing packets (0=off)");
+ m_console.Notice(" debug scene [scripting] [collision] [physics] - Enable/Disable debug stuff, each can be True/False");
+ m_console.Notice("edit-scale [prim name] [x] [y] [z] - resize given prim");
+ m_console.Notice("export-map [filename] - save image of world map");
+ m_console.Notice("force-update - force an update of prims in the scene");
+ m_console.Notice("restart - disconnects all clients and restarts the sims in the instance.");
+ m_console.Notice("remove-region [name] - remove a region");
+ m_console.Notice("delete-region [name] - delete a region and its associated region file");
+ m_console.Notice("load-xml [filename] - load prims from XML (DEPRECATED)");
+ m_console.Notice("save-xml [filename] - save prims to XML (DEPRECATED)");
+ m_console.Notice("save-xml2 [filename] - save prims to XML using version 2 format");
+ m_console.Notice("load-xml2 [filename] - load prims from XML using version 2 format");
+ m_console.Notice("load-oar [filename] - load an OpenSimulator region archive. This replaces everything in the current region.");
+ m_console.Notice("save-oar [filename] - Save the current region to an OpenSimulator region archive.");
+ m_console.Notice("script - manually trigger scripts? or script commands?");
+ m_console.Notice("show assets - show state of asset cache.");
+ m_console.Notice("show modules - shows info about loaded modules.");
+ m_console.Notice("show queues - show packet queues length for all clients.");
+ m_console.Notice("show regions - show running region information.");
+ m_console.Notice("show users - show info about connected users (only root agents).");
+ m_console.Notice("show users full - show info about connected users (root and child agents).");
+ m_console.Notice("config set section field value - set a config value");
+ m_console.Notice("config get section field - get a config value");
+ m_console.Notice("config save - save OpenSim.ini");
+ m_console.Notice("login-enable - Allows login at sim level");
+ m_console.Notice("login-disable - Disable login at sim level");
+ m_console.Notice("login-status - Show the actual login status");
+ m_console.Notice("predecode-j2k - Precache assets,decode j2k layerdata, First parameter is threads to use");
+ ShowPluginCommandsHelp(CombineParams(helpArgs, 0), m_console);
- ShowPluginCommandsHelp(CombineParams(helpArgs, 0), m_console);
-
- if (ConfigurationSettings.Standalone)
- {
- m_console.Notice("");
- m_console.Notice("create user - adds a new user.");
- m_console.Notice("reset user password - reset a user's password.");
+ if (ConfigurationSettings.Standalone)
+ {
+ m_console.Notice("");
+ m_console.Notice("create user - adds a new user.");
+ m_console.Notice("reset user password - reset a user's password.");
+ }
}
+ else
+ {
+ ICommander moduleCommander = SceneManager.CurrentOrFirstScene.GetCommander(helpArgs[0]);
+ if (moduleCommander != null)
+ {
+ m_console.Notice(moduleCommander.Help);
+ }
+ }
}
// see BaseOpenSimServer
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index aca182965b..89f16d6fac 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -59,7 +59,7 @@ namespace OpenSim
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected string proxyUrl;
- protected int proxyOffset = 0;
+ protected int proxyOffset = 0;
///
/// The file used to load and save prim backup xml if no filename has been specified
@@ -158,7 +158,15 @@ namespace OpenSim
loader.Load("/OpenSim/Startup");
m_plugins = loader.Plugins;
}
-
+
+ protected override List GetHelpTopics()
+ {
+ List topics = base.GetHelpTopics();
+ topics.AddRange(SceneManager.CurrentOrFirstScene.GetCommanders().Keys);
+
+ return topics;
+ }
+
///
/// Performs startup specific to this region server, including initialization of the scene
/// such as loading configuration from disk.
diff --git a/OpenSim/Region/Environment/Interfaces/ICommander.cs b/OpenSim/Region/Environment/Interfaces/ICommander.cs
index a267115beb..a61ce490a6 100644
--- a/OpenSim/Region/Environment/Interfaces/ICommander.cs
+++ b/OpenSim/Region/Environment/Interfaces/ICommander.cs
@@ -29,10 +29,15 @@ namespace OpenSim.Region.Environment.Interfaces
{
public interface ICommander
{
- ///
+ ///
/// The name of this commander
- ///
+ ///
string Name { get; }
+
+ ///
+ /// Provide general help information about this commander.
+ ///
+ string Help { get; }
void ProcessConsoleCommand(string function, string[] args);
void RegisterCommand(string commandName, ICommand command);
diff --git a/OpenSim/Region/Environment/Modules/Framework/InterfaceCommander/Commander.cs b/OpenSim/Region/Environment/Modules/Framework/InterfaceCommander/Commander.cs
index caaa808977..d5f4c80a16 100644
--- a/OpenSim/Region/Environment/Modules/Framework/InterfaceCommander/Commander.cs
+++ b/OpenSim/Region/Environment/Modules/Framework/InterfaceCommander/Commander.cs
@@ -52,6 +52,23 @@ namespace OpenSim.Region.Environment.Modules.Framework.InterfaceCommander
get { return m_name; }
}
private string m_name;
+
+ public string Help
+ {
+ get
+ {
+ StringBuilder sb = new StringBuilder();
+
+ sb.AppendLine("===" + m_name + "===");
+
+ foreach (ICommand com in m_commands.Values)
+ {
+ sb.AppendLine("* " + com.Name + " - " + com.Help);
+ }
+
+ return sb.ToString();
+ }
+ }
///
/// Constructor
@@ -60,7 +77,10 @@ namespace OpenSim.Region.Environment.Modules.Framework.InterfaceCommander
public Commander(string name)
{
m_name = name;
- m_generatedApiClassName = m_name;
+ m_generatedApiClassName = m_name[0].ToString().ToUpper();
+
+ if (m_name.Length > 1)
+ m_generatedApiClassName += m_name.Substring(1);
}
///
@@ -145,22 +165,14 @@ namespace OpenSim.Region.Environment.Modules.Framework.InterfaceCommander
{
if (function != "help")
Console.WriteLine("ERROR: Invalid command - No such command exists");
- ShowConsoleHelp();
+
+ Console.Write(Help);
}
}
}
#endregion
- private void ShowConsoleHelp()
- {
- Console.WriteLine("===" + m_name + "===");
- foreach (ICommand com in m_commands.Values)
- {
- Console.WriteLine("* " + com.Name + " - " + com.Help);
- }
- }
-
private string EscapeRuntimeAPICommand(string command)
{
command = command.Replace('-', '_');
diff --git a/OpenSim/Region/Environment/Modules/Framework/InterfaceCommander/CommanderTestModule.cs b/OpenSim/Region/Environment/Modules/Framework/InterfaceCommander/CommanderTestModule.cs
index f4b56b7027..e368f515a5 100644
--- a/OpenSim/Region/Environment/Modules/Framework/InterfaceCommander/CommanderTestModule.cs
+++ b/OpenSim/Region/Environment/Modules/Framework/InterfaceCommander/CommanderTestModule.cs
@@ -35,7 +35,7 @@ namespace OpenSim.Region.Environment.Modules.Framework.InterfaceCommander
{
public class CommanderTestModule : IRegionModule, ICommandableModule
{
- private readonly Commander m_commander = new Commander("CommanderTest");
+ private readonly Commander m_commander = new Commander("commandertest");
private Scene m_scene;
#region ICommandableModule Members
diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
index 0fac278662..f086396606 100644
--- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Scene m_scene;
- private readonly Commander m_commander = new Commander("Permissions");
+ private readonly Commander m_commander = new Commander("permissions");
#region Constants
// These are here for testing. They will be taken out
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
index 885dbaeddf..f939adfe95 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SerialiserModule.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Region.Environment.Modules.World.Serialiser
{
public class SerialiserModule : IRegionModule, IRegionSerialiserModule
{
- private Commander m_commander = new Commander("Export");
+ private Commander m_commander = new Commander("export");
private List m_regions = new List();
private string m_savedir = "exports" + "/";
private List m_serialisers = new List();
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
index cc9b4d2ca4..3c27872e40 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/TerrainModule.cs
@@ -68,7 +68,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
- private readonly Commander m_commander = new Commander("Terrain");
+ private readonly Commander m_commander = new Commander("terrain");
private readonly Dictionary m_floodeffects =
new Dictionary();
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs
index 5e7eae5038..5b786177b7 100644
--- a/OpenSim/Region/Environment/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs
@@ -286,12 +286,20 @@ namespace OpenSim.Region.Environment.Scenes
}
}
+ ///
+ /// Get a module commander
+ ///
+ ///
+ /// The module commander, null if no module commander with that name was found
public ICommander GetCommander(string name)
{
lock (m_moduleCommanders)
{
- return m_moduleCommanders[name];
+ if (m_moduleCommanders.ContainsKey(name))
+ return m_moduleCommanders[name];
}
+
+ return null;
}
public Dictionary GetCommanders()