home · contact · privacy
Minor code rearrangements.
[plomrogue2-experiments] / server_ / io.py
index e015b4f6f5cc14cbaeabc398223bf9c0ee7da7aa..95e7d7782f7eecf4ab318d330853cb2285881652 100644 (file)
@@ -31,9 +31,10 @@ class IO_Handler(socketserver.BaseRequestHandler):
         from the game IO loop via that new queue.
 
         At the same time, loops over socket's recv to get messages
         from the game IO loop via that new queue.
 
         At the same time, loops over socket's recv to get messages
-        from the outside via self.server.queue_out into the game IO
-        loop. Ends connection once a 'QUIT' message is received from
-        socket, and then also calls for a kill of its own queue.
+        from the outside into the game IO loop by way of
+        self.server.queue_out into the game IO. Ends connection once a
+        'QUIT' message is received from socket, and then also calls
+        for a kill of its own queue.
 
         All messages to the game IO loop are tuples, with the first
         element a meta command ('ADD_QUEUE' for queue creation,
 
         All messages to the game IO loop are tuples, with the first
         element a meta command ('ADD_QUEUE' for queue creation,
@@ -110,10 +111,10 @@ def io_loop(q, game_command_handler):
         content = None if len(x) == 2 else x[2]
         if command_type == 'ADD_QUEUE':
             game_command_handler.queues_out[connection_id] = content
         content = None if len(x) == 2 else x[2]
         if command_type == 'ADD_QUEUE':
             game_command_handler.queues_out[connection_id] = content
-        elif command_type == 'COMMAND':
-            game_command_handler.handle_input(content, connection_id)
         elif command_type == 'KILL_QUEUE':
             del game_command_handler.queues_out[connection_id]
         elif command_type == 'KILL_QUEUE':
             del game_command_handler.queues_out[connection_id]
+        elif command_type == 'COMMAND':
+            game_command_handler.handle_input(content, connection_id)
 
 
 def run_server_with_io_loop(command_handler):
 
 
 def run_server_with_io_loop(command_handler):