Matchmaking

Test matchmaking queues, match detection, and game room creation

Join Matchmaking Queue

Opens a mm_join op with queue name and min/max params.

If enough players are in the queue, the server atomically pops them and creates a game room.

Match Result
No match results yet. Join a queue to start matchmaking.
How Matchmaking Works

1. Client sends mm_join with queue name and params: {min, max}.

2. Server LPUSHes candidate into Redis list sock:mm:{org}:{app}:{queue}.

3. A Lua script atomically pops min..max members when threshold is reached (no double-match across nodes).

4. On match: server creates a room with random name, stores one-time subscribe grants, sends mm_matchedto each member's user channel.

5. Members must subscribe to the room within deadline_ms (default 10s) or the match is voided and they get mm_requeued.

6. During gameplay: if a member times out/disconnects, server sends member_lost. If members drop below min, room closes and survivors requeue.

Matchmaking Events
0 messages