Files
VOREStation/code/controllers/subsystems/persistence.dm
Selis f4bf017921 Unit Test rework & Master/Ticker update (#17912)
* Unit Test rework & Master/Ticker update

* Fixes and working unit testing

* Fixes

* Test fixes and FA update

* Fixed runtimes

* Radio subsystem

* move that glob wherever later

* ident

* CIBUILDING compile option

* Fixed runtimes

* Some changes to the workflow

* CI Split

* More split

* Pathing

* Linters and Annotators

* ci dir fix

* Missing undef fixed

* Enable grep checks

* More test conversions

* More split

* Correct file

* Removes unneeded inputs

* oop

* More dependency changes

* More conversions

* Conversion fixes

* Fixes

* Some assert fixes

* Corrects start gate

* Converted some README.dms to README.mds

* Removes duplicate proc

* Removes unused defines

* Example configs

* fix dll access viol by double calling

* Post-rebase fixes

* Cleans up names global list

* Undef restart counter

* More code/game/ cleanup

* Statpanel update

* Skybox

* add

* Fix ticker

* Roundend fix

* Persistence dependency update

* Reordering

* Reordering

* Reordering

* Initstage fix

* .

* .

* Reorder

* Reorder

* Circle

* Mobs

* Air

* Test fix

* CI Script Fix

* Configs

* More ticker stuff

* This is now in 'reboot world'

* Restart world announcements

* no glob in PreInit

* to define

* Update

* Removed old include

* Make this file normal again

* moved

* test

* shared unit testing objects

* Updates batched_spritesheets and universal_icon

* .

* job data debug

* rm that

* init order

* show us

* .

* i wonder

* .

* .

* urg

* do we not have a job ID?

* .

* rm sleep for now

* updated rust-g linux binaries

* binaries update 2

* binaries update 3

* testing something

* change that

* test something

* .

* .

* .

* locavar

* test

* move that

* .

* debug

* don't run this test

* strack trace it

* cleaner

* .

* .

* cras again

* also comment this out

* return to official rust g

* Update robot_icons.dm

* monitor the generation

* .

---------

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
2025-08-10 01:37:23 +02:00

70 lines
2.1 KiB
Plaintext

SUBSYSTEM_DEF(persistence)
name = "Persistence"
dependencies = list(
/datum/controller/subsystem/mapping,
/datum/controller/subsystem/atoms,
/datum/controller/subsystem/points_of_interest
)
flags = SS_NO_FIRE
var/list/tracking_values = list()
var/list/persistence_datums = list()
/// Places our subsystem can spawn paintings (helps with art spawning differently across maps)
var/list/obj/structure/sign/painting/painting_frames = list()
var/list/all_paintings = list()
var/list/unpicked_paintings = list()
/datum/controller/subsystem/persistence/Initialize()
for(var/datum/persistent/P as anything in subtypesof(/datum/persistent))
if(initial(P.name))
P = new P
persistence_datums[P.type] = P
P.Initialize()
return SS_INIT_SUCCESS
/datum/controller/subsystem/persistence/Shutdown()
for(var/thing in persistence_datums)
var/datum/persistent/P = persistence_datums[thing]
P.Shutdown()
/datum/controller/subsystem/persistence/proc/track_value(var/atom/value, var/track_type)
if(CONFIG_GET(flag/persistence_disabled)) //if the config is set to persistence disabled, nothing will save or load.
return
var/turf/T = get_turf(value)
if(!T)
return
var/area/A = get_area(T)
if(!A || (A.flag_check(AREA_FLAG_IS_NOT_PERSISTENT)))
return
if(!(T.z in using_map.persist_levels))
return
if(!tracking_values[track_type])
tracking_values[track_type] = list()
tracking_values[track_type] += value
/datum/controller/subsystem/persistence/proc/forget_value(var/atom/value, var/track_type)
if(tracking_values[track_type])
tracking_values[track_type] -= value
/datum/controller/subsystem/persistence/proc/show_info(var/mob/user)
if(!check_rights_for(user.client, R_HOLDER))
return
var/list/dat = list("<table width = '100%'>")
var/can_modify = check_rights_for(user.client, (R_ADMIN|R_DEBUG))
for(var/thing in persistence_datums)
var/datum/persistent/P = persistence_datums[thing]
if(P.has_admin_data)
dat += P.GetAdminSummary(user, can_modify)
dat += "</table>"
var/datum/browser/popup = new(user, "admin_persistence", "Persistence Data")
popup.set_content(jointext(dat, null))
popup.open()