summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-08-18 00:40:27 -0300
committerJesusaves <cpntb1@ymail.com>2021-08-18 00:40:27 -0300
commit745b5dc8a8e6323137ef549327ed051dc0ce56cb (patch)
tree2038ea4cb94a3c1231dce4e6908d80da6008fbdb
parent19de8477075b1fc95bf5aa9afd4d0fb29ab0d912 (diff)
downloadserver-2.1.8.18.tar.gz
server-2.1.8.18.tar.bz2
server-2.1.8.18.tar.xz
server-2.1.8.18.zip
Sanitize packet (so it can send numbers) and send special code for outdated clientsv2.1.8.18
-rw-r--r--protocol.py2
-rwxr-xr-xserver.py2
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
diff --git a/server.py b/server.py
index e66b63a..42c1704 100755
--- a/server.py
+++ b/server.py
@@ -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")