Replace the console for all OpenSim apps with a new console featuring command

line editing, context sensitive help (press ? at any time), command line
history, a new plugin command system and new appender features thet let you
type while the console is scrolling. Seamlessly integrates the ICommander
interfaces.
This commit is contained in:
Melanie Thielker
2009-02-07 12:25:39 +00:00
parent 4d4402158e
commit 54c6a920ba
23 changed files with 1499 additions and 1063 deletions

View File

@@ -198,6 +198,46 @@ namespace OpenSim
// Only enable logins to the regions once we have completely finished starting up (apart from scripts)
m_commsManager.GridService.RegionLoginsEnabled = true;
List<string> topics = GetHelpTopics();
foreach (string topic in topics)
{
m_console.Commands.AddCommand("plugin", "help "+topic,
"help "+topic,
"Get help on plugin command '"+topic+"'",
HandleCommanderHelp);
m_console.Commands.AddCommand("plugin", topic,
topic,
"Execute subcommand for plugin '"+topic+"'",
null);
ICommander commander =
SceneManager.CurrentOrFirstScene.GetCommanders()[topic];
if (commander == null)
continue;
foreach (string command in commander.Commands.Keys)
{
m_console.Commands.AddCommand(topic, topic+" "+command,
topic+" "+commander.Commands[command].ShortHelp(),
String.Empty, HandleCommanderCommand);
}
}
}
private void HandleCommanderCommand(string module, string[] cmd)
{
m_sceneManager.SendCommandToPluginModules(cmd);
}
private void HandleCommanderHelp(string module, string[] cmd)
{
ICommander moduleCommander = SceneManager.CurrentOrFirstScene.GetCommander(cmd[1]);
if (moduleCommander != null)
m_console.Notice(moduleCommander.Help);
}
/// <summary>