/tg/ Station 13 - Modules - Types — Define Details

modular_nova/modules/preferences_import/code/_sanitise.dm

PREFS_IMPORT_MAX_DEPTHCap on JSON nesting depth, json_decode has none of its own.
PREFS_IMPORT_MAX_SLOTSCap on character slots in an imported file.
PREFS_IMPORT_PENDING_KEYMarks a file as waiting on pass 2.
PREFS_IMPORT_NOTICE_KEYHave we already shown them the import notice?
/proc/prefs_import_tree_too_deepCheck depth iteratively so a deeply nested upload cannot overflow the call stack.
/proc/prefs_import_prevalidateStructural checks. Returns an error string, or null if it's fine.
/proc/prefs_import_pass1Pass 1. Retains character migration inputs. Player imports may only replace player-owned root fields. Supplying local_player_data enables the player allowlist; staff may still restore a complete backup.
/proc/prefs_import_player_rootRegistered preferences plus raw player settings and inputs still used by supported migrations.
/proc/prefs_import_clean_text_listLists consumed as text/type names by raw loaders must not carry numeric indexes or nested collections.
/proc/prefs_import_clean_loadout_presetsloadout_lists is preset -> path -> details, so unwrap a level first.
/proc/prefs_import_clean_loadoutThe UI encodes and caps these, the load path doesn't, so we redo it here.
/proc/prefs_import_clean_assoc_pathsWe just guarantee the shape, the owning loaders resolve them.
/proc/prefs_import_strip_empty_loadout_keysMigration leaves null keys behind, and sanitize_loadout_list stack_traces on them.
/proc/prefs_import_strip_empty_keysPass 1 and native migrations produce unique path keys; copy only to remove empty keys, preserving shared lists.

Define Details

PREFS_IMPORT_MAX_DEPTH

Cap on JSON nesting depth, json_decode has none of its own.

PREFS_IMPORT_MAX_SLOTS

Cap on character slots in an imported file.

PREFS_IMPORT_NOTICE_KEY

Have we already shown them the import notice?

PREFS_IMPORT_PENDING_KEY

Marks a file as waiting on pass 2.