From 3dcce2b43a3cb9475efa05b977f1c6716934a16b Mon Sep 17 00:00:00 2001 From: Putnam Date: Sat, 1 Feb 2020 09:10:02 -0800 Subject: [PATCH] added some cleanup code --- code/controllers/subsystem/persistence.dm | 4 ++++ code/modules/admin/chat_commands.dm | 1 + code/modules/admin/verbs/panicbunker.dm | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/code/controllers/subsystem/persistence.dm b/code/controllers/subsystem/persistence.dm index 532f1162f7..3f4064d78c 100644 --- a/code/controllers/subsystem/persistence.dm +++ b/code/controllers/subsystem/persistence.dm @@ -266,6 +266,10 @@ SUBSYSTEM_DEF(persistence) var/bunker_path = file("data/bunker_passthrough.json") if(fexists(bunker_path)) 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] > 30) + GLOB.bunker_passthrough -= ckey /datum/controller/subsystem/persistence/proc/GetPhotoAlbums() var/album_path = file("data/photo_albums.json") diff --git a/code/modules/admin/chat_commands.dm b/code/modules/admin/chat_commands.dm index 5743fe35b0..fae6e155c7 100644 --- a/code/modules/admin/chat_commands.dm +++ b/code/modules/admin/chat_commands.dm @@ -137,6 +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 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 58d84538ab..6e7191e67f 100644 --- a/code/modules/admin/verbs/panicbunker.dm +++ b/code/modules/admin/verbs/panicbunker.dm @@ -24,7 +24,8 @@ return GLOB.bunker_passthrough |= ckey(ckeytobypass) - SSpersistence.SavePanicBunker() + GLOB.bunker_passthrough[ckey(ckeytobypass)] = GLOB.round_id + 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.") send2irc("Panic Bunker", "[key_name(usr)] has added [ckeytobypass] to the current round's bunker bypass list.")