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