NEXIS
Guides

Matchmaking

Queue players and react to match.found.

Matchmaking

Use matchmaking when players should be grouped into a room automatically.

Enqueue

await client.enqueueMatchmaking("counter_plugin_room", 2);

Dequeue

await client.dequeueMatchmaking();

Handle match.found

client.onMatchFound(async (match) => {
  await client.joinOrCreate(match.roomType, { roomId: match.room });
});

Ticket TTL and disconnect cleanup are handled server-side.

Matchmaking Queue

Typed Matchmaking API

async function (: ) {
  await .('counter_plugin_room', 2);
  .(() => {
    .(.);
  });
}

On this page