interface RoomInterface {
    gameId: undefined | number;
    gamePassword: undefined | string;
    closeRoom(): Promise<void>;
    createRoom(
        game: string,
        options: GameOptions,
    ): Promise<[number, undefined | string]>;
    join(gameId: number, password?: string): Promise<number>;
}

Implemented by

Properties

gameId: undefined | number

The ID of the current game room.

gamePassword: undefined | string

The password for the current game room, if applicable.

Methods

  • Creates a new game room.

    Parameters

    • game: string

      The id of the game.

    • options: GameOptions

      The options for the game room.

    Returns Promise<[number, undefined | string]>

    A promise that resolves to a tuple containing the game room ID and password.

  • Joins an existing game room.

    Parameters

    • gameId: number

      The ID of the game room to join.

    • Optionalpassword: string

      The password for the game room, if required.

    Returns Promise<number>

    A promise that resolves to the game room ID.