From ac103d4b1464d2f5f4cc473e9f561b1492a0c574 Mon Sep 17 00:00:00 2001 From: Real-MAGNUM <60511054+Real-MAGNUM@users.noreply.github.com> Date: Fri, 7 Jun 2024 13:50:45 -0400 Subject: [PATCH] Ports bunker bypassing --- code/modules/admin/admin_verbs.dm | 3 ++- code/modules/admin/bunker_bypass.dm | 18 ++++++++++++++++++ code/modules/client/client_procs.dm | 3 ++- roguetown.dme | 1 + 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 code/modules/admin/bunker_bypass.dm diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 5dfc2ada28..937206951c 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -29,7 +29,8 @@ GLOBAL_PROTECT(admin_verbs_default) /client/proc/delete_player_book, /client/proc/amend_player_book, /client/proc/pull_book_file_names, - /client/proc/adminwho + /client/proc/adminwho, + /client/proc/bunker_bypass ) GLOBAL_LIST_INIT(admin_verbs_admin, world.AVerbsAdmin()) GLOBAL_PROTECT(admin_verbs_admin) diff --git a/code/modules/admin/bunker_bypass.dm b/code/modules/admin/bunker_bypass.dm new file mode 100644 index 0000000000..5378094b69 --- /dev/null +++ b/code/modules/admin/bunker_bypass.dm @@ -0,0 +1,18 @@ +GLOBAL_LIST_EMPTY(bunker_bypasses) + +/client/proc/bunker_bypass() + set category = "Admin" + set name = "Add Bunker Bypass" + + var/selection = input("Who would you like to let in?", "CKEY", "") as text|null + if(selection) + add_bunker_bypass(selection, ckey) + +/proc/add_bunker_bypass(target_ckey, admin_ckey = "SYSTEM") + if(!target_ckey) + return + + target_ckey = ckey(target_ckey) + GLOB.bunker_bypasses |= target_ckey + message_admins("BUNKER BYPASS: Added [target_ckey] to the bypass list[admin_ckey? " by [admin_ckey]":""]") + log_admin("BUNKER BYPASS: Added [target_ckey] to the bypass list[admin_ckey? " by [admin_ckey]":""]") diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index bce9c08468..23d87eb94e 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -601,7 +601,8 @@ GLOBAL_LIST_EMPTY(external_rsc_urls) qdel(query_client_in_db) return if(!query_client_in_db.NextRow()) - if (CONFIG_GET(flag/panic_bunker) && !holder && !GLOB.deadmins[ckey]) + // if (CONFIG_GET(flag/panic_bunker) && !holder && !GLOB.deadmins[ckey]) + if (CONFIG_GET(flag/panic_bunker) && !holder && !GLOB.deadmins[ckey] && !(ckey in GLOB.bunker_bypasses)) log_access("Failed Login: [key] - New account attempting to connect during panic bunker") message_admins("Failed Login: [key] - New account attempting to connect during panic bunker") to_chat(src, CONFIG_GET(string/panic_bunker_message)) diff --git a/roguetown.dme b/roguetown.dme index 9688d43712..4ef8e025ab 100644 --- a/roguetown.dme +++ b/roguetown.dme @@ -1360,6 +1360,7 @@ #include "code\modules\admin\adminmenu.dm" #include "code\modules\admin\antag_panel.dm" #include "code\modules\admin\blacklist.dm" +#include "code\modules\admin\bunker_bypass.dm" #include "code\modules\admin\chat_commands.dm" #include "code\modules\admin\check_antagonists.dm" #include "code\modules\admin\create_mob.dm"