Skip to content

Commit

Permalink
Fix(server): TTTK-87 TTTK-88 Fixed Race Condition in Server Join with AI
Browse files Browse the repository at this point in the history
  • Loading branch information
Petzys committed Mar 20, 2024
1 parent 139c058 commit 9cc82f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Server/websocket_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ async def handler(self, websocket):
"players": [player.as_dict() for player in self._players.values()],
}))

if all([player.ready for player in self._players.values()]) and len(self._connections) == 2:
if all([player.ready for player in self._players.values()]) and len(self._connections) == 2 and len(self._players) >= 2:
# TODO add error messages for why game cant start with not enough or too many ready players
# all players are ready, start the game
rulebase = RuleBase()
Expand Down

0 comments on commit 9cc82f8

Please sign in to comment.