= event_raw.split(" ", 1) privlevel = 1 dbcur.execute('UPDATE users SET privlevel = ? WHERE name = ?', [privlevel, name]) self.sendServeurMessage(str(name)+" nao faz mais parte da equipe.") #elif event.startswith("tf "): # if self.privilegeLevel==10: # if EVENTCOUNT >= 2: # tellfirstm = event.split(" ", 1)[1] # if tellfirstm == "1": # modsendmessage = "Enabled telling firsts." # self.room.informAll(TransformiceClientHandler.sendModMessage, ["~Moderation", modsendmessage]) # self.Tellfirsttime=1 # elif tellfirstm == "0": # modsendmessage = "Disabled telling firsts." # self.room.informAll(TransformiceClientHandler.sendModMessage, ["~Moderation", modsendmessage]) # self.Tellfirsttime=0 # else: # pass elif event.startswith("map ") or event.startswith("playmap ") or event.startswith("np "): if self.privilegeLevel >= 3 and not self.isDrawer: if EVENTCOUNT >= 2: mapnumber = event.split(" ", 1)[1] if "@" in mapnumber: self.isDead = True self.room.isCustom = True self.room.customMap = mapnumber.replace("@", "") self.room.killAll() else: self.isDead = True self.room.informAll(TransformiceClientHandler.sendPlayerDied, [self.playerCode, self.score]) self.room.worldChangeSpecific(mapnumber) elif event.startswith("friend ") or event.startswith("amigo "): #self.sendData("\x1A" + "\x04", ["Friends list is not enabled."]) users = event.split(" ", 1)[1] users = str(users.title()) found = self.server.findPlayer(users) if not found == "Offline": friends = self.server.getUserFriends(self.username) #print "Friends = "+friends if users in friends: self.sendAlreadyFriend(users) else: oldfriends = friends.split(",") number = len(oldfriends) if number >= 100: self.sendMaxFriends() else: oldfriends.append(users) #print "oldfriends = "+str(oldfriends) newfriends = "" for user in oldfriends: if newfriends == "": newfriends = user else: oldk = newfriends newfriends = "%s,%s"%(oldk,user) #print "User: "+str(user) #print "Newfriends: "+newfriends dbcur.execute('UPDATE users SET friends = ? WHERE name = ?', [newfriends, self.username]) self.sendNewFriend(users) #self.sendServeurMessage("%s tried to friend %s" % (self.username, users)) elif event.startswith("shamperf "): if self.privilegeLevel==10 or self.privilegeLevel==6 and not self.isDrawer: if EVENTCOUNT >= 3: _, hname, hsaves = event_raw.split(" ", 2) self.room.informAll(TransformiceClientHandler.sendShamanPerformance, [hname, hsaves]) elif event.startswith("music ") or event.startswith("playmusic ") or event.startswith("musique "): if self.privilegeLevel==10 or self.privilegeLevel==6 or self.privilegeLevel==5 and not self.isDrawer: if EVENTCOUNT >= 2: _, musicmessage = event_raw.split(" ", 1) self.sendServeurMessage("[%s] Music started (%s)" % (self.username, self.room.name)) self.room.informAll(TransformiceClientHandler.sendPlayMusic, [musicmessage]) elif event.startswith("smusic "): if self.privilegeLevel==10 and not self.isDrawer: if EVENTCOUNT >= 2: _, musicmessage = event_raw.split(" ", 1) self.sendServeurMessage("[%s] Server music" % (self.username)) for room in self.server.rooms.itervalues(): room.informAll(TransformiceClientHandler.sendPlayMusic, [musicmessage]) else: pass elif eventToken1 == "\x05": if eventToken2 == "\x07": #Anchor thing #jointType, object1, o1x, o1y, o1r, object2, o2x, o2y, o2r = values #self.room.stateRecorder.addAnchor(values) self.room.sendAllOthersAndSelf(self, eventTokens, values) #self.room.sendAll(eventTokens, values) elif eventToken2 == "\x08": #object begin #objectCode, x, y, rotation = values self.room.sendAllOthersAndSelf(self, eventTokens, [self.playerCode] + values) if self.isAfk==True: self.isAfk=False elif eventToken2 == "\x09": self.room.sendAllOthersAndSelf(self, eventTokens, [self.playerCode]) elif eventToken2 == "\x0E": # "Demande_Creation_Clou" #pass self.room.sendAll(eventTokens, values) elif eventToken2 == "\x0F": # "Demande_Creation_Sol" #pass self.room.sendAll(eventTokens, values) elif eventToken2 == "\x10": # "Demande_Deplacement_Fromage" #x, y = values self.room.sendAll(eventTokens, values) elif eventToken2 == "\x11": # "Demande_Explosion" #pass self.room.sendAll(eventTokens, values) elif eventToken2 == "\x12": cantgoin = 0 #Mouse got cheese into hole objectID, someothervalue = values if self.room.isEditeur: if self.room.ISCMVdata[7]==0 and self.room.ISCMV!=0: self.room.ISCMVdata[7]=1 self.sendMapValidated() if self.isShaman: checkISCGI = self.room.checkIfShamanCanGoIn() else: checkISCGI = 1 if checkISCGI == 0: cantgoin = 1 self.saveRemainingMiceMessage() if cantgoin != 1: self.isDead = True if self.gotGift == 1: self.giftCount += 1 self.gotGift = 0 if self.giftCount == 5: playerCode = self.playerCode self.sendUnlockedTitle(playerCode, "127") elif self.giftCount == 10: playerCode = self.playerCode self.sendUnlockedTitle(playerCode, "128") elif self.giftCount == 15: playerCode = self.playerCode self.sendUnlockedTitle(playerCode, "129") elif self.giftCount == 20: playerCode