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 = self.server.getProfileSaves(username) tribe = self.server.getProfileTribe(username) stats = str(saves)+","+str(shamancheese)+","+str(first)+","+str(cheese) if tribe != "": self.sendData("\x08" + "\x0A",[username , stats, title, titleList, "0", tribe]) else: self.sendData("\x08" + "\x0A",[username , stats, title, titleList, "0"]) else: pass else: pass def catchTheCheeseNoShaman(self, playerCode): self.sendData("\x08" + "\x17", [playerCode] ) self.sendData("\x05" + "\x13", [playerCode] ) self.room.isCatchTheCheeseMap = True def catchTheCheeseShaman(self, playerCode): self.sendData("\x08" + "\x17", [playerCode] ) self.sendData("\x05" + "\x13", [playerCode] ) self.sendData("\x08" + "\x14", [playerCode] ) self.room.isCatchTheCheeseMap = True def sendNewParty(self): if self.room.isSnowing==True: self.sendStartSnowStorm() if self.room.isSnowing==False: self.sendEndSnowStorm() self.sendData("\x05" + "\x05", [self.room.currentWorld, self.room.getPlayerCount(), 1, ""] ) def sendNewPartyCustomMap(self, mapxml, mapname, mapperma): #mapperma = 0 mapperma = str(mapperma) if self.room.isSnowing==True: self.sendStartSnowStorm() if self.room.isSnowing==False: self.sendEndSnowStorm() self.sendData("\x05" + "\x05", ["-1", self.room.getPlayerCount(), 10, "\x01"+mapxml+"\x02"+mapname+"\x02"+mapperma] ) # print 'XML Loaded: '+str(mapxml) def sendPlayerList(self): self.sendData("\x08" + "\x09", list(self.room.getPlayerList()) ) def sendNewPlayer(self, playerData): self.sendData("\x08" + "\x08", [playerData] ) def sendPlayerDisconnect(self, playerCode): self.sendData("\x08" + "\x07", [playerCode] ) def sendPlayerDied(self, playerCode, score): #score = score-1 #if score < 0: # score = 0 #self.score=score #self.room.decreaseScore(playerCode, score) self.sendData("\x08" + "\x05", [playerCode, 0, score] ) if self.room.currentShamanCode == playerCode: self.sendTwenty() #self.room.setAlready = False self.room.setTimer() #print '(%s) Time set to 20'%(self.room.name) else: players = 0 alive = 0 for playerCode, client in self.room.clients.iteritems(): players += 1 if client.isDead: pass else: alive += 1 #print 'alive: %s players: %s'%(str(alive), str(players)) if alive == 1: if players >= 2: self.sendTwenty() self.room.setTimer() def sendPlayerGotCheese(self, playerCode, score, place, timeTaken): self.sendData("\x08" + "\x06", [playerCode, 0, score, place, timeTaken] ) def sendShamanCode(self, shamanPlayerCode): if shamanPlayerCode == 0: self.sendData("\x08" +