SaveSlotCodeUtils
Generates human-sanity-checkable share codes for exported save slots, and defines the injectable
generator a game overrides via SaveSlotService.SetCodeGenerator. The default format,
<date>-<state>-<user>-<token> (e.g. 20260723-world3-jonnen-4f7k2q1a), is recognizable on
copy/paste -- you can eyeball the date, slot, and owner -- while the random token keeps it
collision-resistant. Codes are used as datastore keys, so every component is sanitized to a safe,
length-capped lowercase slug.
Types
CodeGeneratorContext
interface CodeGeneratorContext {userId: number?userName: string?slotName: string?slotIndex: number?}The information a code generator may fold into a code. Every field is optional -- a generator must degrade gracefully when, say, the player's user id cannot be resolved.