From c38b2a4585a7a5310d0f49529768bcab61944818 Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Wed, 26 Nov 2025 15:26:49 +0100 Subject: [PATCH] add more whitelist checks (#18800) * add more whitelist checks * . * . * add help command * . * . * Update code/modules/tgs_commands/vorestation.dm Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> * urggg --------- Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> --- code/_global_vars/lists/species.dm | 4 ++-- code/modules/admin/admin.dm | 2 +- code/modules/tgs_commands/vorestation.dm | 25 +++++++++++++++++++++++- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/code/_global_vars/lists/species.dm b/code/_global_vars/lists/species.dm index 817f504f7fb..3744b8dc401 100644 --- a/code/_global_vars/lists/species.dm +++ b/code/_global_vars/lists/species.dm @@ -1,7 +1,7 @@ //Languages/species/whitelist. GLOBAL_LIST_EMPTY_TYPED(all_species, /datum/species) -GLOBAL_LIST_EMPTY_TYPED(whitelisted_species, /datum/species) // Species that require a whitelist check. -GLOBAL_LIST_EMPTY_TYPED(playable_species, /datum/species) // A list of ALL playable species, whitelisted, latejoin or otherwise. +GLOBAL_LIST_EMPTY(whitelisted_species) // Species that require a whitelist check. +GLOBAL_LIST_EMPTY(playable_species) // A list of ALL playable species, whitelisted, latejoin or otherwise. GLOBAL_LIST_EMPTY_TYPED(all_languages, /datum/language) GLOBAL_LIST_INIT(language_name_conflicts, list()) diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index e59216e7a9d..7f6e5b6cbb0 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -1016,7 +1016,7 @@ var/datum/announcement/minor/admin_min_announcer = new set desc="Delay the game start/end" set name="Delay" - if(!check_rights(R_SERVER|R_EVENT)) return + if(!check_rights(R_SERVER|R_EVENT|R_ADMIN|R_MOD)) return if (SSticker.current_state >= GAME_STATE_PLAYING) // Tell the ticker to delay/resume SSticker.toggle_delay() diff --git a/code/modules/tgs_commands/vorestation.dm b/code/modules/tgs_commands/vorestation.dm index 38b98644e4e..06133205f59 100644 --- a/code/modules/tgs_commands/vorestation.dm +++ b/code/modules/tgs_commands/vorestation.dm @@ -379,7 +379,7 @@ GLOBAL_LIST_EMPTY(pending_discord_registrations) real_target.dust() return "Smite [smite_name] sent!" -#define VALID_ACTIONS list("add", "remove", "list") +#define VALID_ACTIONS list("add", "remove", "list", "help") #define VALID_KINDS list("job", "species") #define VALID_USAGE "whitelist \[[list2text(VALID_ACTIONS, ", ")]\] \[[list2text(VALID_KINDS, ", ")]\] (role)" /datum/tgs_chat_command/whitelist @@ -438,7 +438,30 @@ GLOBAL_LIST_EMPTY(pending_discord_registrations) // Resolve the action switch(action) + if("help") + var/list/whitelist_jobs = list() + for(var/datum/job/our_job in job_master.occupations) + if(our_job.whitelist_only) + whitelist_jobs += our_job.title + message.text = "The following jobs and species have a whitelist:\nJobs: [english_list(whitelist_jobs)]]\nSpecies: [english_list(GLOB.whitelisted_species)]" + return message if("add") + if(kind == "job") + var/datum/job/job = job_master.GetJob(role) + if(!job) + message.text = "Error, invalid job entered. Check spelling and capitalization." + return message + if(!job.whitelist_only) + message.text = "Error, job \"[role]\" is not a whitelist job." + return message + if(kind == "species") + if(role in GLOB.playable_species) + message.text = "Error, invalid species entered. Check spelling and capitalization." + return message + if(!(role in GLOB.whitelisted_species)) + message.text = "Error, species \"[role]\" is not a whitelist species." + return message + var/datum/db_query/command_add = SSdbcore.NewQuery( "INSERT INTO [format_table_name("whitelist")] (ckey, kind, entry) VALUES (:ckey, :kind, :entry)", list("ckey" = ckey, "kind" = kind, "entry" = role)