From 82fbef992066bff7661728943e90ad53c7d4f67f Mon Sep 17 00:00:00 2001 From: Putnam Date: Mon, 3 Feb 2020 03:13:19 -0800 Subject: [PATCH] Made it real time, added to config --- code/controllers/configuration/entries/general.dm | 4 ++++ code/controllers/subsystem/persistence.dm | 2 +- code/modules/admin/chat_commands.dm | 2 +- code/modules/admin/verbs/panicbunker.dm | 2 +- config/config.txt | 2 ++ 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/code/controllers/configuration/entries/general.dm b/code/controllers/configuration/entries/general.dm index 2b3d9d2f72..c3ae90cc1b 100644 --- a/code/controllers/configuration/entries/general.dm +++ b/code/controllers/configuration/entries/general.dm @@ -431,3 +431,7 @@ /datum/config_entry/flag/log_pictures /datum/config_entry/flag/picture_logging_camera + +/datum/config_entry/number/max_bunker_days + config_entry_value = 7 + min_val = 1 diff --git a/code/controllers/subsystem/persistence.dm b/code/controllers/subsystem/persistence.dm index 352e18162b..a4466775ae 100644 --- a/code/controllers/subsystem/persistence.dm +++ b/code/controllers/subsystem/persistence.dm @@ -268,7 +268,7 @@ SUBSYSTEM_DEF(persistence) GLOB.bunker_passthrough = json_decode(file2text(bunker_path)) var/round_id = GLOB.round_id for(var/ckey in GLOB.bunker_passthrough) - if(round_id - GLOB.bunker_passthrough[ckey] > 100) + if(daysSince(GLOB.bunker_passthrough[ckey]) >= CONFIG_GET(number/max_bunker_days)) GLOB.bunker_passthrough -= ckey /datum/controller/subsystem/persistence/proc/GetPhotoAlbums() diff --git a/code/modules/admin/chat_commands.dm b/code/modules/admin/chat_commands.dm index fae6e155c7..e2ddcdcf6a 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) - GLOB.bunker_passthrough[ckey(params)] = GLOB.round_id + GLOB.bunker_passthrough[ckey(params)] = world.realtime SSpersistence.SavePanicBunker() //we can do this every time, it's okay 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.") diff --git a/code/modules/admin/verbs/panicbunker.dm b/code/modules/admin/verbs/panicbunker.dm index 6e7191e67f..daaf15c70f 100644 --- a/code/modules/admin/verbs/panicbunker.dm +++ b/code/modules/admin/verbs/panicbunker.dm @@ -24,7 +24,7 @@ return GLOB.bunker_passthrough |= ckey(ckeytobypass) - GLOB.bunker_passthrough[ckey(ckeytobypass)] = GLOB.round_id + GLOB.bunker_passthrough[ckey(ckeytobypass)] = world.realtime SSpersistence.SavePanicBunker() //we can do this every time, it's okay 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.") diff --git a/config/config.txt b/config/config.txt index a89827809f..6d302a5512 100644 --- a/config/config.txt +++ b/config/config.txt @@ -470,6 +470,8 @@ DISABLE_HIGH_POP_MC_MODE_AMOUNT 60 ## Uncomment to set the number of /world/Reboot()s before the DreamDaemon restarts itself. 0 means restart every round. Requires tgstation server tools. #ROUNDS_UNTIL_HARD_RESTART 10 +## Number of days for an individual panic bunker passthrough entry to be wiped. Note that they're also wiped as soon as a player is in the database. +#MAX_BUNKER_DAYS 7 ##Default screen resolution, in tiles. ## By default, this is 15x15, which gets simplified to 7 by BYOND, as it is a 1:1 screen ratio.