From 3cbb519ccb06e796a2f557dc9426689feb4022fa Mon Sep 17 00:00:00 2001 From: a1batross Date: Wed, 7 Dec 2022 20:03:24 +0100 Subject: [PATCH] server_entry: save time when we sent challenge --- server_entry.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/server_entry.py b/server_entry.py index 78ac1a6..7a31dc0 100644 --- a/server_entry.py +++ b/server_entry.py @@ -18,7 +18,7 @@ class ServerEntry: region = 255 product = '' nat = 0 - + def setInfoString(self, data): infostring = data.replace('\n', '').replace('\r', '').replace('\0', '') split = infostring.split('\\') @@ -60,24 +60,25 @@ class ServerEntry: except IndexError: pass self.check = self.challenge == self.challenge2 + return self.check def __init__(self, addr, challenge): # Address self.addr = addr - # Shortcuts for generating query self.queryAddr = b'' for i in addr[0].split('.'): self.queryAddr += pack('!B', int(i)) self.queryAddr += pack('!H', int(addr[1])) - - # Random number that server must return + + # Random number that server must return self.challenge = challenge - + self.sentChallengeAt = time() + # This server is not checked # So it will not get into queries self.check = False - + # Remove server after this time. # This maybe not instant - self.die = time() + 600.0 + self.die = self.sentChallengeAt + 600