From 9cc82f8dd5269f782e4921126dfd9fff004b0457 Mon Sep 17 00:00:00 2001 From: Petzys <87223648+Petzys@users.noreply.github.com> Date: Wed, 20 Mar 2024 12:07:54 +0100 Subject: [PATCH] Fix(server): TTTK-87 TTTK-88 Fixed Race Condition in Server Join with AI --- Server/websocket_server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server/websocket_server.py b/Server/websocket_server.py index 398334b..32394f1 100644 --- a/Server/websocket_server.py +++ b/Server/websocket_server.py @@ -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()