aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSimBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs72
1 files changed, 35 insertions, 37 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index f784398..4f1b439 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -223,8 +223,6 @@ namespace OpenSim
223 223
224 base.StartupSpecific(); 224 base.StartupSpecific();
225 225
226 m_stats = StatsManager.SimExtraStats;
227
228 // Create a ModuleLoader instance 226 // Create a ModuleLoader instance
229 m_moduleLoader = new ModuleLoader(m_config.Source); 227 m_moduleLoader = new ModuleLoader(m_config.Source);
230 228
@@ -234,51 +232,51 @@ namespace OpenSim
234 plugin.PostInitialise(); 232 plugin.PostInitialise();
235 } 233 }
236 234
237 AddPluginCommands(); 235 if (m_console != null)
236 {
237 StatsManager.RegisterConsoleCommands(m_console);
238 AddPluginCommands(m_console);
239 }
238 } 240 }
239 241
240 protected virtual void AddPluginCommands() 242 protected virtual void AddPluginCommands(CommandConsole console)
241 { 243 {
242 // If console exists add plugin commands. 244 List<string> topics = GetHelpTopics();
243 if (m_console != null)
244 {
245 List<string> topics = GetHelpTopics();
246 245
247 foreach (string topic in topics) 246 foreach (string topic in topics)
248 { 247 {
249 string capitalizedTopic = char.ToUpper(topic[0]) + topic.Substring(1); 248 string capitalizedTopic = char.ToUpper(topic[0]) + topic.Substring(1);
250 249
251 // This is a hack to allow the user to enter the help command in upper or lowercase. This will go 250 // This is a hack to allow the user to enter the help command in upper or lowercase. This will go
252 // away at some point. 251 // away at some point.
253 m_console.Commands.AddCommand(capitalizedTopic, false, "help " + topic, 252 console.Commands.AddCommand(capitalizedTopic, false, "help " + topic,
254 "help " + capitalizedTopic, 253 "help " + capitalizedTopic,
255 "Get help on plugin command '" + topic + "'", 254 "Get help on plugin command '" + topic + "'",
256 HandleCommanderHelp); 255 HandleCommanderHelp);
257 m_console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic, 256 console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic,
258 "help " + capitalizedTopic, 257 "help " + capitalizedTopic,
259 "Get help on plugin command '" + topic + "'", 258 "Get help on plugin command '" + topic + "'",
260 HandleCommanderHelp); 259 HandleCommanderHelp);
261 260
262 ICommander commander = null; 261 ICommander commander = null;
263 262
264 Scene s = SceneManager.CurrentOrFirstScene; 263 Scene s = SceneManager.CurrentOrFirstScene;
265 264
266 if (s != null && s.GetCommanders() != null) 265 if (s != null && s.GetCommanders() != null)
267 { 266 {
268 if (s.GetCommanders().ContainsKey(topic)) 267 if (s.GetCommanders().ContainsKey(topic))
269 commander = s.GetCommanders()[topic]; 268 commander = s.GetCommanders()[topic];
270 } 269 }
271 270
272 if (commander == null) 271 if (commander == null)
273 continue; 272 continue;
274 273
275 foreach (string command in commander.Commands.Keys) 274 foreach (string command in commander.Commands.Keys)
276 { 275 {
277 m_console.Commands.AddCommand(capitalizedTopic, false, 276 console.Commands.AddCommand(capitalizedTopic, false,
278 topic + " " + command, 277 topic + " " + command,
279 topic + " " + commander.Commands[command].ShortHelp(), 278 topic + " " + commander.Commands[command].ShortHelp(),
280 String.Empty, HandleCommanderCommand); 279 String.Empty, HandleCommanderCommand);
281 }
282 } 280 }
283 } 281 }
284 } 282 }