If a game is in progress, a player can't join it anyway and spam-joining
to see if a spot becomes available is useless. So the GameFull error is
more important than the GameStarted error, therefore reorder them.
Closes: #518
}
}
- // Check if;
- // - The player is already in this game.
- // - The game is full.
- if (player?.Game != this && _players.Count >= Options.MaxPlayers)
- {
- return GameJoinResult.FromError(GameJoinError.GameFull);
- }
-
if (GameState == GameStates.Starting || GameState == GameStates.Started)
{
return GameJoinResult.FromError(GameJoinError.GameStarted);
return GameJoinResult.FromError(GameJoinError.GameDestroyed);
}
+ // Check if;
+ // - The player is already in this game.
+ // - The game is full.
+ if (player?.Game != this && _players.Count >= Options.MaxPlayers)
+ {
+ return GameJoinResult.FromError(GameJoinError.GameFull);
+ }
+
var isNew = false;
if (player == null || player.Game != this)