From 2f73d4246c98d4b25d18d0faa987d9ed165a48ae Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sun, 25 Oct 2020 01:17:56 +0200 Subject: [PATCH] Minor fixes. --- new2/plomrogue/io.py | 2 +- new2/plomrogue/io_websocket.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/new2/plomrogue/io.py b/new2/plomrogue/io.py index 12e7450..d740f8c 100644 --- a/new2/plomrogue/io.py +++ b/new2/plomrogue/io.py @@ -14,7 +14,7 @@ class GameIO(): """Handle commands coming through queue q, run game, send results back.""" while True: try: - command, connection_id = q.get(timeout=1) + command, connection_id = q.get(timeout=0.001) self.handle_input(connection_id, command) except queue.Empty: self.game.run_tick() diff --git a/new2/plomrogue/io_websocket.py b/new2/plomrogue/io_websocket.py index 685ac4f..ea16597 100644 --- a/new2/plomrogue/io_websocket.py +++ b/new2/plomrogue/io_websocket.py @@ -12,6 +12,7 @@ class PlomWebSocket(WebSocket): for connection_id in self.server.clients: if self.server.clients[connection_id] == self: self.server.queue.put((connection_id, self.data)) + break def handleConnected(self): import uuid -- 2.30.2