/tg/ Station 13 - Modules - Types

code/modules/unit_tests/~nova/cyborg_storage.dm

/datum/unit_test/cyborg_storage_fixtureStaged save text keeps edits, failures and slot lifecycles apart, and holds each character to its byte limit.
/datum/unit_test/cyborg_save_text_round_tripSave text reloads as exactly what the old nested tree reloaded as, which overrides exist included, in far fewer bytes.
/datum/unit_test/cyborg_staged_text_is_independentStaging writes text, so nothing done to the draft or a read tree afterwards reaches the saved revision.
/datum/unit_test/cyborg_library_actions_stage_completelyLibrary actions stage everything they touch: a preset update reaches its linked default, and order survives re-adding.
/datum/unit_test/cyborg_raw_updates_and_public_writesRaw draft updates stage like action results, and a public write to the editor's slot makes it stage its draft again.
/datum/unit_test/cyborg_external_stage_keeps_unsaved_revisionA public replacement can complete I/O without saving the editor's superseded pending revision.
/datum/unit_test/cyborg_stage_model_sprite_callbacksRoot and sprite callbacks must publish new draft roots before staging can track revisions.
/datum/unit_test/cyborg_stage_failure_slot_lifecycleA newer accepted stage must survive failed I/O, slot changes, deletion and future-schema replacement.
/datum/unit_test/cyborg_slot_limitEach character's setups have one byte limit. Copies that would pass it are refused up front; edits that pass it stay unsaved, and only edits that shrink the slot go through until it fits again.
/datum/unit_test/cyborg_sidecar_size_limitAll of an account's characters share one limit. A character that would pass it is not staged and the file keeps its last good contents until there is room; save() refuses a bigger tree whatever put it there.
/datum/unit_test/cyborg_sidecar_refuses_oversized_fileA sidecar already past the limit on disk is neither decoded nor written over, and the editor says why.
/datum/unit_test/cyborg_model_defaults_limitA character keeps at most CYBORG_LAYOUT_MAX_MODEL_DEFAULTS model defaults. Replacing one stays allowed, and an import past the limit keeps the first ones.
/datum/unit_test/cyborg_import_replaces_old_layoutsAn import replaces every character's layouts: the old ones go, and one too big for its character is left out.
/datum/unit_test/cyborg_save_queueEditor actions only ask for a save. The queued save stages the latest draft, writes once, acknowledges the revision it wrote, and waits out the account's spacing and the subsystem's budget in the queue. Edits back to what was written write nothing, and the subsystem only fires while accounts wait.
/datum/unit_test/cyborg_encode_cacheThe part cache never changes what is saved: action results reuse unchanged parts' text, and raw draft updates drop it.
/datum/unit_test/cyborg_body_snapshotA body spawned from save text decodes its active layout, and a chassis's default only when that chassis first asks, each exactly as the whole slot decodes. An open draft is copied instead, unsaved edits and all.