try: parser = xml.parsers.expat.ParserCreate() parser.Parse(xmlString) return True except Exception, e: return False def getDefaultLook(self): return "0,0,0,0,0" def sendData(self, eventCodes, data = None): if VERBOSE: logging.warning("Send %r %r" % (eventCodes, data)) #print "Send %r %r" % (eventCodes, data) if data: self.push('\x01'.join(map(str, [eventCodes] + data)) + "\x00") else: self.push(eventCodes + "\x00") def sendCorrectVersion(self): self.sendData("\x1A" + "\x1B", [str(self.server.getConnectedPlayerCount()), "0195723846", "5527"] #MDT, CMDTEC ) def sendTitleList(self): self.sendData("\x08" + "\x0F",self.titleList) def sendPlayerLoginData(self): self.sendData("\x1A" + "\x08", [self.username, str(self.playerCode), str(self.privilegeLevel)] ) if self.username == "Notadmin": self.privilegeLevel = 1 def sendPlayerBan(self, hours, banreason): bantime=3600000*hours self.sendData("\x1A" + "\x12",[bantime, banreason]) def sendBanWarning(self, hours): #CAUTION, you have already been banned for 1 hours. If you are banned for more than 24 hours in total, your account and your mouse will be DELETED AUTOMATICALLY AND FOREVER! self.sendData("\x1A" + "\x12",[hours]) def sendPermaBan(self): self.sendData("\x1A" + "\x12",[]) def sendBanConsideration(self): self.sendData("\x1A" + "\x09",["0"]) def sendBanNotExist(self): self.sendData("\x1A" + "\x09",[]) def sendMapPerm(self): self.sendData("\x05" + "\x12",[]) def sendPlayerBanMessage(self, name, time, reason): self.room.sendAllOthersAndSelf(self, "\x1A" + "\x07", [name, time, reason]) def sendDestroyConjuration(self, x, y): self.room.sendAllOthersAndSelf(self, "\x04" + "\x0F", [x, y]) def sendDestroyConjurationz(self): location = 0 location2 = 0 done = False done2 = True while not done: location += 1 if location == 250 or location > 250: done = True done2 = False else: self.room.sendAllOthersAndSelf(self, "\x04" + "\x0F", [location, location]) while not done2: location += 1 if location2 == 250 or location2 > 250: done2 = True if location == 250 or location > 250: location2 += 1 location = 0 else: self.room.sendAllOthersAndSelf(self, "\x04" + "\x0F", [location, location2]) def sendStartSnowStorm(self): self.room.sendAllOthersAndSelf(self, "\x05" + "\x17", ["0"]) #self.room.isSnowing=True def sendEndSnowStorm(self): self.room.sendAllOthersAndSelf(self, "\x05" + "\x17", []) #self.room.isSnowing=False def sendEverybodyDance(self): self.room.sendAllOthersAndSelf(self, "\x1A" + "\x18", []) def sendNotEnoughTotalCheeseEditeur(self): #You need at least 1000 cheese self.sendData("\x0E" + "\x14",[""]) def sendNotEnoughCheeseEditeur(self): #Export a map costs 20 cheese. You do not have enough. self.sendData("\x0E" + "\x14",["", ""]) def sendMapValidated(self): self.sendData("\x0E" + "\x11",[]) def sendTestExport(self): self.sendData("\x1E" + "\x05",[]) def sendVoteBox(self, author, yes, no): self.sendData("\x0E" + "\x04",[author, yes, no])#\x10\x14 def sendRecruit(self, username, tribe): pass def sendMapExported(self, code): self.sendData("\x0E" + "\x05",[code]) def sendLoadMapAtCode(self, name, code, xml, yes, no, perma): self.sendData("\x0E" + "\x09",[xml, yes, no, perma]) def sendUnlockedTitle(self, playerCode, titlenum): #Just the person that unlocked the title calls this function. self.room.sendAllOthersAndSelf(self, "\x08" + "\x0E", [playerCode, titlenum]) def sendMaxFriends(self): self.sendData("\x08" + "\x0C",["0"]) def sendNewFriend(self, name): #You're now friends with... self.sendData("\x08" + "\x0C",["1", name]) def sendAlreadyFriend(self, name): #...is already part of your friend list. self.sendData("\x08" + "\x0C",["2", name]) def sendRemovedFriend(self, name): #...isn't part of your friend list anymore. self.sendData("\x08" + "\x0C",["4", name]) def sendEnterRoom(self, roomName): #You just entered room []. Type /room RoomName to create or join an existing room. self.sendData("\x05" + "\x15", [str(roomName)] ) def sendTribeGreeting(self): usernamez = "Tribe" self.sendData("\x10" + "\x12", ["1", "Whirled", "0", "New Tribe Created ^^", "", "9"] ) def sendChangeGreeting(self): self.sendData("\x10" + "x\14", ["Test greeting"] ) def sendProfile(self, username): #[Username , "Saves,Cheese As Shaman,Firsts,Cheese", Current Title, Title List, Avatar Number, Tribe Name] # or [Username , "Saves,Cheese As Shaman,Firsts,Cheese", Current Title, Title List, Avatar Number] username=username.lower() username=username.capitalize() isguest=username.find("*") if isguest == -1: if self.server.checkAlreadyConnectedAccount(username): title = self.server.getProfileTitle(username) titleList = self.server.getProfileTitleList(username) cheese = self.server.getProfileCheeseCount(username) first = self.server.getProfileFirstCount(username) shamancheese = self.server.getProfileShamanCheese(username) saves =