Skip to content

fileSaves

fileSaves(dir): SavePort

Saves as small JSON files in one directory (a standalone server that must keep them across restarts). File names are a hash of the key, so nothing a player or page controls reaches the path. A file written half way never replaces a good one (write to a temp name, then rename). Several processes may share the directory (blue/green): a world load with meta.claim first writes the room session beside the save (.owner), and a world write or delete from any other session is refused (“superseded”), checked again just before the rename, so a slow write from a room that already handed the save to another process never lands over the new owner’s game.

string

SavePort