Archived
Prevent crash when clients disconnects
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user