diff options
-rw-r--r-- | player.py | 8 | ||||
-rwxr-xr-x | server.py | 9 |
2 files changed, 15 insertions, 2 deletions
@@ -176,6 +176,13 @@ def clear(token, mask=SQL_CLEAR): # This function saves and clears a token ######################################### try: + stdout("Saving user ID %d" % Player[token]["userid"]) + except: + stdout("ERROR: Token \"%s\" is not valid." % token) + return + + ######################################### + try: # Save inventory data to SQL sql.save_inv(token, mask) @@ -404,6 +411,7 @@ def get_data(args, token): # If they are, cause a disconnection on old one and update tokens try: org_usr=cli_search(target_uid["userid"]) + stdout("Cli Search Result: %r" % repr(org_user)) tk="0" if org_usr not in ["ERROR"]: stdout("Closing duplicate login from %s (token %s)" % (org_user.address[0], org_user.token)) @@ -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: |