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
| Name | Type | Default value | Description | Defined in |
|---|---|---|---|---|
Replaced | 4000 | 4000 | The same player opened a newer connection. | protocol.ts:209 |
RoomFull | 4001 | 4001 | Every seat is taken. | protocol.ts:211 |
JoinRejected | 4002 | 4002 | onJoin refused the player; the close reason carries why. | protocol.ts:213 |
Removed | 4003 | 4003 | The player no longer has a seat: they left, or the room removed them. The close reason says which. | protocol.ts:215 |
Moved | 4004 | 4004 | The 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 |
Silent | 4100 | 4100 | A 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 |