mirror of
https://github.com/tiennm99/noitu.git
synced 2026-10-15 00:17:51 +00:00
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:
1 parent
865222d2cd
commit
4a78b8aad5
7 files changed
+342
No files matched your search
@@ -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},
|
||||
}}
|
||||
}
|
||||
Reference in new issue
Block a user