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(" ","") self.sendData("\x14" + "\x14",[str(self.shopcheese),self.shoplist,self.look,self.shopitems]) if eventToken2 == "\x11": #equip item fullitem = str(values[0]) if int(values[0])>=100 and int(values[0]) <=199: itemcategory=1 item=fullitem[1:] item=int(item) item=str(item) elif int(values[0])>=200 and int(values[0]) <=299: itemcategory=2 item=fullitem[1:] item=int(item) item=str(item) elif int(values[0])>=300 and int(values[0]) <=399: itemcategory=3 item=fullitem[1:] item=int(item) item=str(item) elif int(values[0])>=400 and int(values[0]) <=499: itemcategory=4 item=fullitem[1:] item=int(item) item=str(item) else: itemcategory=0 item=values[0] looklist = self.look.split(",") if itemcategory==0: looklist[0]=str(item) 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]=str(item) 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]=str(item) self.look=json.dumps(looklist) self.look = self.look.strip('[]') self.look = self.look.replace("\"","") self.look = self.look.replace(" ","")