diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-12-21 12:17:17 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-12-21 12:17:17 -0300 |
commit | 08587596d01dd1456f9000258d01878a7c3780d0 (patch) | |
tree | 22fb80255cb02fb4f67c1c1df2758476b9673a36 /server.py | |
parent | aa59cb6d6c1ae1d0d9bbe2ee8039e35645a07bb8 (diff) | |
download | server-08587596d01dd1456f9000258d01878a7c3780d0.tar.gz server-08587596d01dd1456f9000258d01878a7c3780d0.tar.bz2 server-08587596d01dd1456f9000258d01878a7c3780d0.tar.xz server-08587596d01dd1456f9000258d01878a7c3780d0.zip |
Abrupt loss of connection will now save the player data and destroy the old token.
Or at least, it will try to.
Diffstat (limited to 'server.py')
-rwxr-xr-x | server.py | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -10,7 +10,7 @@ from websock import WebSocketServer, WebSocket ## Local Modules from utils import stdout, now, clients, debug from consts import MAX_CLIENTS, PACKET_ACK -import protocol, security, traceback +import protocol, security, player, traceback ############################################################### # Configuration @@ -100,7 +100,12 @@ class WebSocketConn(WebSocket): #for client in clients: # client.send_message(self.address[0] + u' - disconnected') stdout(self.address[0] + u' - disconnected') - # TODO: if self.token != "0": try: player.clear(self.token) + if self.token != "0": + try: + player.clear(self.token) + except: + traceback.print_exc() + stdout("Error at player.clear") ########################## # Useful functions: |