diff --git a/code/controllers/subsystem/persistence.dm b/code/controllers/subsystem/persistence.dm index e43c8f21a2..532f1162f7 100644 --- a/code/controllers/subsystem/persistence.dm +++ b/code/controllers/subsystem/persistence.dm @@ -39,6 +39,7 @@ SUBSYSTEM_DEF(persistence) if(CONFIG_GET(flag/use_antag_rep)) LoadAntagReputation() LoadRandomizedRecipes() + LoadPanicBunker() return ..() /datum/controller/subsystem/persistence/proc/LoadSatchels() @@ -259,6 +260,12 @@ SUBSYSTEM_DEF(persistence) if(CONFIG_GET(flag/use_antag_rep)) CollectAntagReputation() SaveRandomizedRecipes() + SavePanicBunker() + +/datum/controller/subsystem/persistence/proc/LoadPanicBunker() + var/bunker_path = file("data/bunker_passthrough.json") + if(fexists(bunker_path)) + GLOB.bunker_passthrough = json_decode(file2text(bunker_path)) /datum/controller/subsystem/persistence/proc/GetPhotoAlbums() var/album_path = file("data/photo_albums.json") @@ -381,6 +388,13 @@ SUBSYSTEM_DEF(persistence) fdel(json_file) WRITE_FILE(json_file, json_encode(file_data)) +/datum/controller/subsystem/persistence/proc/SavePanicBunker() + var/json_file = file("data/bunker_passthrough.json") + var/list/file_data = list() + file_data["data"] = GLOB.bunker_passthrough + fdel(json_file) + WRITE_FILE(json_file,json_encode(file_data)) + /datum/controller/subsystem/persistence/proc/remove_duplicate_trophies(list/trophies) var/list/ukeys = list() . = list() diff --git a/code/datums/world_topic.dm b/code/datums/world_topic.dm index 49fdd64a72..8e16cd3d7f 100644 --- a/code/datums/world_topic.dm +++ b/code/datums/world_topic.dm @@ -187,3 +187,6 @@ if(!key_valid) GLOB.topic_status_cache = . + +/datum/world_topic/panic_bunker + \ No newline at end of file diff --git a/code/modules/admin/chat_commands.dm b/code/modules/admin/chat_commands.dm index 52ba3c521e..3adaabce5e 100644 --- a/code/modules/admin/chat_commands.dm +++ b/code/modules/admin/chat_commands.dm @@ -137,7 +137,7 @@ GLOBAL_LIST(round_end_notifiees) return "The Database is not enabled!" GLOB.bunker_passthrough |= ckey(params) - + log_admin("[sender.friendly_name] has added [params] to the current round's bunker bypass list.") message_admins("[sender.friendly_name] has added [params] to the current round's bunker bypass list.") return "[params] has been added to the current round's bunker bypass list." diff --git a/code/modules/admin/verbs/panicbunker.dm b/code/modules/admin/verbs/panicbunker.dm index 2897427d6f..58d84538ab 100644 --- a/code/modules/admin/verbs/panicbunker.dm +++ b/code/modules/admin/verbs/panicbunker.dm @@ -24,6 +24,7 @@ return GLOB.bunker_passthrough |= ckey(ckeytobypass) + SSpersistence.SavePanicBunker() log_admin("[key_name(usr)] has added [ckeytobypass] to the current round's bunker bypass list.") message_admins("[key_name_admin(usr)] has added [ckeytobypass] to the current round's bunker bypass list.") send2irc("Panic Bunker", "[key_name(usr)] has added [ckeytobypass] to the current round's bunker bypass list.") @@ -37,6 +38,7 @@ return GLOB.bunker_passthrough -= ckey(ckeytobypass) + SSpersistence.SavePanicBunker() log_admin("[key_name(usr)] has removed [ckeytobypass] from the current round's bunker bypass list.") message_admins("[key_name_admin(usr)] has removed [ckeytobypass] from the current round's bunker bypass list.") send2irc("Panic Bunker", "[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 7e466caf8a..884d9cdcb5 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -526,6 +526,8 @@ GLOBAL_LIST_EMPTY(external_rsc_urls) if(!account_join_date) account_join_date = "Error" account_age = -1 + else if(ckey in GLOB.bunker_passthrough) + GLOB.bunker_passthrough -= ckey qdel(query_client_in_db) var/datum/DBQuery/query_get_client_age = SSdbcore.NewQuery("SELECT firstseen, DATEDIFF(Now(),firstseen), accountjoindate, DATEDIFF(Now(),accountjoindate) FROM [format_table_name("player")] WHERE ckey = '[sql_ckey]'") if(!query_get_client_age.Execute())