home · contact · privacy
Minor fixes.
authorChristian Heller <c.heller@plomlompom.de>
Sat, 24 Oct 2020 23:17:56 +0000 (01:17 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sat, 24 Oct 2020 23:17:56 +0000 (01:17 +0200)
new2/plomrogue/io.py
new2/plomrogue/io_websocket.py

index 12e74500eff1b7582d2a6a81601696e8076d4833..d740f8c42972879e9f911d21ba5edf5e6d9c1e84 100644 (file)
@@ -14,7 +14,7 @@ class GameIO():
         """Handle commands coming through queue q, run game, send results back."""
         while True:
             try:
         """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()
                 self.handle_input(connection_id, command)
             except queue.Empty:
                 self.game.run_tick()
index 685ac4f8da0a59f2151349b097991cbd5ded9037..ea1659711d5d5fbe45e074de6eeaf11d9a65c67b 100644 (file)
@@ -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))
             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
     
     def handleConnected(self):
         import uuid