laneya

multiplayer roguelike game
git clone https://git.ce9e.org/laneya.git

commit
13de1c64f519b551fa64a1807a83d0dbc2390ce4
parent
d996503a9e4ac379b2bafec2019bacba13358e15
Author
Tobias Bengfort <tobias.bengfort@gmx.net>
Date
2014-10-18 08:51
fix quit on client

Diffstat

M laneya/client.py 11 ++++++++---

1 files changed, 8 insertions, 3 deletions


diff --git a/laneya/client.py b/laneya/client.py

@@ -37,8 +37,7 @@ class Client(protocol.ClientProtocolFactory):
   37    37                 self.move('west' if event['type'] == 'keydown' else 'stop')
   38    38             elif event['key'] == ord('q'):
   39    39                 self.send_request('logout')
   40    -1                 screen.cleanup()
   41    -1                 self.loop.close()
   -1    40                 raise KeyboardInterrupt
   42    41 
   43    42 
   44    43 def main():
@@ -52,7 +51,13 @@ def main():
   52    51     mainloop = protocol.LoopingCall(loop, client.mainloop)
   53    52     mainloop.start(0.02)
   54    53 
   55    -1     loop.run_forever()
   -1    54     try:
   -1    55         loop.run_forever()
   -1    56     except KeyboardInterrupt:
   -1    57         pass
   -1    58     finally:
   -1    59         screen.cleanup()
   -1    60         loop.close()
   56    61 
   57    62 
   58    63 if __name__ == '__main__':  # pragma: nocover