mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-21 06:06:33 +01:00
21 lines
843 B
Plaintext
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
|