Whitelist Admin Verb (#92276)

Co-authored-by: Lucy <lucy@absolucy.moe>
This commit is contained in:
FalloutFalcon
2025-07-28 15:32:02 -04:00
committed by GitHub
co-authored by Lucy
parent ab0cbe17f5
commit 7b5ee58502
+19
View File
@@ -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