Files
siliconsGitHubVM_USER <VM_USER>silicons
8ca04ad274 persistence update + spraycans + graffiti + persistent debris + glass shards (#4301)
Co-authored-by: VM_USER <VM_USER>
Co-authored-by: silicons <no@you.cat>
2024-03-04 23:06:10 +01:00

21 lines
843 B
Plaintext

//* This file is explicitly licensed under the MIT license. *//
//* Copyright (c) 2023 Citadel Station developers. *//
// Persistent panic bunker passthrough
/datum/controller/subsystem/persistence/proc/SavePanicBunker()
var/json_file = file(PERSISTENCE_FILE_BUNKER_PASSTHROUGH)
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/LoadPanicBunker()
var/bunker_path = file(PERSISTENCE_FILE_BUNKER_PASSTHROUGH)
if(fexists(bunker_path))
var/list/json = json_decode(file2text(bunker_path))
GLOB.bunker_passthrough = json["data"]
for(var/ckey in GLOB.bunker_passthrough)
if(daysSince(GLOB.bunker_passthrough[ckey]) >= CONFIG_GET(number/panic_bunker_bypass))
GLOB.bunker_passthrough -= ckey