Skip to content

API Class Lobby

github-actions[bot] edited this page Dec 1, 2026 · 4 revisions

Class: Lobby

Defined in: src/engine/net/lobby/client.ts:545

Lobbies and matchmaking (ADR 0068), client side: static and page-wide, usable from any World. Menus poll its state.

Lobby.connect("ws://play.example.com:7777", { name: "Anne" });  // or "local"
Lobby.quickMatch({ arena: "bay" });
if (Lobby.state === "room") Lobby.setReady(true);

Accessors

error

Get Signature

get static error(): string;

Defined in: src/engine/net/lobby/client.ts:573

The last refusal or disconnect reason ("" for none).

Returns

string


matchLoading

Get Signature

get static matchLoading(): LoadProgress | null;

Defined in: src/engine/net/lobby/client.ts:601

While a match loads behind the menu (ADR 0616): how far it has come (progress 0..1, phase), for a loading bar. Non-null from the lobby starting the match until the match World takes the screen.

Returns

LoadProgress | null


matchWorld

Get Signature

get static matchWorld(): WorldHandle | null;

Defined in: src/engine/net/lobby/client.ts:593

The match client World while a match plays, else null.

Returns

WorldHandle | null


me

Get Signature

get static me(): LobbyMe | null;

Defined in: src/engine/net/lobby/client.ts:588

The player's slot and whether they host their room, or null outside a room.

Returns

LobbyMe | null


room

Get Signature

get static room(): LobbyRoom | null;

Defined in: src/engine/net/lobby/client.ts:583

The room the player is in (members, ready flags, host, settings, countdown), or null.

Returns

LobbyRoom | null


rooms

Get Signature

get static rooms(): readonly LobbyRoomInfo[];

Defined in: src/engine/net/lobby/client.ts:578

Public rooms: code, name, member count, settings.

Returns

readonly LobbyRoomInfo[]


state

Get Signature

get static state(): LobbyState;

Defined in: src/engine/net/lobby/client.ts:568

"offline" | "connecting" | "lobby" | "room" | "starting" | "match".

Returns

LobbyState

Methods

connect()

static connect(
   address, 
   profile, 
   options?
): void;

Defined in: src/engine/net/lobby/client.ts:559

Connect to a lobby server ("ws://host:7777"), or "local" to run the project's lobby World in this page. Returns at once.

Parameters

address

string

profile

LobbyProfile

options?

LobbyConnectOptions

Returns

void


createRoom()

static createRoom(options?): void;

Defined in: src/engine/net/lobby/client.ts:609

Parameters

options?
name?

string

public?

boolean

settings?

Readonly<Record<string, string>>

Returns

void


disconnect()

static disconnect(): void;

Defined in: src/engine/net/lobby/client.ts:563

Returns

void


host()

static host(world, options): void;

Defined in: src/engine/net/lobby/client.ts:552

Turn on the lobby service in a server World (as a World config's "lobby" does).

Parameters

world

WorldHandle

options

LobbyOptions

Returns

void


joinRoom()

static joinRoom(code): void;

Defined in: src/engine/net/lobby/client.ts:613

Parameters

code

string

Returns

void


kick()

static kick(slot): void;

Defined in: src/engine/net/lobby/client.ts:631

Host only.

Parameters

slot

number

Returns

void


leaveMatch()

static leaveMatch(): void;

Defined in: src/engine/net/lobby/client.ts:641

Leave the running match and go back to the room.

Returns

void


leaveRoom()

static leaveRoom(): void;

Defined in: src/engine/net/lobby/client.ts:617

Returns

void


quickMatch()

static quickMatch(settings?): void;

Defined in: src/engine/net/lobby/client.ts:605

Parameters

settings?

Readonly<Record<string, string>>

Returns

void


setReady()

static setReady(ready): void;

Defined in: src/engine/net/lobby/client.ts:621

Parameters

ready

boolean

Returns

void


setSetting()

static setSetting(key, value): void;

Defined in: src/engine/net/lobby/client.ts:626

Host only.

Parameters

key

string

value

string

Returns

void


start()

static start(): void;

Defined in: src/engine/net/lobby/client.ts:636

Host only: start once the room has minPlayers.

Returns

void

Clone this wiki locally