SavePort
Where saves live; the host app supplies it. who is a seat key (“u:slot is the app’s stable key for the game. store(…, null) deletes. Keep a world at least saveDays (90).
Methods
Section titled “Methods”load()
Section titled “load()”load(
scope,slot,who):Promise<{at:number;data:unknown;v?:number; } |null>
null = nothing saved. Reject only when the save could not be read (the hub then writes nothing over it and tries again later).
Parameters
Section titled “Parameters”string
string
string | null
Returns
Section titled “Returns”Promise<{ at: number; data: unknown; v?: number; } | null>
store()
Section titled “store()”store(
scope,slot,who,data,meta?):Promise<void>
meta.session: one id per room session for world saves, so a store that keeps an earlier copy can take it once per session. meta.v: the game’s save format number (multiplayer.saveVersion), kept with the data and given back by load (a file without it counts as 1).
Parameters
Section titled “Parameters”string
string
string | null
unknown
session?
Section titled “session?”string
number
Returns
Section titled “Returns”Promise<void>