GameRoomsOptions beta
Interface of @v12-engine/engine/server
export interface GameRoomsOptionsWhat GameRooms is started with: the shared port, the rooms, the kinds players may make and matchmaking
Members
compress
compress?: boolean;Whether to compress what goes over connections whose other end can take it; as SocketServerOptions.compress
emptyFor
emptyFor?: number;Seconds a made room may stay empty before it is closed: 60 when left out. A room nobody came to counts from when it was made
http
http?: ServerHttpOptions;The health and numbers addresses, for all of them: the numbers of each by its room
idleTimeout
idleTimeout?: number;Seconds a connection may be silent before it is closed; as SocketServerOptions.idleTimeout
joinWithin
joinWithin?: number;Seconds a connection to the queue has to say what it waits for (queue) before it is closed. 10 when left out; a room's own connections have their room's (GameServerOptions.joinWithin)
kinds
kinds?: Record<string, RoomKind>;What players may make rooms of, by id (POST /games with { kind, settings }, a "New game"): each room made is named after its kind and closed once nobody has been in it for emptyFor. None when left out
log
log?: ServerLog;Where they all say what they do, each line with its room
matchmaking
matchmaking?: boolean | {
path?: string;
};Matchmaking (features-plan H3): players wait in a queue for a kind (kinds), at the address queue (ws://host:8787/queue, { type: 'queue', kind, name }); once as many wait as its seats for players, it makes a room of the kind, which lets in only them, and hands each a ticket to it ({ type: 'matched', room, ticket }). On where there are kinds, unless false; path for another address
maxBuffered
maxBuffered?: number;Bytes that may wait unsent on a connection before it is closed; as SocketServerOptions.maxBuffered
maxConnections
maxConnections?: number;Connections open at once to all the rooms and the queue, at most (SocketServerOptions.maxConnections). 1024 when left out
maxMade
maxMade?: number;How many rooms players may have made at once, those matchmaking made with them: 16 when left out
port
port?: number;The port they share: 8787 when left out, 0 for any free one
ratings
ratings?: GameServerOptions['ratings'];Where ratings are kept, for every room's players (GameServerOptions.ratings), where a room says none of its own
rooms
rooms: Record<string, RoomOptions>;The rooms, by name: each a game server of its own (a lobby and its games), reached at its name (ws://host:8787/arena). A name is letters, digits, - and _. They are there for as long as the process is