Skip to content

Variable: CloseCode ​

ts
const CloseCode: {
  Replaced: 4000;
  RoomFull: 4001;
  JoinRejected: 4002;
  Removed: 4003;
  Moved: 4004;
  Silent: 4100;
};

Defined in: protocol.ts:207

WebSocket close codes the room uses. The client does not reconnect after those from 4000 to 4099.

Type Declaration ​

NameTypeDefault valueDescriptionDefined in
Replaced40004000The same player opened a newer connection.protocol.ts:209
RoomFull40014001Every seat is taken.protocol.ts:211
JoinRejected40024002onJoin refused the player; the close reason carries why.protocol.ts:213
Removed40034003The player no longer has a seat: they left, or the room removed them. The close reason says which.protocol.ts:215
Moved40044004The room handed the player over to another room; the close reason is that room's id. The client reconnects there by itself.protocol.ts:220
Silent41004100A ticking room heard nothing on this connection for silentAfterMs, not even a keepalive, and took it for dead. A client that is there after all connects again: this code is outside those it gives up on.protocol.ts:226

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