Interface: LockstepState<Input>
Defined in: server/lockstep.ts:7
What a lockstep room keeps: what clients see, and the inputs waiting for the next turn.
Extends
LockstepView<Input>
Type Parameters
| Type Parameter |
|---|
Input |
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
seed | number | Seed for the simulation's random numbers. The same for every player and every replay. | LockstepView.seed | lockstep.ts:20 |
turn | number | The latest turn. | LockstepView.turn | lockstep.ts:22 |
entries | TurnEntry<Input>[] | What happened in the latest turn, in the order every client must apply it. | LockstepView.entries | lockstep.ts:24 |
desync | | { turn: number; } | null | Set once two players reported different hashes for the same turn. | LockstepView.desync | lockstep.ts:26 |
clock? | "players" | Set to "players" by a room whose turnClock is "players": the room sleeps between turns, and closes them when a player's client asks. | LockstepView.clock | lockstep.ts:34 |
snapshotEvery? | number | How many turns go by between snapshots, when the room keeps them: a client whose simulation has save and load sends one each time the turn is a multiple of this. | LockstepView.snapshotEvery | lockstep.ts:40 |
pending | TurnEntry<Input>[] | Inputs and events waiting for the next turn. Not sent to clients. | - | server/lockstep.ts:9 |