True usedram=psutil.avail_phymem() totalram=psutil.TOTAL_PHYMEM usedram = usedram / 1048576 usedram = '%.1f' % usedram totalram = totalram / 1048576 totalram = '%.1f' % totalram self.sendData("\x05", [ "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "\x00\x04", str(usedram)+"/"+str(totalram), "* - 0.126", str(self.server.getConnectedPlayerCount()), "\x00\x06", str(random.randrange(0, 10))]) #logging.warning("BUFFER: %s" % self.buffer) if self.validatingVersion: if self.buffer == "": dbcur.execute('select * from ippermaban where ip = ?', [self.address[0]]) rrf = dbcur.fetchone() if rrf is None: pass else: self.close() if VERBOSE: logging.debug("Policy file request") self.push(r"""""" % (self.server.PORT) + "\x00") self.close_when_done() else: #version, bytesLoaded1, bytesLoaded2 = self.buffer.split("\x01") version = self.buffer if self.isinit: #self.sendData("\x1A" + "\x16",["Q1dTCikUAAB4nKVXW3Pbxh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RZW7xhWbxhWHpa7d5C7f7z5O+SOtwXOSVMk2eu3Y3lN5tsUnJ73eYKh38Hpz3Z8pQVlIe9DVe8Zs1lU0lX/WSmjfKQsVQWHuFcNuGvLVexS96vB0oPpyuaKHdDq1NsYB8k7U/w2G0NKGKAXTi5ygQ4Od3DBkxXk5F2ZOVO6SNalQiQH4Xp5FAz1QrQb3M5aDI7RvbnmAbnPA1dz8kyiXMknlfJSaV0qPZRKG1LpkVTi4fmUu+78qkz9fv+I2xpa/0jjF/+Rcg9g6T8g+fg0"]) self.isinit = False if version == VERSION: self.sendCorrectVersion() else: self.close_when_done() self.validatingVersion = False else: if re.match("http://", self.buffer): self.buffer="" #elif self.buffer=="\x04": # self.buffer=="" #elif self.buffer=="\x05": # self.buffer=="" else: self.parseData(self.buffer) self.buffer = "" def startRestart(self, time): self.timer1 = threading.Timer(1, self.restartMin2) self.timer1.start() #self.sendServerMessage("Server is restarting in 5...") def restartMin2(self): try: self.timer1.cancel() except: pass self.sendRestartMessage("O servidor ira reiniciar em 2 minutos") self.timer1 = threading.Timer(60, self.restartMin1) self.timer1.start() def restartMin1(self): try: self.timer1.cancel() except: pass self.sendRestartMessage("O servidor ira reiniciar em 1 minuto") self.timer1 = threading.Timer(30, self.restartMin30) self.timer1.start() def restartMin30(self): try: self.timer1.cancel() except: pass self.sendRestartMessage("O servidor ira reiniciar em 30 segundos") self.timer1 = threading.Timer(15, self.restartMin15) self.timer1.start() def restartMin15(self): try: self.timer1.cancel() except: pass self.sendRestartMessage("O servidor ira reinicar em 15 segundos") self.timer1 = threading.Timer(5, self.restart10) self.timer1.start() def restart10(self): try: self.timer1.cancel() except: pass self.sendRestartMessage("O servidor ira reiniciar em 10 segundos") self.timer1 = threading.Timer(1, self.restart9) self.timer1.start() def restart9(self): try: self.timer1.cancel() except: pass self.sendRestartMessage("O servidor ira reinicar em in 9 segundos") self.timer1 = threading.Timer(1, self.restart8) self.timer1.start() def restart8(self): try: self.timer1.cancel() except: pass self.sendRestartMessage("O servidor ira reinicar em 8 segundos") self.timer1 = threading.Timer(1, self.restart7) self.timer1.start() def restart7(self): try: self.timer1.cancel() except: pass self.sendRestartMessage("O servidor ira reinicar em 7 segundos") self.timer1 = threading.Timer(1, self.restart6) self.timer1.start() def restart6(self): try: self.timer1.cancel() except: pass self.sendRestartMessage("O servidor ira reinicar em 6 segundos") self.timer1 = threading.Timer(1, self.restart5) self.timer1.start() def restart5(self): try: self.timer1.cancel() except: pass self.sendRestartMessage("O servidor ira reinicar em 5 segundos")