"Seven", "47,0,2,0,0", "200", "200", "0", "0"]) self.sendData("\x15" + "\x15", ["-4", "Xbrasilx", "47,6,0,6,0", "600", "200", "1", "0"]) self.sendData("\x15" + "\x15", ["-5", "Livia", "35,0,1,0,0", "700", "200", "0", "0"]) #(801) [c] Kingboo: 'snpc jawster 1,5,0,3,0 400 350' #if rotation == "left": #rotation = "0" #elif rotation == "right": #rotation = "1" try: self.notCustom.stop() except: if self.room.isTesting: pass else: self.notCustom = threading.Timer(5, self.endCustom) self.notCustom.start() def endCustom(self): self.room.isCustom = False def login(self, username, passwordHash, startRoom): if username == "": username = "Souris" if username == "S": self.sendData("\x1A" + "\x12",["0", "Ah, test is pro ^^s"]) if passwordHash == "": if len(username)>=9: priv = -1 self.close() else: username = "*"+username priv = 0 username = self.server.checkAlreadyExistingGuest(username) else: username=username.lower() username=username.capitalize() priv = self.server.authenticate(username, passwordHash) if priv != 0: username=username.lower() username=username.capitalize() dbcur.execute('select * from userpermaban where name = ?', [username]) rrf = dbcur.fetchone() print rrf if rrf is None: pass else: print '-1' priv = -1 print "["+self.address[0]+" - "+username+"] Permabanned user tried to logon." self.sendPermaBan() #self.room.informAll(TransformiceClientHandler.sendPlayerDisconnect, [self.playerCode]) #self.room.removeClient(self) self.close() if priv == -1: #return False #self.close() self.sendData("\x1A" + "\x03", ["\x00"+"6"]) self.wrongPasswordAttempts+=1 if self.wrongPasswordAttempts>=4: self.sendData("\x1A" + "\x12",["0", "Too many incorrect password attempts"]) logging.info("Kick - Too many wrong passwords - %s" % self.address[0]) self.close() else: alreadyconnect = self.server.checkAlreadyConnectedAccount(username) if alreadyconnect == True: self.sendData("\x1A" + "\x03", ["\x01"]) else: self.username = username self.playerCode = self.server.generatePlayerCode() self.privilegeLevel = priv self.titleNumber = self.server.getCurrentTitle(username) self.roundCount = self.server.getRoundsCount(username) self.tribe = self.server.getTribeName(username) self.tribeName = self.server.getTribeName(username) self.tribeGreeting = self.server.getTribeGreeting(self.tribeName) self.tribeSettings = self.server.getTribeSettings(self.tribeName) self.tribeRank = self.server.getTribeRank(username) isDrawer = self.server.getDrawer(username) if str(isDrawer) == "1": self.isDrawer = True else: self.isDrawer = False if self.tribeName == "": pass else: self.sendData("\x10" + "\x12", ["2", self.tribeName, "0", self.tribeGreeting, self.tribeSettings, self.tribeRank]) self.micesaves = self.server.getSavesCount(username) self.shamancheese = self.server.getShamanCheeseCount(username) self.firstcount = self.server.getFirstCount(username) self.cheesecount = self.server.getCheeseCount(username) self.shopcheese = self.server.getShopCheese(username) self.titleList = self.server.getTitleList(username) self.shopitems = self.server.getUserShop(username) self.look = self.server.getUserLook(username) self.fur = self.server.getFurColor(username) self.titleList = self.titleList.strip('[]') self.titleList = self.titleList.replace("\"","") self.titleList = self.titleList.replace(","," ") self.titleList = str(self.titleList) self.titleList = self.titleList.split(" ") print self.username print self.titleList self.sendTitleList() self.giftCount = 0 #self.sendTribeGreeting() # [Version] Game: 0.129Server: 1.012 self.sendPlayerLoginData() if passwordHash == "": logging.info("Authenticate %s - %s - Guest" % (self.address, username)) else: logging.info("Authenticate %s - %s" % (self.address, username)) print '%s has logged in!' % (self.username) if startRoom!="": self.enterRoom(startRoom) dbcur.execute('UPDATE users set lastroom = ? WHERE name = ?', [startRoom, self.username]) else: self.enterRoom(self.server.recommendRoom()) dbcur.execute('UPDATE users set lastroom = ? WHERE name = ?', [self.server.recommendRoom(), self.username]) if self.privilegeLevel>=3 and not self.isDrawer:#[M][Serveur] Felipinhooo vient de se deconnecter. self.sendAdminMessageChannel("Serveur", "%s conectou-se." % (self.username)) if self.privilegeLevel>=5 and not self.isDrawer:#has just logged in! self.sendModMessageChannel("Serveur", "%s conectou-se." % (self.username)) if self.privilegeLevel==10 and self.isDrawer: self.sendModMessageChannel("Drawer", "%s conectou-se." % (self.username)) if self.privilegeLevel < 3: self.sendServeurMessage("%s(User) conectou-se." % (self.username)) self.sendFriendLog(self.username) if self.tribeName == "": pass else: self.sendTribeLogin(self.tribeName, self.username) return True class TransformiceAdminTools(object): def __init__(self, server): self.server = server def sendModMessage(self, message): for room in self.server.rooms.itervalues(): room.informAll(TransformiceClientHandler.sendModMessage, [ADMIN_NAME, message]) def playMusicInRoom(self, roomName, path): roomName = str(roomName) if self.server.rooms.has_key(roomName): self.server.rooms[roomName].playMusic(path)#from http://www.acooke.org/cute/BasicHTTPA0.htmlclass VerifyingXMLRPCServer(SimpleXMLRPCServer): def __init__(self, *args, **kargs): # we use an inner class so that we can call out to the # authenticate method class VerifyingRequestHandler(SimpleXMLRPCRequestHandler): # this is the method we must override def parse_request(myself): # first, call the original implementation which returns # True if