feat(server): pair strangers with quick-match

The hub keeps a FIFO of waiting sessions; a second QuickMatch pops the
first, opens a room via the existing createInput/joinInput path, and
marks it to begin its own first game once both seats are connected in
the lobby. CancelQuickMatch, a dropped connection, and entering a room
by code all remove a session from the queue. Counts queued, cancelled
and matched pairings in metrics.
This commit is contained in:
tiennm99 committed 2026-09-21 01:39:44 +07:00
1 parent 865222d2cd
commit 4a78b8aad5
7 files changed
+342

No files matched your search

+6
View File
@@ -79,3 +79,9 @@ func pongMsg(clientTimeMs, serverTimeMs int64) *noituv1.ServerMessage {
Pong: &noituv1.Pong{ClientTimeMs: clientTimeMs, ServerTimeMs: serverTimeMs},
}}
}
func quickMatchStatusMsg(queued bool) *noituv1.ServerMessage {
return &noituv1.ServerMessage{Payload: &noituv1.ServerMessage_QuickMatchStatus{
QuickMatchStatus: &noituv1.QuickMatchStatus{Queued: queued},
}}
}