The ascension of the Madonna (the 15th of August is approaching)

This commit is contained in:
Giuseppe Guerra
2018-08-04 19:26:42 +02:00
parent 7f283d9aa2
commit cb2d1e74f7
8 changed files with 20 additions and 20 deletions

View File

@@ -17,7 +17,7 @@ class handler(requestsManager.asyncRequestHandler):
data = {"message": "unknown error"}
try:
# Get online users count
data["result"] = -1 if glob.restarting == True else 1
data["result"] = -1 if glob.restarting else 1
# Status code and message
statusCode = 200

View File

@@ -106,7 +106,7 @@ class handler(requestsManager.asyncRequestHandler):
packetData = requestData[pos:(pos+dataLength+7)]
# Console output if needed
if glob.outputPackets == True and packetID != 4:
if glob.outputPackets and packetID != 4:
log.debug("Incoming packet ({})({}):\n\nPacket code: {}\nPacket length: {}\nSingle packet data: {}\n".format(requestTokenString, userToken.username, str(packetID), str(dataLength), str(packetData)))
# Event handler
@@ -179,7 +179,7 @@ class handler(requestsManager.asyncRequestHandler):
# Process/ignore packet
if packetID != 4:
if packetID in eventHandler:
if userToken.restricted == False or (userToken.restricted == True and packetID in packetsRestricted):
if userToken.restricted == False or (userToken.restricted and packetID in packetsRestricted):
eventHandler[packetID]()
else:
log.warning("Ignored packet id from {} ({}) (user is restricted)".format(requestTokenString, packetID))