mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 18:02:57 +00:00
map keys
This commit is contained in:
@@ -21,13 +21,26 @@ SUBSYSTEM_DEF(persistence)
|
||||
/datum/controller/subsystem/persistence/Initialize()
|
||||
LoadServerPersistence()
|
||||
LoadGamePersistence()
|
||||
LoadMapPersistence()
|
||||
var/map_persistence_path = get_map_persistence_path()
|
||||
if(map_persistence_path)
|
||||
LoadMapPersistence(map_persistence_path)
|
||||
return ..()
|
||||
|
||||
/**
|
||||
* Gets the persistence path of the current map.
|
||||
*/
|
||||
/datum/controller/subsystem/persistence/proc/get_map_persistence_path()
|
||||
ASSERT(SSmapping.config)
|
||||
if(SSmapping.config.persistence_key == "NO_PERSIST")
|
||||
return null
|
||||
return "data/persistence/[ckey(SSmapping.config.persistence_key)]"
|
||||
|
||||
/datum/controller/subsystem/persistence/proc/CollectData()
|
||||
SaveServerPersistence()
|
||||
SaveGamePersistence()
|
||||
SaveMapPersistence()
|
||||
var/map_persistence_path = get_map_persistence_path()
|
||||
if(map_persistence_path)
|
||||
SaveMapPersistence(map_persistence_path)
|
||||
|
||||
/**
|
||||
* Loads persistent data relevant to the server: Configurations, past gamemodes, votes, etc
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
var/map_name = "Box Station"
|
||||
var/map_path = "map_files/BoxStation"
|
||||
var/map_file = "BoxStation.dmm"
|
||||
/// Persistence key: Defaults to ckey(map_name). If set to "NO_PERSIST", this map will have NO persistence.
|
||||
var/persistence_key
|
||||
|
||||
var/traits = null
|
||||
var/space_ruin_levels = 4
|
||||
@@ -99,6 +101,15 @@
|
||||
map_path = json["map_path"]
|
||||
|
||||
map_file = json["map_file"]
|
||||
|
||||
persistence_key = ckey(map_name)
|
||||
|
||||
var/json_persistence_key = json["persistence_key"]
|
||||
if(json_persistence_key == "NO_PERSIST")
|
||||
persistence_key = null
|
||||
else
|
||||
persistence_key = json_persistence_key
|
||||
|
||||
// "map_file": "BoxStation.dmm"
|
||||
if (istext(map_file))
|
||||
if (!fexists("_maps/[map_path]/[map_file]"))
|
||||
|
||||
Reference in New Issue
Block a user