aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs24
1 files changed, 17 insertions, 7 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index 6bbab35..1fc11f5 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -35,6 +35,7 @@ using System.Text;
35using System.Text.RegularExpressions; 35using System.Text.RegularExpressions;
36using System.Timers; 36using System.Timers;
37using log4net; 37using log4net;
38using NDesk.Options;
38using Nini.Config; 39using Nini.Config;
39using OpenMetaverse; 40using OpenMetaverse;
40using OpenSim.Framework; 41using 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]",
@@ -453,11 +457,17 @@ namespace OpenSim
453 /// <param name="cmdparams">name of avatar to kick</param> 457 /// <param name="cmdparams">name of avatar to kick</param>
454 private void KickUserCommand(string module, string[] cmdparams) 458 private void KickUserCommand(string module, string[] cmdparams)
455 { 459 {
456 if (cmdparams.Length < 4) 460 bool force = false;
461
462 OptionSet options = new OptionSet().Add("f|force", delegate (string v) { force = v != null; });
463
464 List<string> mainParams = options.Parse(cmdparams);
465
466 if (mainParams.Count < 4)
457 return; 467 return;
458 468
459 string alert = null; 469 string alert = null;
460 if (cmdparams.Length > 4) 470 if (mainParams.Count > 4)
461 alert = String.Format("\n{0}\n", String.Join(" ", cmdparams, 4, cmdparams.Length - 4)); 471 alert = String.Format("\n{0}\n", String.Join(" ", cmdparams, 4, cmdparams.Length - 4));
462 472
463 IList agents = SceneManager.GetCurrentSceneAvatars(); 473 IList agents = SceneManager.GetCurrentSceneAvatars();
@@ -466,8 +476,8 @@ namespace OpenSim
466 { 476 {
467 RegionInfo regionInfo = presence.Scene.RegionInfo; 477 RegionInfo regionInfo = presence.Scene.RegionInfo;
468 478
469 if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) && 479 if (presence.Firstname.ToLower().Contains(mainParams[2].ToLower()) &&
470 presence.Lastname.ToLower().Contains(cmdparams[3].ToLower())) 480 presence.Lastname.ToLower().Contains(mainParams[3].ToLower()))
471 { 481 {
472 MainConsole.Instance.Output( 482 MainConsole.Instance.Output(
473 String.Format( 483 String.Format(
@@ -480,7 +490,7 @@ namespace OpenSim
480 else 490 else
481 presence.ControllingClient.Kick("\nThe OpenSim manager kicked you out.\n"); 491 presence.ControllingClient.Kick("\nThe OpenSim manager kicked you out.\n");
482 492
483 presence.Scene.IncomingCloseAgent(presence.UUID); 493 presence.Scene.IncomingCloseAgent(presence.UUID, force);
484 } 494 }
485 } 495 }
486 496