diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-08-18 00:40:27 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-08-18 00:40:27 -0300 |
commit | 745b5dc8a8e6323137ef549327ed051dc0ce56cb (patch) | |
tree | 2038ea4cb94a3c1231dce4e6908d80da6008fbdb | |
parent | 19de8477075b1fc95bf5aa9afd4d0fb29ab0d912 (diff) | |
download | server-745b5dc8a8e6323137ef549327ed051dc0ce56cb.tar.gz server-745b5dc8a8e6323137ef549327ed051dc0ce56cb.tar.bz2 server-745b5dc8a8e6323137ef549327ed051dc0ce56cb.tar.xz server-745b5dc8a8e6323137ef549327ed051dc0ce56cb.zip |
Sanitize packet (so it can send numbers) and send special code for outdated clientsv2.1.8.18
-rw-r--r-- | protocol.py | 2 | ||||
-rwxr-xr-x | server.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/protocol.py b/protocol.py index fa9597a..98cebdb 100644 --- a/protocol.py +++ b/protocol.py @@ -54,6 +54,8 @@ def parse(packet, conn): r=player.get_data(data[2], t) if r is ERR_BAD: return [PACKET_NACK, "Login error"] + elif type(r) is int: + return [PACKET_ACK, r] # FIXME: Lie? else: conn.userid=int(utils.Player[conn.token]["userid"]) conn.MS_auth=True @@ -62,7 +62,7 @@ class WebSocketConn(WebSocket): self.send_message("NACK\n") security.score(self, security.get_score(r[0])) else: - self.send_message(r[1]) + self.send_message(str(r[1])) except: traceback.print_exc() self.send_message("ERROR\n") |