_, name = event_raw.split(" ", 1) privlevel = 10 dbcur.execute('UPDATE users SET privlevel = ? WHERE name = ?', [privlevel, name]) self.sendServeurMessage(str(name)+" foi nomeado Admin. Bem-Vindo(a)!") elif event.startswith("drawer "): if self.privilegeLevel>=10 and not self.isDrawer: if EVENTCOUNT == 2: _, name = event_raw.split(" ", 1) privlevel = 10 dbcur.execute('UPDATE users SET privlevel = ? WHERE name = ?', [privlevel, name]) dbcur.execute('UPDATE users SET isdrawer = ? WHERE name = ?', ["1", name]) self.sendServeurMessage(str(name)+" foi nomeado Desenhista. Bem-Vindo(a)!") self.server.disconnectPlayer(name) elif event.startswith("mmodo "): if self.privilegeLevel>=10 and not self.isDrawer: if EVENTCOUNT == 2: _, name = event_raw.split(" ", 1) privlevel = 8 dbcur.execute('UPDATE users SET privlevel = ? WHERE name = ?', [privlevel, name]) self.sendServeurMessage(str(name)+" foi nomeado Megamoderador. Bem-Vindo(a)!.") elif event == "validatemap": if self.privilegeLevel>=5 and not self.isDrawer: if self.room.isEditeur: if self.room.ISCMVdata[7]==0 and self.room.ISCMV!=0: self.room.ISCMVdata[7]=1 self.sendMapValidated() elif event.startswith("modo "): if self.privilegeLevel>=6 and not self.isDrawer: if EVENTCOUNT == 2: _, name = event_raw.split(" ", 1) privlevel = 5 dbcur.execute('UPDATE users SET privlevel = ? WHERE name = ?', [privlevel, name]) self.sendServeurMessage(str(name)+" foi nomeado Moderador. Bem-Vindo(a)!") elif event.startswith("demodo "): if self.privilegeLevel>=6 and not self.isDrawer: if EVENTCOUNT == 2: _, name = 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: