diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-12-21 10:15:59 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-12-21 10:15:59 -0300 |
commit | 052e316029930ab3821de39bba4d90b6aed3634f (patch) | |
tree | c5899030cb23a086482e3569e40bf10a9c4966a9 /protocol.py | |
parent | 86dffb5ec7b88c041eea1494ec15762fabd5695f (diff) | |
download | server-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.py | 2 |
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) |