diff options
author | Dr Scofield | 2009-03-25 18:04:33 +0000 |
---|---|---|
committer | Dr Scofield | 2009-03-25 18:04:33 +0000 |
commit | 0419f298560671d53f4d0a9832051d9a41d8b811 (patch) | |
tree | 4b42c6ade855f47242f5fbeea787dc17468850a9 /OpenSim | |
parent | Thank you, dslake, for a patch that fixes passing the start param to scripts (diff) | |
download | opensim-SC-0419f298560671d53f4d0a9832051d9a41d8b811.zip opensim-SC-0419f298560671d53f4d0a9832051d9a41d8b811.tar.gz opensim-SC-0419f298560671d53f4d0a9832051d9a41d8b811.tar.bz2 opensim-SC-0419f298560671d53f4d0a9832051d9a41d8b811.tar.xz |
enhances the console command "kick user" with an optional alert
message which will be dialog-ed to the user just before being kicked.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 898aad2..0a79bc6 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -186,7 +186,7 @@ namespace OpenSim | |||
186 | "Change the scale of a named prim", HandleEditScale); | 186 | "Change the scale of a named prim", HandleEditScale); |
187 | 187 | ||
188 | m_console.Commands.AddCommand("region", false, "kick user", | 188 | m_console.Commands.AddCommand("region", false, "kick user", |
189 | "kick user <first> <last>", | 189 | "kick user <first> <last> [message]", |
190 | "Kick a user off the simulator", KickUserCommand); | 190 | "Kick a user off the simulator", KickUserCommand); |
191 | 191 | ||
192 | m_console.Commands.AddCommand("region", false, "show assets", | 192 | m_console.Commands.AddCommand("region", false, "show assets", |
@@ -317,6 +317,10 @@ namespace OpenSim | |||
317 | if (cmdparams.Length < 4) | 317 | if (cmdparams.Length < 4) |
318 | return; | 318 | return; |
319 | 319 | ||
320 | string alert = null; | ||
321 | if (cmdparams.Length > 4) | ||
322 | alert = String.Join(" ", cmdparams, 4, cmdparams.Length - 4); | ||
323 | |||
320 | IList agents = m_sceneManager.GetCurrentSceneAvatars(); | 324 | IList agents = m_sceneManager.GetCurrentSceneAvatars(); |
321 | 325 | ||
322 | foreach (ScenePresence presence in agents) | 326 | foreach (ScenePresence presence in agents) |
@@ -326,6 +330,13 @@ namespace OpenSim | |||
326 | if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) && | 330 | if (presence.Firstname.ToLower().Contains(cmdparams[2].ToLower()) && |
327 | presence.Lastname.ToLower().Contains(cmdparams[3].ToLower())) | 331 | presence.Lastname.ToLower().Contains(cmdparams[3].ToLower())) |
328 | { | 332 | { |
333 | if (alert != null && !presence.IsChildAgent) | ||
334 | { | ||
335 | IDialogModule dialogModule = presence.Scene.RequestModuleInterface<IDialogModule>(); | ||
336 | if (dialogModule != null) | ||
337 | dialogModule.SendAlertToUser(presence.UUID, alert, true); | ||
338 | } | ||
339 | |||
329 | m_console.Notice( | 340 | m_console.Notice( |
330 | String.Format( | 341 | String.Format( |
331 | "Kicking user: {0,-16}{1,-16}{2,-37} in region: {3,-16}", | 342 | "Kicking user: {0,-16}{1,-16}{2,-37} in region: {3,-16}", |