SaveSessionOptions
What createSaveSession takes.
Extends
Section titled “Extends”Partial<SaveResolveOptions>
Properties
Section titled “Properties”| Property | Type | Default value | Description |
|---|---|---|---|
account |
() => SaveAccount |
undefined |
Who is playing, read at each read and restore. |
game? |
GameDescriptor |
the game the world was made from |
The game, whose saves the session keeps: the core’s as the game overrides them, each listed plugin’s as its call does, and the game’s own state. |
holdsWorld? |
boolean |
undefined |
Whether the page or room holds a world now: a page holds the player’s one world, a room the world its kind holds, and a hub none, which keeps nothing of a world’s records. |
host? |
SaveHost |
undefined |
A page or a room. |
onRefuse? |
(refused) => void |
undefined |
Called each time the session refuses the load: a record that does not load, or a restore that throws, at the load, onto the player or onto a saved entity later. The game stops on the load-failure screen. |
record? |
SaveRecordPart |
on a page, every record in one; in a room, the player's game-wide record |
Which of the game’s records the session keeps: a room keeps one session for each, and attachPlayerSaves binds the player’s two together. The world’s reads the world without the entities a player’s record or a key keeps. Left out on a page, the session keeps the page’s one record of all three, as splitPageRecord lays it out. The world’s part restores as it loads, then the player’s game-wide part and the player’s part in the world as the player joins, as a room restores them. |
seed? |
() => number |
one drawn from the browser's random source |
The seed a new game’s random stream starts from, where the save includes random: a fixed one makes two runs draw alike, as a profile run needs. |