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
+2 -1
View File
@@ -34,7 +34,8 @@ public record GameStateDto(
bool Ranked,
int Stake);
public record MatchmakingStateDto(string Phase, int Players, int? QueuePosition);
public record QueuePlayerDto(string Id, string Name, string Avatar, string? AvatarImage, int Level);
public record MatchmakingStateDto(string Phase, int Players, int? QueuePosition, QueuePlayerDto[]? Queue = null);
public record ReactionDto(int Seat, string Reaction);
public static class Map
+6 -3
View File
@@ -88,13 +88,16 @@ public sealed partial class GameManager
}
}
/// <summary>Push the current queue size to every waiting player (call inside _mmLock).</summary>
/// <summary>Push the current queue size + player list to every waiting player (call inside _mmLock).</summary>
private void BroadcastQueueLocked()
{
int n = _waiting.Count;
var queue = _waiting
.Select(w => new QueuePlayerDto(w.player.UserId, w.player.Name, w.player.Avatar, w.player.AvatarImage, w.player.Level))
.ToArray();
int n = queue.Length;
foreach (var w in _waiting)
_ = _hub.Clients.User(w.player.UserId).SendAsync("matchmaking",
new MatchmakingStateDto("searching", n, null));
new MatchmakingStateDto("searching", n, null, queue));
}
/// <summary>Client safety net: re-send the current game state to a player who