From 7b5ee58502e8fe6e6620fbbe2400cc808782f24e Mon Sep 17 00:00:00 2001 From: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com> Date: Mon, 28 Jul 2025 14:32:02 -0500 Subject: [PATCH] Whitelist Admin Verb (#92276) Co-authored-by: Lucy --- code/modules/admin/whitelist.dm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/code/modules/admin/whitelist.dm b/code/modules/admin/whitelist.dm index 759c381bb2e..1b563accaaf 100644 --- a/code/modules/admin/whitelist.dm +++ b/code/modules/admin/whitelist.dm @@ -19,4 +19,23 @@ GLOBAL_LIST(whitelist) return FALSE . = (ckey in GLOB.whitelist) +ADMIN_VERB(whitelist_player, R_BAN, "Whitelist CKey", "Adds a ckey to the Whitelist file.", ADMIN_CATEGORY_MAIN) + var/input_ckey = input("CKey to whitelist: (Adds CKey to the whitelist.txt)") as null|text + // The ckey proc "santizies" it to be its "true" form + var/canon_ckey = ckey(input_ckey) + if(!input_ckey || !canon_ckey) + return + // Dont add them to the whitelist if they are already in it + if(canon_ckey in GLOB.whitelist) + return + + GLOB.whitelist += canon_ckey + rustg_file_append("\n[input_ckey]", WHITELISTFILE) + + message_admins("[input_ckey] has been whitelisted by [key_name(user)]") + log_admin("[input_ckey] has been whitelisted by [key_name(user)]") + +ADMIN_VERB_CUSTOM_EXIST_CHECK(whitelist_player) + return CONFIG_GET(flag/usewhitelist) + #undef WHITELISTFILE