def get_players(self, old_players=None): try: buf = self.sock.recv(4096) self.frames_missed_in_row = 0 return self.parse_server(buf, old_players) except timeout: self.frames_missed_in_row += 1 if self.frames_missed_in_row > 3.0 / self.sock.gettimeout(): print settings.color("Connection lost!", "RED") exit() if settings.DEBUG or DEBUG_SERVER: print "get_players: connection timed out" return None
def get_players(self): try: buf = self.sock.recv(4096) self.frames_missed_in_row = 0 return self.parse_server(buf) except timeout: self.frames_missed_in_row += 1 if self.frames_missed_in_row > 3.0 / self.sock.gettimeout(): print settings.color("Connection lost!", "RED") exit() if settings.DEBUG or DEBUG_SERVER: print "get_players: connection timed out" return None
def __init__(self, function, msg='Done', values=None): self.value = settings.color("[!] " + msg, "YELLOW") self.function = function self.return_values = values