Desculpem pelo Lag. import randomimport socket, asyncore, asynchatimport thread, threadingimport timeimport typesimport reimport base64, binascii, hashlibimport loggingfrom array import arrayimport jsonimport sqlite3import os#import psutilfrom SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandlerlogging.basicConfig(filename='Logs/server.log',level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s") dbcon = sqlite3.connect("dbfile.sqlite")dbcon.isolation_level = Nonedbcur = dbcon.cursor()dbcon.row_factory = sqlite3.Rowdbcon2 = sqlite3.connect("dbfile.sqlite")dbcon2.isolation_level = Nonedbcur2 = dbcon2.cursor()dbcon2.row_factory = sqlite3.RowLANGUAGE = "EN"VERBOSE = FalseVERSION = "0.126"str_game_version = "0.126"str_server_version = "1.016"MJ = TrueLEVEL_LIST = range(0, 114+1) + [1006, 1007, 1015, 1027, 1040, 1062, 1067, 1087, 1088, 1092, 888]RADOMPS_LIST = range(5000, 200000)#101 to 107 are conjuration#108 and 109 are catch the cheese#110 to 114 are catch the cheese with shaman##1087 (Shaman only on nightmode)#1088 (Shaman only on nightmode)#1092 (Shaman only on nightmode)#888 Special Map, temporaryclass TransformiceServer(asyncore.dispatcher): def __init__(self, HOST='192.168.254.1', PORT=1111): self.HOST = HOST self.PORT = PORT asyncore.dispatcher.__init__(self) self.create_socket(socket.AF_INET, socket.SOCK_STREAM) # try to re-use a server port if possible self.set_reuse_addr() self.bind((self.HOST, self.PORT)) self.listen(5) logging.info("Running") print '################################# By ~ Seven ~ #################################' print '[~Mice Server V3~] Servidor Online' #self.clients = [] self.rooms = {} self.recruitTribe = "" def handle_accept(self): socket, addr = self.accept() TransformiceClientHandler(self, socket, addr) def authenticate(self, username, passwordHash): dbcur.execute('select * from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: name = rrf[0] password = rrf[1] privlevel = rrf[3] if passwordHash != password: return -1 else: return privlevel def setPlayerFur(self, name, fur): for room in self.rooms.values(): for playerCode, client in room.clients.items(): if client.privilegeLevel>=5: pass elif client.username == name.title(): if fur.lower().strip() == "normal": fur = "78583a" client.fur = fur def getPlayerID(self, username): if username.startswith("*"): return "1" else: dbcur.execute('select playerid from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getServerSetting(self, setting): dbcur.execute('select value from settings where setting = ?', [setting]) rrf = dbcur.fetchone() if rrf is None: return False else: return rrf[0] def getSavesCount(self, username): if username.startswith("*"): return 0 else: dbcur.execute('select saves from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getFurColor(self, username): try: dbcur.execute('select fur from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: if rrf[0] == "None": return '78583a' else: return rrf[0] except: return '78583a' def getShamanCheeseCount(self, username): if username.startswith("*"): return 0 else: dbcur.execute('select shamcheese from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getFirstCount(self, username): if username.startswith("*"): return 0 else: dbcur.execute('select first from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getCheeseCount(self, username): if username.startswith("*"): return 0 else: dbcur.execute('select cheese from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getRoundsCount(self, username): if username.startswith("*"): return 0 else: dbcur.execute('select rounds from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getTitleList(self, username): if username.startswith("*"): return "[]" else: dbcur.execute('select titlelist from users where name = ?', [username]) rrf = dbcur.fetchone() if rrf is None: return -1 else: return rrf[0] def getTribeRank(self, username): if username.startswith("*"): return ""