diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 6255515..9c7598a 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; |
@@ -310,8 +311,11 @@ namespace OpenSim | |||
310 | "Change the scale of a named prim", HandleEditScale); | 311 | "Change the scale of a named prim", HandleEditScale); |
311 | 312 | ||
312 | m_console.Commands.AddCommand("Users", false, "kick user", | 313 | m_console.Commands.AddCommand("Users", false, "kick user", |
313 | "kick user <first> <last> [message]", | 314 | "kick user <first> <last> [--force] [message]", |
314 | "Kick a user off the simulator", KickUserCommand); | 315 | "Kick a user off the simulator", |
316 | "The --force option will kick the user without any checks to see whether it's already in the process of closing\n" | ||
317 | + "Only use this option if you are sure the avatar is inactive and a normal kick user operation does not removed them", | ||
318 | KickUserCommand); | ||
315 | 319 | ||
316 | m_console.Commands.AddCommand("Users", false, "show users", | 320 | m_console.Commands.AddCommand("Users", false, "show users", |
317 | "show users [full]", | 321 | "show users [full]", |
@@ -416,6 +420,7 @@ namespace OpenSim | |||
416 | { | 420 | { |
417 | RunCommandScript(m_shutdownCommandsFile); | 421 | RunCommandScript(m_shutdownCommandsFile); |
418 | } | 422 | } |
423 | |||
419 | base.ShutdownSpecific(); | 424 | base.ShutdownSpecific(); |
420 | } | 425 | } |
421 | 426 | ||
@@ -453,11 +458,17 @@ namespace OpenSim | |||
453 | /// <param name="cmdparams">name of avatar to kick</param> | 458 | /// <param name="cmdparams">name of avatar to kick</param> |
454 | private void KickUserCommand(string module, string[] cmdparams) | 459 | private void KickUserCommand(string module, string[] cmdparams) |
455 | { | 460 | { |
456 | if (cmdparams.Length < 4) | 461 | bool force = false; |
462 | |||
463 | OptionSet options = new OptionSet().Add("f|force", delegate (string v) { force = v != null; }); | ||
464 | |||
465 | List<string> mainParams = options.Parse(cmdparams); | ||
466 | |||
467 | if (mainParams.Count < 4) | ||
457 | return; | 468 | return; |
458 | 469 | ||
459 | string alert = null; | 470 | string alert = null; |
460 | if (cmdparams.Length > 4) | 471 | if (mainParams.Count > 4) |
461 | alert = String.Format("\n{0}\n", String.Join(" ", cmdparams, 4, cmdparams.Length - 4)); | 472 | alert = String.Format("\n{0}\n", String.Join(" ", cmdparams, 4, cmdparams.Length - 4)); |
462 | 473 | ||
463 | IList agents = SceneManager.GetCurrentSceneAvatars(); | 474 | IList agents = SceneManager.GetCurrentSceneAvatars(); |
@@ -466,8 +477,8 @@ namespace OpenSim | |||
466 | { | 477 | { |
467 | RegionInfo regionInfo = presence.Scene.RegionInfo; | 478 | RegionInfo regionInfo = presence.Scene.RegionInfo; |
468 | 479 | ||
469 | if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) && | 480 | if (presence.Firstname.ToLower().Contains(mainParams[2].ToLower()) && |
470 | presence.Lastname.ToLower().Contains(cmdparams[3].ToLower())) | 481 | presence.Lastname.ToLower().Contains(mainParams[3].ToLower())) |
471 | { | 482 | { |
472 | MainConsole.Instance.Output( | 483 | MainConsole.Instance.Output( |
473 | String.Format( | 484 | String.Format( |
@@ -480,7 +491,7 @@ namespace OpenSim | |||
480 | else | 491 | else |
481 | presence.ControllingClient.Kick("\nYou have been logged out by an administrator.\n"); | 492 | presence.ControllingClient.Kick("\nYou have been logged out by an administrator.\n"); |
482 | 493 | ||
483 | presence.Scene.IncomingCloseAgent(presence.UUID); | 494 | presence.Scene.IncomingCloseAgent(presence.UUID, force); |
484 | } | 495 | } |
485 | } | 496 | } |
486 | 497 | ||