fix(matchmaking): broadcast player list so queue avatars appear for all waiting players
CI/CD / CI - API (dotnet build + engine sim) (push) Successful in 1m18s
CI/CD / CI - Web (tsc + next build) (push) Successful in 1m12s
CI/CD / Deploy - local stack (db + server + web) (push) Successful in 3m32s

BroadcastQueueLocked now sends the full waiting-player list (name/avatar/level)
alongside the count. The client maps it onto mm.players so every queued player's
avatar shows in the 4-slot grid for all waiting users, not just the slot-0 viewer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-19 19:46:28 +03:30
parent 940e2af6d2
commit 4fb5a1776f
3 changed files with 18 additions and 8 deletions
+10 -4
View File
@@ -159,8 +159,9 @@ export class SignalrService implements OnlineService {
.configureLogging(signalR.LogLevel.Warning)
.build();
conn.on("matchmaking", (s: { phase: string; players: number; queuePosition: number | null }) =>
this.emitMM(s.phase, s.queuePosition ?? undefined, s.players));
conn.on("matchmaking", (s: { phase: string; players: number; queuePosition: number | null; queue?: Array<{ id: string; name: string; avatar: string; avatarImage?: string; level: number }> }) =>
this.emitMM(s.phase, s.queuePosition ?? undefined, s.players,
s.queue?.map(p => ({ id: p.id, displayName: p.name, avatar: p.avatar, avatarImage: p.avatarImage, level: p.level, rating: 0 }))));
conn.on("matchFound", () => {
this.emitMM("ready");
// Safety net: if the initial state never lands (dropped/raced), ask the
@@ -226,10 +227,15 @@ export class SignalrService implements OnlineService {
}
}
private emitMM(phase: string, queuePosition?: number, waiting?: number) {
private emitMM(
phase: string,
queuePosition?: number,
waiting?: number,
queuePlayers?: Array<{ id: string; displayName: string; avatar: string; avatarImage?: string; level: number; rating: number }>
) {
const state: MatchmakingState = {
phase: phase as MatchmakingState["phase"],
players: [],
players: queuePlayers ?? [],
elapsedMs: 0,
ranked: this.mmRanked,
stake: this.mmStake,