-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a "Kick Player (by ckey)" verb for admins to use (#2124)
* Add a "Kick Player (by ckey)" verb for admins to use * Change the tgui alerts in the kick code to regular alerts
- Loading branch information
1 parent
35f7b69
commit 26a8443
Showing
5 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/proc/kick_client(client/to_kick) | ||
// Pretty much everything in this proc is copied straight from `code/modules/admin/topic.dm`, | ||
// proc `/datum/admins/Topic()`, href `"boot2"`. If it breaks here, it was probably broken there | ||
// too. | ||
if(!check_rights(R_ADMIN)) | ||
return | ||
if(!to_kick) | ||
to_chat(usr, span_danger("Error: The client you specified has disappeared!"), confidential = TRUE) | ||
return | ||
if(!check_if_greater_rights_than(to_kick)) | ||
to_chat(usr, span_danger("Error: They have more rights than you do."), confidential = TRUE) | ||
return | ||
to_chat(to_kick, span_danger("You have been kicked from the server by [usr.client.holder.fakekey ? "an Administrator" : "[usr.client.key]"]."), confidential = TRUE) | ||
log_admin("[key_name(usr)] kicked [key_name(to_kick)].") | ||
message_admins(span_adminnotice("[key_name_admin(usr)] kicked [key_name_admin(to_kick)].")) | ||
qdel(to_kick) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
monkestation/code/modules/admin/verbs/kick_player_by_ckey.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/datum/admins/proc/kick_player_by_ckey() | ||
set name = "Kick Player (by ckey)" | ||
set category = "Admin" | ||
|
||
// Pretty much everything here except the client selection is copied straight from | ||
// `code/modules/admin/topic.dm`, proc `/datum/admins/Topic()`, href `"boot2"`. If it breaks | ||
// here, it was probably broken there too. | ||
if(!check_rights(R_ADMIN)) | ||
return | ||
|
||
var/client/to_kick = input(usr, "Select a ckey to kick.", "Select a ckey") as null|anything in sort_list(GLOB.clients) | ||
if(!to_kick) | ||
return | ||
|
||
var/confirmation = alert(usr, "Kick [key_name(to_kick)]?", "Confirm", "Yes", "No") | ||
if(confirmation != "Yes") | ||
return | ||
|
||
kick_client(to_kick) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters