summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md3
-rw-r--r--consts.py4
-rw-r--r--protocol.py4
-rwxr-xr-xserver.py2
4 files changed, 9 insertions, 4 deletions
diff --git a/README.md b/README.md
index a486446..41575f9 100644
--- a/README.md
+++ b/README.md
@@ -43,6 +43,9 @@ update the relevant setting on server.py file.
Remember: Clients may attempt SSL connection if they can download certificate.pem!
+You should also set up the update server if you have not done so already.
+(It is a different repository).
+
# Running the server
Simply run server.py and vĂ³ila.
diff --git a/consts.py b/consts.py
index 5820039..02078ca 100644
--- a/consts.py
+++ b/consts.py
@@ -102,7 +102,7 @@ BL_UPDATETIME =30.0
BAN_TIME =180.0
BAN_UNAUTHED =5
BAN_AUTHED =30
-CLIENTVERSION ="2.1.8.8"
+CLIENTVERSION ="2.1.8.18"
MAX_CLIENTS =2500
# Hard coded loot (1,000~10,000)
@@ -126,7 +126,7 @@ TRIPLE_GP =6000
# Error Handler
ERR_ERR ="500 Internal Server Error" # Maybe 418 I am a teapot
-ERR_OFF ="401 Unauthorized"
+ERR_OFF =401
ERR_BAD ="400 Bad Request"
ERR_DONE ="200"
#"You cannot perform this operation! Not enough Crystals"
diff --git a/protocol.py b/protocol.py
index fe71290..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
@@ -72,7 +74,7 @@ def parse(packet, conn):
if not data[0].isalnum():
return [PACKET_NACK, "Invalid packet (TOKENF)"]
- # TODO: Now validate the token itself
+ # Now validate the token itself
if data[0] != conn.token:
return [PACKET_NACK, "Invalid packet (TOKENC)"]
diff --git a/server.py b/server.py
index 1a3a7cd..dca68fe 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")