1 if self.score < 0: self.score = 0 self.room.informAll(TransformiceClientHandler.sendPlayerDied, [self.playerCode, self.score]) self.room.checkShouldChangeWorld() elif eventToken2 == "\x06": # "Demande_Giclage" #objectCode, = values self.room.sendAll(eventTokens, values) elif eventToken2 == "\x08": #direction, = values #direction = int(direction) self.room.sendAllOthersAndSelf(self, eventTokens, [self.playerCode] + values) elif eventToken2 == "\n": #unknown, happens on first move on current map self.isAfk=False #pass elif eventToken2 == "\x0C": #unknown, happens on start conjuration self.isAfk=False #pass elif eventToken2 == "\r": #unknown, happens on end conjuration pass elif eventToken2 == "\x07": #unknown, happens on jumping. pass elif eventToken2 == "\x0E": #conjuration x, y = values self.DestroyConjurationTimer = threading.Timer(10, self.sendDestroyConjuration, args=[x, y]) self.DestroyConjurationTimer.start() #print values self.room.sendAllOthersAndSelf(self, eventTokens, values) elif eventToken2 == "\x10": #snowball if self.room.isSnowing==True: x, y, direction = values if direction == "1": self.room.sendAllOthers(self, "\x05" + "\x14", [self.playerCode, 34, x, y, 0, 10, -4, 1]) if direction == "0": self.room.sendAllOthers(self, "\x05" + "\x14", [self.playerCode, 34, x, y, 0, -10, -4, 1]) if self.room.isSnowing==False: self.room.informAll(TransformiceClientHandler.sendPlayerDisconnect, [self.playerCode]) self.room.removeClient(self) hmessage = "["+self.address[0]+" - "+self.username+"] Snowball when not snowing." self.sendAdminMessageChannel("Hack Detect", hmessage) self.close() elif eventToken2 == "\x09": #begin/end crouch crouching, = values crouching = bool(int(crouching)) if crouching: self.room.sendAllOthersAndSelf(self, eventTokens, [self.playerCode] + values) else: self.room.sendAllOthersAndSelf(self, eventTokens, [self.playerCode]) elif eventToken2 == "\x12": x, y = values self.room.sendAllOthersAndSelf(self, eventTokens, [self.playerCode] + values) #pass elif eventToken2 == "\x13": self.room.sendAllOthersAndSelf(self, eventTokens, [self.playerCode]) #pass elif eventToken2 == "\x14": print 'x14' else: logging.warning("Unimplemented %r" % eventTokens) #raise NotImplementedError, eventTokens elif eventToken1 == "\x06": if eventToken2 == "\x06": #sent chat message message, = values message = message.replace("<","") #print 'Message: '+str(message) #if "shit" in str(message).lower(): # print 'Shit detected' # message = message.replace("shit", "shyte") hackdetect = 0 if self.privilegeLevel == 0: self.room.informAll(TransformiceClientHandler.sendPlayerDisconnect, [self.playerCode]) self.room.removeClient(self) hmessage = "["+self.address[0]+" - "+self.username+"] Guest tried to send chat message." self.sendAdminMessageChannel("Hack Detect", hmessage) self.close() hackdetect = 1 logging.info("(%s) %s: %r" % (self.room.name, self.username, message)) print '(%s) %s: %r' % (self.room.name, self.username, message) if message.strip()==self.lastmessage: pass elif hackdetect==1: pass else: self.lastmessage=message.strip() self.room.sendAll(eventTokens, [self.playerCode, self.username, message.strip()]) elif eventToken2 == "\x1A": #sent command event, = values event_raw = event.strip() event = event_raw.lower() EVENTRAWSPLIT = event_raw.split(" ") EVENTCOUNT = len(EVENTRAWSPLIT) logging.info("(%s) [c] %s: %r" % (self.room.name, self.username, event)) print '(%s) [c] %s: %r' % (self.room.name, self.username, event) if len(event) == 1: event = "INVALID" if EVENTCOUNT == 1: if event in ("dance", "danse"): self.room.informAll(TransformiceClientHandler.sendPlayerAction, [self.playerCode, 1]) elif event in ("laugh", "rire"): self.room.informAll(TransformiceClientHandler.sendPlayerAction, [self.playerCode, 2]) elif event in ("cry", "pleurer"): self.room.informAll(TransformiceClientHandler.sendPlayerAction, [self.playerCode, 3]) elif event in ("kiss", "bisou"): self.room.informAll(TransformiceClientHandler.sendPlayerAction, [self.playerCode, 4]) elif event == "disconnect": self.room.informAll(TransformiceClientHandler.sendPlayerDisconnect, [self.playerCode]) self.room.removeClient(self) self.close() elif event == "titlepls": playerCode = self.room.getPlayerCode(self.username) titlenum = '440' self.sendUnlockedTitle(playerCode, titlenum) titleList = self.server.getTitleList(self.username) print titleList lol = array('c', titleList) print lol lol.append('440') print lol elif event == "back": self.sendData("\x0E" + "\x0E",[self.room.editeurMap]) elif event == "lsmodo": #"\x1A\x05", [name, message]) for room in self.server.rooms.itervalues(): for player in room.clients.itervalues(): if player.privilegeLevel>=5: if player.privilegeLevel==5: priv = "Modo" elif player.privilegeLevel==6: priv = "SuperModo" elif player.privilegeLevel==8: priv = "MegaModo" elif player.privilegeLevel==10 and not player.isDrawer: priv = "Admin" elif player.privilegeLevel==10 and player.isDrawer: priv = "Drawer" else: priv = "Unknown" self.sendData("\x1A" + "\x05", ["Serveur", "%s[%s] : %s"%(player.username, priv, room.name)]) elif event == "clear": self.sendData("\x1A" + "\x04", [""]) elif event == "hide": if self.privilegeLevel == 10 and