Fixed and working gckms!
This commit is contained in:
parent
c23a7ed0af
commit
da10458aa5
@ -45,17 +45,12 @@ def queryloop(querysock):
|
||||
b += b'\x00'
|
||||
print("Sending back", b)
|
||||
clientsocket.send(b)
|
||||
clientsocket.close()
|
||||
|
||||
def registerloop(registersock):
|
||||
while True:
|
||||
data, (ip, port) = registersock.recvfrom(1024)
|
||||
print("New register", data)
|
||||
print(ip, port)
|
||||
try:
|
||||
if data[0] == 49:
|
||||
gameport = data[1:].decode("ascii")
|
||||
print("Gameport %s" % gameport)
|
||||
if int(gameport):
|
||||
tempsocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
tempsocket.settimeout(5)
|
||||
@ -70,9 +65,7 @@ def registerloop(registersock):
|
||||
print("Keepalive from: %s:%s" % (ip, gameport))
|
||||
tempsocket.close()
|
||||
else:
|
||||
print("Fuck it, wasn't int: ", gameport)
|
||||
else:
|
||||
print('data[0]: ', data[0])
|
||||
print("Fuck it, wasn't int: ", data)
|
||||
except Exception as e:
|
||||
print("Exception")
|
||||
traceback.print_exc()
|
||||
@ -82,7 +75,7 @@ def cleanloop():
|
||||
now = datetime.datetime.now()
|
||||
for server in SERVERS:
|
||||
if now > server["last"] + datetime.timedelta(minutes=2):
|
||||
if server["ip"] == "163.158.182.243" or server["ip"] == "206.55.174.10":
|
||||
if server["ip"] == "163.158.182.243" or server["ip"] == "73.181.147.35":
|
||||
# do not remove usual dedicated servers
|
||||
continue
|
||||
print("Deleting %s:%s" % (server["ip"], server["port"]))
|
||||
|
Loading…
Reference in New Issue
Block a user