summaryrefslogtreecommitdiff
path: root/protocol.py
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-12-21 10:15:59 -0300
committerJesusaves <cpntb1@ymail.com>2020-12-21 10:15:59 -0300
commit052e316029930ab3821de39bba4d90b6aed3634f (patch)
treec5899030cb23a086482e3569e40bf10a9c4966a9 /protocol.py
parent86dffb5ec7b88c041eea1494ec15762fabd5695f (diff)
downloadserver-052e316029930ab3821de39bba4d90b6aed3634f.tar.gz
server-052e316029930ab3821de39bba4d90b6aed3634f.tar.bz2
server-052e316029930ab3821de39bba4d90b6aed3634f.tar.xz
server-052e316029930ab3821de39bba4d90b6aed3634f.zip
Improve token logic internally.
Hopefully this will detect when same userid is logged in twice and dc the older login. May suffer of race condition.
Diffstat (limited to 'protocol.py')
-rw-r--r--protocol.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/protocol.py b/protocol.py
index f7c17e7..25633ee 100644
--- a/protocol.py
+++ b/protocol.py
@@ -54,6 +54,8 @@ def parse(packet, conn):
if r is ERR_BAD:
return [PACKET_NACK, "Login error"]
else:
+ conn.userid=int(utils.Player[conn.token]["userid"])
+ utils.stdout("Login successful for UID %d" % conn.userid)
return [PACKET_ACK, r]
elif data[1] == "register":
r=player.register(data[2], t)