= self.playerCode self.sendUnlockedTitle(playerCode, "130") else: pass self.room.numCompleted += 1 place = self.room.numCompleted timeTaken = int( (time.time() - self.room.gameStartTime)*10 ) #Score stuff playerscorep = self.score if place==1: playerscorep = playerscorep+16 if self.room.getPlayerCount() >= 3: #Change this number for how many have to be in the room for firsts to count if self.isShaman: self.firstcount = self.firstcount else: self.firstcount += 1 elif place==2: playerscorep = playerscorep+14 elif place==3: playerscorep = playerscorep+12 else: playerscorep = playerscorep+10 if self.isShaman==True: playerscorep = self.score self.score = playerscorep #end if int(self.room.getPlayerCount()) >= 2: if self.playerCode == self.room.currentShamanCode: self.shamancheese += 1 else: self.cheesecount += 1 self.shopcheese += 1 self.room.informAll(TransformiceClientHandler.sendPlayerGotCheese, [self.playerCode, self.score, place, timeTaken]) print (self.playerCode, self.score, place, timeTaken) if self.room.isTesting: self.sendData("\x0E" + "\x11",[]) self.room.checkShouldChangeWorld() elif eventToken2 == "\x13": #client thinks he has cheese self.room.sendAll(eventTokens, [self.playerCode]) #self.room.stateRecorder.log(eventTokens, [self.playerCode]) self.room.numGotCheese += 1 if self.room.currentWorld == 108: if self.room.numGotCheese>=10: self.room.killShaman() if self.room.currentWorld == 109: if self.room.numGotCheese>=10: self.room.killShaman() if self.room.currentWorld == 110: if self.room.numGotCheese>=10: self.room.killShaman() if self.room.currentWorld == 111: if self.room.numGotCheese>=10: self.room.killShaman() if self.room.currentWorld == 112: if self.room.numGotCheese>=10: self.room.killShaman() if self.room.currentWorld == 113: if self.room.numGotCheese>=10: self.room.killShaman() if self.room.currentWorld == 114: if self.room.numGotCheese>=10: self.room.killShaman() elif eventToken2 == "\x14": #object finalise conjouring #objectCode, x, y, rotation, unkn1, unkn2, isSolid = values hackcheck = 0 #if self.room.currentWorld == 108 or self.room.currentWorld == 109 or self.room.currentWorld == 888 or self.room.currentWorld == 801: #if self.room.isSandbox == False and self.room.isPlay == False: #self.room.informAll(TransformiceClientHandler.sendPlayerDisconnect, [self.playerCode]) #self.room.removeClient(self) #hmessage = "["+self.address[0]+" - "+self.username+"] Spawned object on map with no objects or shaman." #self.sendAdminMessageChannel("Hack Detect", hmessage) #self.close() #hackcheck = 1 #if self.playerCode != self.room.currentShamanCode: #if self.room.isSandbox == False and self.room.isPlay == False: #self.room.informAll(TransformiceClientHandler.sendPlayerDisconnect, [self.playerCode]) #self.room.removeClient(self) #hmessage = "["+self.address[0]+" - "+self.username+"] Spawned object when not shaman." #self.sendAdminMessageChannel("Hack Detect", hmessage) #self.close() #hackcheck = 1 if values[0]=="5" or values[0]=="8" or values[0]=="9" or values[0]=="17" or values[0]=="21" or values[0]=="23" or values[0]=="25": #Heavy Ball=5; Little Rough Board=8; Long Reough Board=9; Up Cannon=17; Sticky Ball=21; Bomb=23; Bait=25 self.room.informAll(TransformiceClientHandler.sendPlayerDisconnect, [self.playerCode]) self.room.removeClient(self) hmessage = "["+self.address[0]+" - "+self.username+"] Spawned object code "+values[0]+"." self.sendAdminMessageChannel("Hack Detect", hmessage) self.close() hackcheck = 1 if hackcheck == 0: self.room.sendAllOthersAndSelf(self, eventTokens, [self.playerCode] + values) elif eventToken2 == "\x15": # "Creation_Objet_Monde" - world object creation #objectCode, x, y, unkn1, unkn2, unkn3, unkn4 = values if self.isSyncroniser: self.room.sendAllOthers(self, eventToken1 + "\x14", values) elif eventToken2 == "\x16": # "Demande_Changement_Gravite" #gx, gy = values if self.isSyncroniser: self.room.sendAll(eventTokens, values) else: logging.warning("Unimplemented %r" % eventTokens) #raise NotImplementedError, eventTokens elif eventToken1 == "\x14": if eventToken2 == "\x14": #open shop self.sendData("\x14" + "\x14",[str(self.shopcheese),self.shoplist,self.look,self.shopitems]) if eventToken2 == "\x12": #remove item if int(values[0])>=100 and int(values[0]) <=199: itemcategory=1 elif int(values[0])>=200 and int(values[0]) <=299: itemcategory=2 elif int(values[0])>=300 and int(values[0]) <=399: itemcategory=3 elif int(values[0])>=400 and int(values[0]) <=499: itemcategory=4 else: itemcategory=0 looklist = self.look.split(",") if itemcategory==0: looklist[0]="0" self.look=json.dumps(looklist) self.look = self.look.strip('[]') self.look = self.look.replace("\"","") self.look = self.look.replace(" ","") self.sendData("\x14" + "\x14",[str(self.shopcheese),self.shoplist,self.look,self.shopitems]) if itemcategory==1: looklist[1]="0" self.look=json.dumps(looklist) self.look = self.look.strip('[]') self.look = self.look.replace("\"","") self.look = self.look.replace(" ","") self.sendData("\x14" + "\x14",[str(self.shopcheese),self.shoplist,self.look,self.shopitems]) if itemcategory==2: looklist[2]="0" self.look=json.dumps(looklist) self.look = self.look.strip('[]') self.look = self.look.replace("\"","") self.look = self.look.replace(" ","") self.sendData("\x14" + "\x14",[str(self.shopcheese),self.shoplist,self.look,self.shopitems]) if itemcategory==3: looklist[3]="0" self.look=json.dumps(looklist) self.look = self.look.strip('[]') self.look = self.look.replace("\"","") self.look = self.look.replace(" ","") self.sendData("\x14" + "\x14",[str(self.shopcheese),self.shoplist,self.look,self.shopitems]) if itemcategory==4: looklist[4]="0" self.look=json.dumps(looklist) self.look = self.look.strip('[]') self.look = self.look.replace("\"","") self.look = self.look.replace("