Expand description
Platform Storage backends (ticket 0207, game ADR-0009): files in the OS
data directory on native, localStorage on web.
Structs§
- File
Storage - A
Storagebacked by one file per key, under the OS’s per-app data directory (data_dir).
Functions§
- data_
dir - The OS’s per-app data directory for the game whose storage is called
name: that folder in%APPDATA%on Windows, in~/Library/Application Supporton macOS, in$XDG_DATA_HOME(or~/.local/share) elsewhere on Unix.Noneif the relevant environment variable isn’t set. - platform
- The storage backend for this platform, for the game whose storage is
called
name(AppConfig::storage_name). Native falls back to an in-memory store (nothing persists) if the OS has no usable data directory (the relevant environment variable is unset, which only happens on unsupported or misconfigured systems); it logs an error when that happens. - smoke_
check - A startup check, which the backend runs in debug builds as it hands the game its storage: writes and reads back a throwaway key and logs the result, then removes it.
- web_
prefix - The prefix of every key the web build keeps in
localStoragefor the game whose storage is calledname:name/.