diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 74 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 74 |
2 files changed, 81 insertions, 67 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 5f07272..6255515 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -35,7 +35,6 @@ using System.Text; | |||
35 | using System.Text.RegularExpressions; | 35 | using System.Text.RegularExpressions; |
36 | using System.Timers; | 36 | using System.Timers; |
37 | using log4net; | 37 | using log4net; |
38 | using NDesk.Options; | ||
39 | using Nini.Config; | 38 | using Nini.Config; |
40 | using OpenMetaverse; | 39 | using OpenMetaverse; |
41 | using OpenSim.Framework; | 40 | using OpenSim.Framework; |
@@ -254,14 +253,8 @@ namespace OpenSim | |||
254 | m_console.Commands.AddCommand("Debug", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug); | 253 | m_console.Commands.AddCommand("Debug", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug); |
255 | 254 | ||
256 | m_console.Commands.AddCommand("Debug", false, "debug scene", | 255 | m_console.Commands.AddCommand("Debug", false, "debug scene", |
257 | "debug scene active|collisions|physics|scripting|teleport true|false", | 256 | "debug scene <scripting> <collisions> <physics>", |
258 | "Turn on scene debugging.", | 257 | "Turn on scene debugging", Debug); |
259 | "If active is false then main scene update and maintenance loops are suspended.\n" | ||
260 | + "If collisions is false then collisions with other objects are turned off.\n" | ||
261 | + "If physics is false then all physics objects are non-physical.\n" | ||
262 | + "If scripting is false then no scripting operations happen.\n" | ||
263 | + "If teleport is true then some extra teleport debug information is logged.", | ||
264 | Debug); | ||
265 | 258 | ||
266 | m_console.Commands.AddCommand("General", false, "change region", | 259 | m_console.Commands.AddCommand("General", false, "change region", |
267 | "change region <region name>", | 260 | "change region <region name>", |
@@ -298,7 +291,7 @@ namespace OpenSim | |||
298 | 291 | ||
299 | m_console.Commands.AddCommand("Archiving", false, "save oar", | 292 | m_console.Commands.AddCommand("Archiving", false, "save oar", |
300 | //"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]", | 293 | //"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]", |
301 | "save oar [-h|--home=<url>] [--noassets] [--publish] [--perm=<permissions>] [--all] [<OAR path>]", | 294 | "save oar [-h|--home=<url>] [--noassets] [--publish] [--perm=<permissions>] [<OAR path>]", |
302 | "Save a region's data to an OAR archive.", | 295 | "Save a region's data to an OAR archive.", |
303 | // "-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine | 296 | // "-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine |
304 | "-h|--home=<url> adds the url of the profile service to the saved user information.\n" | 297 | "-h|--home=<url> adds the url of the profile service to the saved user information.\n" |
@@ -308,7 +301,6 @@ namespace OpenSim | |||
308 | + " this is useful if you're making oars generally available that might be reloaded to the same grid from which you published\n" | 301 | + " this is useful if you're making oars generally available that might be reloaded to the same grid from which you published\n" |
309 | + "--perm=<permissions> stops objects with insufficient permissions from being saved to the OAR.\n" | 302 | + "--perm=<permissions> stops objects with insufficient permissions from being saved to the OAR.\n" |
310 | + " <permissions> can contain one or more of these characters: \"C\" = Copy, \"T\" = Transfer\n" | 303 | + " <permissions> can contain one or more of these characters: \"C\" = Copy, \"T\" = Transfer\n" |
311 | + "--all saves all the regions in the simulator, instead of just the current region.\n" | ||
312 | + "The OAR path must be a filesystem path." | 304 | + "The OAR path must be a filesystem path." |
313 | + " If this is not given then the oar is saved to region.oar in the current directory.", | 305 | + " If this is not given then the oar is saved to region.oar in the current directory.", |
314 | SaveOar); | 306 | SaveOar); |
@@ -318,11 +310,8 @@ namespace OpenSim | |||
318 | "Change the scale of a named prim", HandleEditScale); | 310 | "Change the scale of a named prim", HandleEditScale); |
319 | 311 | ||
320 | m_console.Commands.AddCommand("Users", false, "kick user", | 312 | m_console.Commands.AddCommand("Users", false, "kick user", |
321 | "kick user <first> <last> [--force] [message]", | 313 | "kick user <first> <last> [message]", |
322 | "Kick a user off the simulator", | 314 | "Kick a user off the simulator", KickUserCommand); |
323 | "The --force option will kick the user without any checks to see whether it's already in the process of closing\n" | ||
324 | + "Only use this option if you are sure the avatar is inactive and a normal kick user operation does not removed them", | ||
325 | KickUserCommand); | ||
326 | 315 | ||
327 | m_console.Commands.AddCommand("Users", false, "show users", | 316 | m_console.Commands.AddCommand("Users", false, "show users", |
328 | "show users [full]", | 317 | "show users [full]", |
@@ -339,6 +328,10 @@ namespace OpenSim | |||
339 | "show circuits", | 328 | "show circuits", |
340 | "Show agent circuit data", HandleShow); | 329 | "Show agent circuit data", HandleShow); |
341 | 330 | ||
331 | m_console.Commands.AddCommand("Comms", false, "show http-handlers", | ||
332 | "show http-handlers", | ||
333 | "Show all registered http handlers", HandleShow); | ||
334 | |||
342 | m_console.Commands.AddCommand("Comms", false, "show pending-objects", | 335 | m_console.Commands.AddCommand("Comms", false, "show pending-objects", |
343 | "show pending-objects", | 336 | "show pending-objects", |
344 | "Show # of objects on the pending queues of all scene viewers", HandleShow); | 337 | "Show # of objects on the pending queues of all scene viewers", HandleShow); |
@@ -423,7 +416,6 @@ namespace OpenSim | |||
423 | { | 416 | { |
424 | RunCommandScript(m_shutdownCommandsFile); | 417 | RunCommandScript(m_shutdownCommandsFile); |
425 | } | 418 | } |
426 | |||
427 | base.ShutdownSpecific(); | 419 | base.ShutdownSpecific(); |
428 | } | 420 | } |
429 | 421 | ||
@@ -461,17 +453,11 @@ namespace OpenSim | |||
461 | /// <param name="cmdparams">name of avatar to kick</param> | 453 | /// <param name="cmdparams">name of avatar to kick</param> |
462 | private void KickUserCommand(string module, string[] cmdparams) | 454 | private void KickUserCommand(string module, string[] cmdparams) |
463 | { | 455 | { |
464 | bool force = false; | 456 | if (cmdparams.Length < 4) |
465 | |||
466 | OptionSet options = new OptionSet().Add("f|force", delegate (string v) { force = v != null; }); | ||
467 | |||
468 | List<string> mainParams = options.Parse(cmdparams); | ||
469 | |||
470 | if (mainParams.Count < 4) | ||
471 | return; | 457 | return; |
472 | 458 | ||
473 | string alert = null; | 459 | string alert = null; |
474 | if (mainParams.Count > 4) | 460 | if (cmdparams.Length > 4) |
475 | alert = String.Format("\n{0}\n", String.Join(" ", cmdparams, 4, cmdparams.Length - 4)); | 461 | alert = String.Format("\n{0}\n", String.Join(" ", cmdparams, 4, cmdparams.Length - 4)); |
476 | 462 | ||
477 | IList agents = SceneManager.GetCurrentSceneAvatars(); | 463 | IList agents = SceneManager.GetCurrentSceneAvatars(); |
@@ -480,8 +466,8 @@ namespace OpenSim | |||
480 | { | 466 | { |
481 | RegionInfo regionInfo = presence.Scene.RegionInfo; | 467 | RegionInfo regionInfo = presence.Scene.RegionInfo; |
482 | 468 | ||
483 | if (presence.Firstname.ToLower().Contains(mainParams[2].ToLower()) && | 469 | if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) && |
484 | presence.Lastname.ToLower().Contains(mainParams[3].ToLower())) | 470 | presence.Lastname.ToLower().Contains(cmdparams[3].ToLower())) |
485 | { | 471 | { |
486 | MainConsole.Instance.Output( | 472 | MainConsole.Instance.Output( |
487 | String.Format( | 473 | String.Format( |
@@ -494,7 +480,7 @@ namespace OpenSim | |||
494 | else | 480 | else |
495 | presence.ControllingClient.Kick("\nYou have been logged out by an administrator.\n"); | 481 | presence.ControllingClient.Kick("\nYou have been logged out by an administrator.\n"); |
496 | 482 | ||
497 | presence.Scene.IncomingCloseAgent(presence.UUID, force); | 483 | presence.Scene.IncomingCloseAgent(presence.UUID); |
498 | } | 484 | } |
499 | } | 485 | } |
500 | 486 | ||
@@ -936,8 +922,7 @@ namespace OpenSim | |||
936 | } | 922 | } |
937 | else | 923 | else |
938 | { | 924 | { |
939 | MainConsole.Instance.Output( | 925 | MainConsole.Instance.Output("Usage: debug scene scripting|collisions|physics|teleport true|false"); |
940 | "Usage: debug scene active|scripting|collisions|physics|teleport true|false"); | ||
941 | } | 926 | } |
942 | 927 | ||
943 | break; | 928 | break; |
@@ -1017,6 +1002,33 @@ namespace OpenSim | |||
1017 | HandleShowCircuits(); | 1002 | HandleShowCircuits(); |
1018 | break; | 1003 | break; |
1019 | 1004 | ||
1005 | case "http-handlers": | ||
1006 | System.Text.StringBuilder handlers = new System.Text.StringBuilder("Registered HTTP Handlers:\n"); | ||
1007 | |||
1008 | handlers.AppendFormat("* XMLRPC:\n"); | ||
1009 | foreach (String s in HttpServer.GetXmlRpcHandlerKeys()) | ||
1010 | handlers.AppendFormat("\t{0}\n", s); | ||
1011 | |||
1012 | handlers.AppendFormat("* HTTP:\n"); | ||
1013 | List<String> poll = HttpServer.GetPollServiceHandlerKeys(); | ||
1014 | foreach (String s in HttpServer.GetHTTPHandlerKeys()) | ||
1015 | handlers.AppendFormat("\t{0} {1}\n", s, (poll.Contains(s) ? "(poll service)" : string.Empty)); | ||
1016 | |||
1017 | handlers.AppendFormat("* Agent:\n"); | ||
1018 | foreach (String s in HttpServer.GetAgentHandlerKeys()) | ||
1019 | handlers.AppendFormat("\t{0}\n", s); | ||
1020 | |||
1021 | handlers.AppendFormat("* LLSD:\n"); | ||
1022 | foreach (String s in HttpServer.GetLLSDHandlerKeys()) | ||
1023 | handlers.AppendFormat("\t{0}\n", s); | ||
1024 | |||
1025 | handlers.AppendFormat("* StreamHandlers ({0}):\n", HttpServer.GetStreamHandlerKeys().Count); | ||
1026 | foreach (String s in HttpServer.GetStreamHandlerKeys()) | ||
1027 | handlers.AppendFormat("\t{0}\n", s); | ||
1028 | |||
1029 | MainConsole.Instance.Output(handlers.ToString()); | ||
1030 | break; | ||
1031 | |||
1020 | case "modules": | 1032 | case "modules": |
1021 | MainConsole.Instance.Output("The currently loaded shared modules are:"); | 1033 | MainConsole.Instance.Output("The currently loaded shared modules are:"); |
1022 | foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules) | 1034 | foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules) |
@@ -1111,7 +1123,7 @@ namespace OpenSim | |||
1111 | aCircuit.Name, | 1123 | aCircuit.Name, |
1112 | aCircuit.child ? "child" : "root", | 1124 | aCircuit.child ? "child" : "root", |
1113 | aCircuit.circuitcode.ToString(), | 1125 | aCircuit.circuitcode.ToString(), |
1114 | aCircuit.IPAddress != null ? aCircuit.IPAddress.ToString() : "not set", | 1126 | aCircuit.IPAddress.ToString(), |
1115 | aCircuit.Viewer); | 1127 | aCircuit.Viewer); |
1116 | }); | 1128 | }); |
1117 | 1129 | ||
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 7232383..d107b7a 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -232,6 +232,8 @@ namespace OpenSim | |||
232 | 232 | ||
233 | base.StartupSpecific(); | 233 | base.StartupSpecific(); |
234 | 234 | ||
235 | m_stats = StatsManager.SimExtraStats; | ||
236 | |||
235 | // Create a ModuleLoader instance | 237 | // Create a ModuleLoader instance |
236 | m_moduleLoader = new ModuleLoader(m_config.Source); | 238 | m_moduleLoader = new ModuleLoader(m_config.Source); |
237 | 239 | ||
@@ -247,51 +249,51 @@ namespace OpenSim | |||
247 | plugin.PostInitialise(); | 249 | plugin.PostInitialise(); |
248 | } | 250 | } |
249 | 251 | ||
250 | if (m_console != null) | 252 | AddPluginCommands(); |
251 | { | ||
252 | StatsManager.RegisterConsoleCommands(m_console); | ||
253 | AddPluginCommands(m_console); | ||
254 | } | ||
255 | } | 253 | } |
256 | 254 | ||
257 | protected virtual void AddPluginCommands(CommandConsole console) | 255 | protected virtual void AddPluginCommands() |
258 | { | 256 | { |
259 | List<string> topics = GetHelpTopics(); | 257 | // If console exists add plugin commands. |
260 | 258 | if (m_console != null) | |
261 | foreach (string topic in topics) | ||
262 | { | 259 | { |
263 | string capitalizedTopic = char.ToUpper(topic[0]) + topic.Substring(1); | 260 | List<string> topics = GetHelpTopics(); |
264 | 261 | ||
265 | // This is a hack to allow the user to enter the help command in upper or lowercase. This will go | 262 | foreach (string topic in topics) |
266 | // away at some point. | 263 | { |
267 | console.Commands.AddCommand(capitalizedTopic, false, "help " + topic, | 264 | string capitalizedTopic = char.ToUpper(topic[0]) + topic.Substring(1); |
268 | "help " + capitalizedTopic, | ||
269 | "Get help on plugin command '" + topic + "'", | ||
270 | HandleCommanderHelp); | ||
271 | console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic, | ||
272 | "help " + capitalizedTopic, | ||
273 | "Get help on plugin command '" + topic + "'", | ||
274 | HandleCommanderHelp); | ||
275 | 265 | ||
276 | ICommander commander = null; | 266 | // This is a hack to allow the user to enter the help command in upper or lowercase. This will go |
267 | // away at some point. | ||
268 | m_console.Commands.AddCommand(capitalizedTopic, false, "help " + topic, | ||
269 | "help " + capitalizedTopic, | ||
270 | "Get help on plugin command '" + topic + "'", | ||
271 | HandleCommanderHelp); | ||
272 | m_console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic, | ||
273 | "help " + capitalizedTopic, | ||
274 | "Get help on plugin command '" + topic + "'", | ||
275 | HandleCommanderHelp); | ||
277 | 276 | ||
278 | Scene s = SceneManager.CurrentOrFirstScene; | 277 | ICommander commander = null; |
279 | 278 | ||
280 | if (s != null && s.GetCommanders() != null) | 279 | Scene s = SceneManager.CurrentOrFirstScene; |
281 | { | ||
282 | if (s.GetCommanders().ContainsKey(topic)) | ||
283 | commander = s.GetCommanders()[topic]; | ||
284 | } | ||
285 | 280 | ||
286 | if (commander == null) | 281 | if (s != null && s.GetCommanders() != null) |
287 | continue; | 282 | { |
283 | if (s.GetCommanders().ContainsKey(topic)) | ||
284 | commander = s.GetCommanders()[topic]; | ||
285 | } | ||
288 | 286 | ||
289 | foreach (string command in commander.Commands.Keys) | 287 | if (commander == null) |
290 | { | 288 | continue; |
291 | console.Commands.AddCommand(capitalizedTopic, false, | 289 | |
292 | topic + " " + command, | 290 | foreach (string command in commander.Commands.Keys) |
293 | topic + " " + commander.Commands[command].ShortHelp(), | 291 | { |
294 | String.Empty, HandleCommanderCommand); | 292 | m_console.Commands.AddCommand(capitalizedTopic, false, |
293 | topic + " " + command, | ||
294 | topic + " " + commander.Commands[command].ShortHelp(), | ||
295 | String.Empty, HandleCommanderCommand); | ||
296 | } | ||
295 | } | 297 | } |
296 | } | 298 | } |
297 | } | 299 | } |
@@ -621,7 +623,7 @@ namespace OpenSim | |||
621 | if (account == null) | 623 | if (account == null) |
622 | { | 624 | { |
623 | m_log.ErrorFormat( | 625 | m_log.ErrorFormat( |
624 | "[OPENSIM]: Unable to store account. If this simulator is connected to a grid, you must create the estate owner account first at the grid level."); | 626 | "[OPENSIM]: Unable to store account. If this simulator is connected to a grid, you must create the estate owner account first."); |
625 | } | 627 | } |
626 | else | 628 | else |
627 | { | 629 | { |