diff options
Diffstat (limited to 'OpenSim/Region/Application/OpenSim.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 59 |
1 files changed, 20 insertions, 39 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 6255515..a9b2745 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -35,6 +35,7 @@ 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; | ||
38 | using Nini.Config; | 39 | using Nini.Config; |
39 | using OpenMetaverse; | 40 | using OpenMetaverse; |
40 | using OpenSim.Framework; | 41 | using OpenSim.Framework; |
@@ -291,7 +292,7 @@ namespace OpenSim | |||
291 | 292 | ||
292 | m_console.Commands.AddCommand("Archiving", false, "save oar", | 293 | m_console.Commands.AddCommand("Archiving", false, "save oar", |
293 | //"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]", | 294 | //"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]", |
294 | "save oar [-h|--home=<url>] [--noassets] [--publish] [--perm=<permissions>] [<OAR path>]", | 295 | "save oar [-h|--home=<url>] [--noassets] [--publish] [--perm=<permissions>] [--all] [<OAR path>]", |
295 | "Save a region's data to an OAR archive.", | 296 | "Save a region's data to an OAR archive.", |
296 | // "-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine | 297 | // "-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine |
297 | "-h|--home=<url> adds the url of the profile service to the saved user information.\n" | 298 | "-h|--home=<url> adds the url of the profile service to the saved user information.\n" |
@@ -301,6 +302,7 @@ namespace OpenSim | |||
301 | + " this is useful if you're making oars generally available that might be reloaded to the same grid from which you published\n" | 302 | + " this is useful if you're making oars generally available that might be reloaded to the same grid from which you published\n" |
302 | + "--perm=<permissions> stops objects with insufficient permissions from being saved to the OAR.\n" | 303 | + "--perm=<permissions> stops objects with insufficient permissions from being saved to the OAR.\n" |
303 | + " <permissions> can contain one or more of these characters: \"C\" = Copy, \"T\" = Transfer\n" | 304 | + " <permissions> can contain one or more of these characters: \"C\" = Copy, \"T\" = Transfer\n" |
305 | + "--all saves all the regions in the simulator, instead of just the current region.\n" | ||
304 | + "The OAR path must be a filesystem path." | 306 | + "The OAR path must be a filesystem path." |
305 | + " If this is not given then the oar is saved to region.oar in the current directory.", | 307 | + " If this is not given then the oar is saved to region.oar in the current directory.", |
306 | SaveOar); | 308 | SaveOar); |
@@ -310,8 +312,11 @@ namespace OpenSim | |||
310 | "Change the scale of a named prim", HandleEditScale); | 312 | "Change the scale of a named prim", HandleEditScale); |
311 | 313 | ||
312 | m_console.Commands.AddCommand("Users", false, "kick user", | 314 | m_console.Commands.AddCommand("Users", false, "kick user", |
313 | "kick user <first> <last> [message]", | 315 | "kick user <first> <last> [--force] [message]", |
314 | "Kick a user off the simulator", KickUserCommand); | 316 | "Kick a user off the simulator", |
317 | "The --force option will kick the user without any checks to see whether it's already in the process of closing\n" | ||
318 | + "Only use this option if you are sure the avatar is inactive and a normal kick user operation does not removed them", | ||
319 | KickUserCommand); | ||
315 | 320 | ||
316 | m_console.Commands.AddCommand("Users", false, "show users", | 321 | m_console.Commands.AddCommand("Users", false, "show users", |
317 | "show users [full]", | 322 | "show users [full]", |
@@ -328,10 +333,6 @@ namespace OpenSim | |||
328 | "show circuits", | 333 | "show circuits", |
329 | "Show agent circuit data", HandleShow); | 334 | "Show agent circuit data", HandleShow); |
330 | 335 | ||
331 | m_console.Commands.AddCommand("Comms", false, "show http-handlers", | ||
332 | "show http-handlers", | ||
333 | "Show all registered http handlers", HandleShow); | ||
334 | |||
335 | m_console.Commands.AddCommand("Comms", false, "show pending-objects", | 336 | m_console.Commands.AddCommand("Comms", false, "show pending-objects", |
336 | "show pending-objects", | 337 | "show pending-objects", |
337 | "Show # of objects on the pending queues of all scene viewers", HandleShow); | 338 | "Show # of objects on the pending queues of all scene viewers", HandleShow); |
@@ -416,6 +417,7 @@ namespace OpenSim | |||
416 | { | 417 | { |
417 | RunCommandScript(m_shutdownCommandsFile); | 418 | RunCommandScript(m_shutdownCommandsFile); |
418 | } | 419 | } |
420 | |||
419 | base.ShutdownSpecific(); | 421 | base.ShutdownSpecific(); |
420 | } | 422 | } |
421 | 423 | ||
@@ -453,11 +455,17 @@ namespace OpenSim | |||
453 | /// <param name="cmdparams">name of avatar to kick</param> | 455 | /// <param name="cmdparams">name of avatar to kick</param> |
454 | private void KickUserCommand(string module, string[] cmdparams) | 456 | private void KickUserCommand(string module, string[] cmdparams) |
455 | { | 457 | { |
456 | if (cmdparams.Length < 4) | 458 | bool force = false; |
459 | |||
460 | OptionSet options = new OptionSet().Add("f|force", delegate (string v) { force = v != null; }); | ||
461 | |||
462 | List<string> mainParams = options.Parse(cmdparams); | ||
463 | |||
464 | if (mainParams.Count < 4) | ||
457 | return; | 465 | return; |
458 | 466 | ||
459 | string alert = null; | 467 | string alert = null; |
460 | if (cmdparams.Length > 4) | 468 | if (mainParams.Count > 4) |
461 | alert = String.Format("\n{0}\n", String.Join(" ", cmdparams, 4, cmdparams.Length - 4)); | 469 | alert = String.Format("\n{0}\n", String.Join(" ", cmdparams, 4, cmdparams.Length - 4)); |
462 | 470 | ||
463 | IList agents = SceneManager.GetCurrentSceneAvatars(); | 471 | IList agents = SceneManager.GetCurrentSceneAvatars(); |
@@ -466,8 +474,8 @@ namespace OpenSim | |||
466 | { | 474 | { |
467 | RegionInfo regionInfo = presence.Scene.RegionInfo; | 475 | RegionInfo regionInfo = presence.Scene.RegionInfo; |
468 | 476 | ||
469 | if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) && | 477 | if (presence.Firstname.ToLower().Contains(mainParams[2].ToLower()) && |
470 | presence.Lastname.ToLower().Contains(cmdparams[3].ToLower())) | 478 | presence.Lastname.ToLower().Contains(mainParams[3].ToLower())) |
471 | { | 479 | { |
472 | MainConsole.Instance.Output( | 480 | MainConsole.Instance.Output( |
473 | String.Format( | 481 | String.Format( |
@@ -480,7 +488,7 @@ namespace OpenSim | |||
480 | else | 488 | else |
481 | presence.ControllingClient.Kick("\nYou have been logged out by an administrator.\n"); | 489 | presence.ControllingClient.Kick("\nYou have been logged out by an administrator.\n"); |
482 | 490 | ||
483 | presence.Scene.IncomingCloseAgent(presence.UUID); | 491 | presence.Scene.IncomingCloseAgent(presence.UUID, force); |
484 | } | 492 | } |
485 | } | 493 | } |
486 | 494 | ||
@@ -1002,33 +1010,6 @@ namespace OpenSim | |||
1002 | HandleShowCircuits(); | 1010 | HandleShowCircuits(); |
1003 | break; | 1011 | break; |
1004 | 1012 | ||
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 | |||
1032 | case "modules": | 1013 | case "modules": |
1033 | MainConsole.Instance.Output("The currently loaded shared modules are:"); | 1014 | MainConsole.Instance.Output("The currently loaded shared modules are:"); |
1034 | foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules) | 1015 | foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules) |