Skip to content

Type Alias: LockstepCommand<Input> ​

ts
type LockstepCommand<Input> = 
  | {
  k: "t";
}
  | {
  k: "i";
  d: Input;
}
  | {
  k: "h";
  n: number;
  h: string;
};

Defined in: server/lockstep.ts:17

What a LockstepClient sends: an input (i), its simulation's hash after turn n (h), or, to a room whose turnClock is "players", a request to close the turns that are due (t).

Type Parameters ​

Type Parameter
Input

Union Members ​

Type Literal ​

ts
{
  k: "t";
}
NameTypeDescriptionDefined in
k"t"A request to close the turns that are due.server/lockstep.ts:20

Type Literal ​

ts
{
  k: "i";
  d: Input;
}
NameTypeDescriptionDefined in
k"i"An input.server/lockstep.ts:24
dInputThe input, before parseInput.server/lockstep.ts:26

Type Literal ​

ts
{
  k: "h";
  n: number;
  h: string;
}
NameTypeDescriptionDefined in
k"h"A hash of the client's simulation.server/lockstep.ts:30
nnumberThe turn the simulation was at.server/lockstep.ts:32
hstringThe hash.server/lockstep.ts:34

MIT licence. Tickflare is an independent project and is not affiliated with Cloudflare.