Skip to content

Commit

Permalink
Adds a staff button to check for whitelisted players. (#7062)
Browse files Browse the repository at this point in the history
# About the pull request

It's not uncommon for events to be run with whitelisted roles, and this
will make it much easier to check if someone with the right whitelist is
online.

# Changelog
:cl:
add: Added a staff event verb to check for a particular whitelist and
report online players that have it. Code for the proc from HarryOB
/:cl:

---------

Co-authored-by: kiVts <[email protected]>
  • Loading branch information
realforest2001 and kiVts committed Sep 4, 2024
1 parent 13f70c3 commit 172aeda
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/modules/admin/admin_verbs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ GLOBAL_LIST_INIT(admin_verbs_minor_event, list(
/client/proc/toggle_hardcore_perma,
/client/proc/toggle_bypass_joe_restriction,
/client/proc/toggle_joe_respawns,
/datum/admins/proc/open_shuttlepanel
/datum/admins/proc/open_shuttlepanel,
/client/proc/get_whitelisted_clients,
))

GLOBAL_LIST_INIT(admin_verbs_major_event, list(
Expand Down
17 changes: 17 additions & 0 deletions code/modules/admin/tabs/event_tab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,23 @@

CEI.handle_event_info_update(faction)

/client/proc/get_whitelisted_clients()
set name = "Find Whitelisted Players"
set category = "Admin.Events"
if(!admin_holder)
return

var/flag = tgui_input_list(src, "Which flag?", "Whitelist Flags", GLOB.bitfields["whitelist_status"])

var/list/ckeys = list()
for(var/client/test_client in GLOB.clients)
if(test_client.check_whitelist_status(GLOB.bitfields["whitelist_status"][flag]))
ckeys += test_client.ckey
if(!length(ckeys))
to_chat(src, SPAN_NOTICE("There are no players with that whitelist online"))
return
to_chat(src, SPAN_NOTICE("Whitelist holders: [ckeys.Join(", ")]."))

/client/proc/change_security_level()
if(!check_rights(R_ADMIN))
return
Expand Down

0 comments on commit 172aeda

Please sign in to comment.