From 4e00f59d8279dd9d6cd596a77bf8ed5dff652cdc Mon Sep 17 00:00:00 2001 From: deathride58 Date: Wed, 27 Feb 2019 07:46:34 -0500 Subject: [PATCH] Adds the ability to allow specific ckeys to bypass the panic bunker for a given round --- code/_globalvars/lists/mobs.dm | 2 ++ code/modules/admin/admin_verbs.dm | 4 ++++ code/modules/admin/verbs/panicbunker.dm | 25 +++++++++++++++++++++++++ code/modules/client/client_procs.dm | 2 +- 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/code/_globalvars/lists/mobs.dm b/code/_globalvars/lists/mobs.dm index e569996998..c883254afe 100644 --- a/code/_globalvars/lists/mobs.dm +++ b/code/_globalvars/lists/mobs.dm @@ -6,6 +6,8 @@ GLOBAL_LIST_EMPTY(deadmins) //all ckeys who have used the de-admin verb. GLOBAL_LIST_EMPTY(directory) //all ckeys with associated client GLOBAL_LIST_EMPTY(stealthminID) //reference list with IDs that store ckeys, for stealthmins +GLOBAL_LIST_EMPTY(bunker_passthrough) + //Since it didn't really belong in any other category, I'm putting this here //This is for procs to replace all the goddamn 'in world's that are chilling around the code diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 47ddd0aef3..e21c2b8873 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -70,6 +70,8 @@ GLOBAL_LIST_INIT(admin_verbs_admin, world.AVerbsAdmin()) /client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/ /client/proc/cmd_admin_pm_panel, /*admin-pm list*/ /client/proc/panicbunker, + /client/proc/addbunkerbypass, + /client/proc/revokebunkerbypass, /client/proc/stop_sounds, /client/proc/hide_verbs, /*hides all our adminverbs*/ /client/proc/hide_most_verbs, /*hides all our hideable adminverbs*/ @@ -233,6 +235,8 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, list( /proc/release, /client/proc/reload_admins, /client/proc/panicbunker, + /client/proc/addbunkerbypass, + /client/proc/revokebunkerbypass, /client/proc/admin_change_sec_level, /client/proc/toggle_nuke, /client/proc/cmd_display_del_log, diff --git a/code/modules/admin/verbs/panicbunker.dm b/code/modules/admin/verbs/panicbunker.dm index fc0cab66c9..175ab45aeb 100644 --- a/code/modules/admin/verbs/panicbunker.dm +++ b/code/modules/admin/verbs/panicbunker.dm @@ -13,3 +13,28 @@ if (new_pb && !SSdbcore.Connect()) message_admins("The Database is not connected! Panic bunker will not work until the connection is reestablished.") SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Panic Bunker", "[new_pb ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + +/client/proc/addbunkerbypass(ckeytobypass as text) + set category = "Special Verbs" + set name = "Add PB Bypass" + set desc = "Allows a given ckey to connect despite the panic bunker for a given round." + if(!CONFIG_GET(flag/sql_enabled)) + to_chat(usr, "The Database is not enabled!") + return + + GLOB.bunker_passthrough |= ckeytobypass + log_admin("[key_name(usr)] has added [ckeytobypass] to the current round's bunker bypass list.") + message_admins("[key_name(usr)] has added [ckeytobypass] to the current round's bunker bypass list.") + +/client/proc/revokebunkerbypass(ckeytobypass as text) + set category = "Special Verbs" + set name = "Revoke PB Bypass" + set desc = "Revoke's a ckey's permission to bypass the panic bunker for a given round." + if(!CONFIG_GET(flag/sql_enabled)) + to_chat(usr, "The Database is not enabled!") + return + + GLOB.bunker_passthrough -= ckeytobypass + log_admin("[key_name(usr)] has removed [ckeytobypass] from the current round's bunker bypass list.") + message_admins("[key_name(usr)] has removed [ckeytobypass] from the current round's bunker bypass list.") + diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index f93b799e8d..18f50f03a3 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -499,7 +499,7 @@ 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] && !ckey in GLOB.bunker_passthrough) 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, "You must first join the Discord to verify your account before joining this server.
To do so, read the rules and post a request in the #station-access-requests channel under the \"Main server\" category in the Discord server linked here: https://discord.gg/E6SQuhz
") //CIT CHANGE - makes the panic bunker disconnect message point to the discord