Fix 3+ player custom lobby state/ready sync

This commit is contained in:
Shard
2026-03-27 00:47:48 +00:00
parent 4737d337fa
commit 32aa8165bb
6 changed files with 96 additions and 47 deletions
+16 -4
View File
@@ -133,7 +133,7 @@ public sealed record JoinCustomLobbyRequest(Guid LobbyId, Guid DeckId, string? P
/// <summary>
/// Serialized JSON entry in CustomLobby.AdditionalPlayersJson and GameSession.AdditionalPlayersJson.
/// </summary>
public sealed record AdditionalLobbyPlayer(Guid AccountId, Guid DeckId);
public sealed record AdditionalLobbyPlayer(Guid AccountId, Guid DeckId, bool IsReady = false);
/// <summary>Leave or cancel a custom lobby.</summary>
public sealed record LeaveCustomLobbyRequest(Guid LobbyId);
@@ -262,7 +262,8 @@ public sealed record JoinCustomLobbyResponse(
int MaxPlayers,
string GameMode,
int TeamCount,
bool IsAdditionalPlayer = false); // true for 3rd+ players (not host or first guest)
bool IsAdditionalPlayer = false, // true for 3rd+ players (not host or first guest)
IEnumerable<AdditionalLobbyPlayerViewDto>? AdditionalPlayers = null);
public sealed record LeaveCustomLobbyResponse(Guid LobbyId);
@@ -393,7 +394,8 @@ public sealed record CustomLobbyGuestJoinedPush(
Guid LobbyId,
Guid GuestAccountId,
string GuestDisplayName,
string LobbyName);
string LobbyName,
IEnumerable<AdditionalLobbyPlayerViewDto>? AdditionalPlayers = null);
/// <summary>
/// Pushed to the non-proposing participant when the host proposes loading a preset.
@@ -414,7 +416,11 @@ public sealed record LobbyUpdatedPush(Guid LobbyId, CustomRulesDto NewRules);
public sealed record PresetVoteRejectedPush(Guid LobbyId, Guid PresetId);
/// <summary>Pushed to both participants whenever a lobby participant's ready status changes.</summary>
public sealed record LobbyReadyStatusPush(Guid LobbyId, bool HostReady, bool GuestReady);
public sealed record LobbyReadyStatusPush(
Guid LobbyId,
bool HostReady,
bool GuestReady,
IEnumerable<AdditionalLobbyPlayerViewDto>? AdditionalPlayers = null);
/// <summary>Pushed to both participants when a lobby participant changes their selected deck.</summary>
public sealed record LobbyDeckChangedPush(Guid LobbyId, Guid AccountId, Guid DeckId);
@@ -621,6 +627,12 @@ public sealed record TileDto(
/// <summary>Client-facing 2D coordinate.</summary>
public sealed record CoordDto(int X, int Y);
/// <summary>Client-facing additional (3rd+) custom-lobby participant.</summary>
public sealed record AdditionalLobbyPlayerViewDto(
Guid AccountId,
string DisplayName,
bool IsReady);
public sealed record CustomLobbyDto(
Guid LobbyId,
string LobbyName,