) def saveRemainingMiceMessage(self): #You must save all the remaining mice before you can enter the hole. self.sendData("\x08" + "\x12", ) def sendPlayMusic(self, path): self.sendData("\x1A" + "\x0C", [path] ) def sendSentPrivMsg(self, username, message): self.sendData("\x06" + "\x07", [message, username] ) def sendRecievePrivMsg(self, username, message): self.sendData("\x06" + "\x07", [message, username, "x"] ) def sendPlayerNotFound(self): self.sendData("\x06" + "\x07") def getPlayerData(self): #FUR return '#'.join(map(str, #has cheese #unknown #forum ID [self.username, self.playerCode, int(self.isDead), self.score, 0, self.titleNumber, 0, self.look, self.fur, 1] )) def enterRoom(self, roomName): enter = True if roomName.startswith("[Private]"): privates = ['Kingboo', 'Sooki', 'Oly', 'Alex', 'Solarra', 'Jawster', 'Wimp'] if self.username in privates: self.sendData("\x1A" + "\x04", ["Bem-vindo %s! This room is for the private people only :P"%(self.username)]) else: self.sendData("\x1A" + "\x04", ["You are not allowed in this room ^_^"]) self.room.removeClient(self) self.enterRoom("1") enter = False if roomName.startswith("\x03"+"[Editeur] "): editeurnamecheck = roomName.replace("\x03"+"[Editeur] ", "") if editeurnamecheck == self.username: pass if editeurnamecheck != self.username: self.room.informAll(TransformiceClientHandler.sendPlayerDisconnect, [self.playerCode]) self.room.removeClient(self) hmessage = "["+self.address[0]+" - "+self.username+"] Attempted to go to "+editeurnamecheck+"'s editor room." self.sendAdminMessageChannel("Hack Detect", hmessage) self.close() if enter: if self.room: self.room.removeClient(self) self.resetPlay() self.score = 0 self.sendEnterRoom(roomName) #self.room = self.server.addClientToRoom(self, roomName)#self.room.removeClient(self) #print 'Added %s to room'%(str(self)) def resetPlay(self): self.isShaman = False self.isDead = False self.isSyncroniser = False def startPlay(self): if self.room.getPlayerCount() >= 2: self.roundCount=self.roundCount+1 self.resetPlay() self.sendGiftAmount(self.giftCount) if self.room.isBootcamp: mapcode=1337 mapcode=str(mapcode) code = mapcode dbcur.execute('select name from mapeditor where code = ?', [code]) rrf = dbcur.fetchone() mapname=rrf[0] del rrf dbcur.execute('select mapxml from mapeditor where code = ?', [code]) rrf = dbcur.fetchone() mapxml=rrf[0] del rrf dbcur.execute('select yesvotes from mapeditor where code = ?', [code]) rrf = dbcur.fetchone() yesvotes=rrf[0] del rrf dbcur.execute('select novotes from mapeditor where code = ?', [code]) rrf = dbcur.fetchone() novotes=rrf[0] del rrf dbcur.execute('select perma from mapeditor where code = ?', [code]) rrf = dbcur.fetchone() perma=rrf[0] del rrf dbcur.execute('select deleted from mapeditor where code = ?', [code]) rrf = dbcur.fetchone() mapnoexist=rrf[0] self.sendNewPartyCustomMap(mapxml, mapname, perma) elif self.room.name == "801": mapcode="802" mapxml='' mapname="802" perma=0 self.sendNewPartyCustomMap(mapxml, mapname, perma) else: if self.room.isCustom: try: mapcode=self.room.customMap mapcode=str(mapcode) mapname=self.server.getMapName(mapcode) mapxml=self.server.getMapXML(mapcode) yesvotes=self.server.getMapYesVotes(mapcode) novotes=self.server.getMapNoVotes(mapcode) perma=self.server.getMapPerma(mapcode) mapnoexist=self.server.getMapDel(mapcode) self.sendNewPartyCustomMap(mapxml, mapname, perma) except: self.sendServeurMessage("No such map [%s]" % (mapcode)) elif self.room.isTesting: mapxml=self.room.editeurMap self.sendNewPartyCustomMap(mapxml, "-", 0) else: self.sendNewParty() if self.room.currentWorld==888: self.sendTime(60) if self.room.isBootcamp: self.sendTime(360) else: self.sendTime(120) if self.room.isSandbox: self.sendTime(0) self.sendPlayerList() shamanCode = self.room.getShamanCode() double = False if self.room.name=="801": self.sendShamanCode(0) elif self.room.everybodyIsShaman: self.sendShamanCode(self.playerCode) elif self.room.nobodyIsShaman: self.sendShamanCode(0) shamanCode = 0 elif self.room.currentWorld in [108, 109]: self.catchTheCheeseNoShaman(shamanCode) elif self.room.currentWorld in [110, 111, 112, 113, 114]: self.catchTheCheeseShaman(shamanCode) elif self.room.currentWorld in [44, 45, 46, 47, 48, 49, 50, 51, 52, 53]: shamone = self.room.getDoubleShamanCode(1) shamtwo = self.room.getDoubleShamanCode(2) double = True print 'Sham1: %s Sham2: %s'%(str(shamone), str(shamtwo)) self.sendDoubleShamanCode(shamone, shamtwo) else: self.sendShamanCode(shamanCode) if double: if shamone == self.playerCode: self.isShaman = True elif shamtwo == self.playerCode: self.isShaman = True else: if shamanCode == self.playerCode: self.isShaman = True syncroniserCode = self.room.getSyncroniserCode() self.sendSynchroniser(syncroniserCode) if syncroniserCode == self.playerCode: self.isSyncroniser = True if self.username == "Timekeeper": self.isDead = True self.room.informAll(TransformiceClientHandler.sendPlayerDied, [self.playerCode, self.score]) if self.room.currentWorld==888: self.sendData("\x15" + "\x15", ["0", "Papai Noel", "21,0,3,4,3", "600", "335", "0", "0"]) self.sendData("\x15" + "\x15", ["1", "Brunok", "21,0,3,4,3", "500", "300", "1", "0"]) if self.room.name=="801": self.sendData("\x15" + "\x15", ["-1", "Brunok", "6,1,0,7,2", "700", "335", "0", "1"]) self.sendData("\x15" + "\x15", ["-2", "Sonic", "13,0,0,3,0", "100", "200", "1", "0"]) self.sendData("\x15" + "\x15", ["-3",