SaveSlotDataService
Functions
ObserveActiveSlotId
SaveSlotDataService.ObserveActiveSlotId(player: Player) → Observable.Observable<SaveSlotData.SlotId?>Observes the player's active slot ID. Emits nil -- rather than staying silent -- while the implementation has not replicated yet, so a subscriber always has a current answer.
ObserveLastActiveSlotId
SaveSlotDataService.ObserveLastActiveSlotId(player: Player) → Observable.Observable<SaveSlotData.SlotId?>Observes the player's last active slot ID (the slot they can continue on). Emits nil -- rather than staying silent -- while the implementation has not replicated yet.
GetActiveSlotId
Returns the player's active slot ID
GetLastActiveSlotId
Returns the player's last active slot ID -- the active slot when one is selected, otherwise the slot they last played and can continue on. This is the slot the "." shorthand resolves to in the save-slot Cmdr commands. The synchronous counterpart to SaveSlotDataService.ObserveLastActiveSlotId.
ObserveSlotList
SaveSlotDataService.ObserveSlotList(player: Player) → Observable.Observable<{SaveSlotData.SaveSlotMetadata}?>Observes the player's active slot list. Ephemeral slots (see HasSaveSlots.PromiseSelectEphemeralSlot) are excluded -- observe the active slot's metadata directly with SaveSlotDataService.ObserveSlotMetadata to see one.
Emits nil while the slot container has not replicated, then one entry per slot, re-emitting whenever a slot is added or removed or any slot's own metadata changes.
GetSlotList
Returns the player's slot list. Ephemeral slots (see HasSaveSlots.PromiseSelectEphemeralSlot) are excluded -- read the active slot's metadata directly with SaveSlotDataService.GetSlotMetadata to see one.
ObserveSlotMetadata
SaveSlotDataService.ObserveSlotMetadata() → Observable.Observable<SaveSlotData.SaveSlotMetadata?>Observes the slot metadata with the given ID for the player. Order-independent: the slot container, the slot folder, and the slot's own attributes each replicate on their own schedule, so this emits nil until the slot is actually there, the metadata once it is, again on every attribute that lands afterwards, and nil again the moment the slot goes away (which is how an ephemeral slot ends).
GetSlotMetadata
SaveSlotDataService.GetSlotMetadata() → SaveSlotData.SaveSlotMetadata?Returns the slot metadata with the given ID for the player
ObserveActiveSlotMetadata
SaveSlotDataService.ObserveActiveSlotMetadata(player: Player) → Observable.Observable<SaveSlotData.SaveSlotMetadata?>Observes the metadata of whichever slot is currently active, following the selection as it changes and emitting nil while no slot is active. This is the read a UI showing "what am I playing right now" wants: composing SaveSlotDataService.ObserveActiveSlotId with SaveSlotDataService.ObserveSlotMetadata by hand is easy to get wrong, because the active-slot id and the slot folder it names replicate independently -- the id routinely arrives first.
An ephemeral slot is included here (it is genuinely the active slot); it is only the list reads that exclude it.
GetActiveSlotMetadata
Returns the metadata of whichever slot is currently active, or nil when no slot is active or its metadata has not replicated yet. The synchronous counterpart to SaveSlotDataService.ObserveActiveSlotMetadata.
ObserveIsActiveSlotEphemeral
Observes whether the active slot is an ephemeral, never-persisted one (see HasSaveSlots.PromiseSelectEphemeralSlot) -- what a UI checks before offering "save", "delete", or anything else that only makes sense on a real save.
Emits false while the answer is not known yet (no slot active, or the slot's metadata still in flight) and flips to true once the slot's IsEphemeral attribute lands, so a late attribute downgrades the UI rather than the reverse. Deduplicated, so it only emits on genuine changes.
IsActiveSlotEphemeral
Returns whether the active slot is an ephemeral, never-persisted one. False when no slot is active or its metadata has not replicated yet. The synchronous counterpart to SaveSlotDataService.ObserveIsActiveSlotEphemeral.
GetSlotIdFromIndex
SaveSlotDataService.GetSlotIdFromIndex() → SaveSlotData.SlotId?Returns the ID for the slot at the given index