5
ModuleServerAPIGameLibRoom
Mees van der Wijk edited this page 2025-08-23 15:44:46 +02:00

ModuleClientApi - GameLib Room

Class representing the GameLib Room inside the ModuleServerAPI.

Methods

newGame

Create a new game.

Room.newGame(gameDetails);
Argument Type Description
gameDetails GameDetails The details of the game.

Return Game Game instance.

clearQueue

Clear the queue.

Room.clearQueue();

getQueueLength

Get the amount of players in the waiting queue.

Room.getQueueLength();

Return number Players in the queue.

Events

on: playerJoinQueue

Triggers when a player join the queue.

Room.on('playerJoinQueue', (player) => {});
Argument Type Description
player GamePlayer The player that joined the queue.

on: playerLeaveQueue

Triggers when a player leaves the queue.

Room.on('playerLeaveQueue', (player) => {});
Argument Type Description
player GamePlayer The player that left the queue.

on: queueUpdate

Triggers when the queue updates.

Room.on('queueUpdate', (players) => {});
Argument Type Description
players GamePlayer[] The players in the queue.

on: activeGameChanged

Triggers when the active game changes.

Room.on('activeGameChanged', (gameDetails) => {});
Argument Type Description
gameDetails GameDetails The details of the new active game.

on: mainScoreboardUpdate

Triggers when the main scoreboard of the active game updates.

Room.on('mainScoreboardUpdate', (state) => {});
Argument Type Description
state ScoreboardState The current state of the scoreboard.

on: anyScoreboardUpdate

Triggers when any scoreboard of the active game updates.

Room.on('anyScoreboardUpdates', (state) => {});
Argument Type Description
state ScoreboardState The current state of the scoreboard.