Prevent crash when clients disconnects

This commit is contained in:
2024-04-05 19:35:40 +02:00
parent 5335fe21f8
commit 591098bec3
+1
View File
@@ -24,6 +24,7 @@ class GameController(GameControllerInterface):
client = ClientController(self, websocket)
self.clients.append(client)
await asyncio.gather(client.listen(), callback())
self.clients.remove(client)
async def send(self, message: Message, websocket: WebSocketServerProtocol):
await websocket.send(message.model_dump_json())