Harden lobby/game ready flow for out-of-order joins and stale clicks
This commit is contained in:
@@ -60,7 +60,11 @@ internal sealed class GameLobbyReadyHandler : GameHandlerBase, IMessageHandler
|
||||
?? throw new GameException("LOBBY_NOT_FOUND");
|
||||
|
||||
if (lobby.Status != CustomLobbyStatus.Full)
|
||||
throw new GameException("LOBBY_NOT_FULL");
|
||||
{
|
||||
// Not an error for clients that click ready before final seat is filled.
|
||||
return ServerMessage.Reply("game.custom.lobby.ready.ack", message.Seq,
|
||||
new LobbyReadyResponse(LobbyId: lobby.Id, IsReady: false));
|
||||
}
|
||||
|
||||
var isHost = lobby.HostAccountId == accountId;
|
||||
var isGuest = lobby.GuestAccountId == accountId;
|
||||
|
||||
Reference in New Issue
Block a user