diff options
author | Melanie Thielker | 2009-02-07 12:25:39 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-02-07 12:25:39 +0000 |
commit | 54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a (patch) | |
tree | f606cbdbc383ec21fee28f0a1454140a1c714278 /OpenSim/Region/Application/OpenSimBase.cs | |
parent | Thank you dslake for a patch that: (diff) | |
download | opensim-SC-54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a.zip opensim-SC-54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a.tar.gz opensim-SC-54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a.tar.bz2 opensim-SC-54c6a920baa0ef02a9ea09e08cc1effcef3b0a3a.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index a7ff0e2..4d56147 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -198,6 +198,46 @@ namespace OpenSim | |||
198 | 198 | ||
199 | // Only enable logins to the regions once we have completely finished starting up (apart from scripts) | 199 | // Only enable logins to the regions once we have completely finished starting up (apart from scripts) |
200 | m_commsManager.GridService.RegionLoginsEnabled = true; | 200 | m_commsManager.GridService.RegionLoginsEnabled = true; |
201 | |||
202 | List<string> topics = GetHelpTopics(); | ||
203 | |||
204 | foreach (string topic in topics) | ||
205 | { | ||
206 | m_console.Commands.AddCommand("plugin", "help "+topic, | ||
207 | "help "+topic, | ||
208 | "Get help on plugin command '"+topic+"'", | ||
209 | HandleCommanderHelp); | ||
210 | |||
211 | m_console.Commands.AddCommand("plugin", topic, | ||
212 | topic, | ||
213 | "Execute subcommand for plugin '"+topic+"'", | ||
214 | null); | ||
215 | |||
216 | ICommander commander = | ||
217 | SceneManager.CurrentOrFirstScene.GetCommanders()[topic]; | ||
218 | |||
219 | if (commander == null) | ||
220 | continue; | ||
221 | |||
222 | foreach (string command in commander.Commands.Keys) | ||
223 | { | ||
224 | m_console.Commands.AddCommand(topic, topic+" "+command, | ||
225 | topic+" "+commander.Commands[command].ShortHelp(), | ||
226 | String.Empty, HandleCommanderCommand); | ||
227 | } | ||
228 | } | ||
229 | } | ||
230 | |||
231 | private void HandleCommanderCommand(string module, string[] cmd) | ||
232 | { | ||
233 | m_sceneManager.SendCommandToPluginModules(cmd); | ||
234 | } | ||
235 | |||
236 | private void HandleCommanderHelp(string module, string[] cmd) | ||
237 | { | ||
238 | ICommander moduleCommander = SceneManager.CurrentOrFirstScene.GetCommander(cmd[1]); | ||
239 | if (moduleCommander != null) | ||
240 | m_console.Notice(moduleCommander.Help); | ||
201 | } | 241 | } |
202 | 242 | ||
203 | /// <summary> | 243 | /// <summary> |