summaryrefslogtreecommitdiff
path: root/player.py
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-12-21 12:17:17 -0300
committerJesusaves <cpntb1@ymail.com>2020-12-21 12:17:17 -0300
commit08587596d01dd1456f9000258d01878a7c3780d0 (patch)
tree22fb80255cb02fb4f67c1c1df2758476b9673a36 /player.py
parentaa59cb6d6c1ae1d0d9bbe2ee8039e35645a07bb8 (diff)
downloadserver-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 'player.py')
-rw-r--r--player.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/player.py b/player.py
index fea3b16..74b7e23 100644
--- a/player.py
+++ b/player.py
@@ -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))