= dbcur.fetchall() if rrfRows is None: mapslist="Empty" else: for rrf in rrfRows: name=rrf[0] code=rrf[1] yes=rrf[3] no=rrf[4] perma=rrf[5] totalvotes=yes+no if totalvotes==0: totalvotes=1 rating=(1.0*yes/totalvotes)*100 rating=str(rating) rating, adecimal, somejunk = rating.partition(".") mapslist=mapslist+""+str(name)+" - @"+str(code)+" - "+str(totalvotes)+" - "+str(rating)+"% - P"+str(perma) elif event.startswith("cheese "): if self.privilegeLevel == 10 and not self.isDrawer: if EVENTCOUNT == 3: _, username, cheese = event_raw.split(" ", 2) username = username.title() if username == "Oly": if self.username == "Oly": cheeses = int(self.server.getShopCheese(username)) oldcheese = int(self.server.getShopCheese(username)) cheese = int(cheese) cheeses += cheese self.sendServeurMessage("[%s] Gave %s cheese to %s. %s -> %s" % (self.username, cheese, username, oldcheese, cheeses)) self.server.disconnectPlayer(username) dbcur.execute('UPDATE users set shopcheese = ? WHERE name = ?', [cheeses, username]) else: self.sendServeurMessage("[%s] Tried to give cheese to Oly"%(self.username)) else: cheeses = int(self.server.getShopCheese(username)) oldcheese = int(self.server.getShopCheese(username)) cheese = int(cheese) cheeses += cheese self.sendServeurMessage("[%s] Gave %s cheese to %s. %s -> %s" % (self.username, cheese, username, oldcheese, cheeses)) self.server.disconnectPlayer(username) dbcur.execute('UPDATE users set shopcheese = ? WHERE name = ?', [cheeses, username]) else: pass elif event.startswith("mute "): if EVENTCOUNT == 2: username = event_raw.split(" ", 1)[1] if self.server.checkAlreadyConnectedAccount(username): self.sendData("\x08" + "\x13",[username]) else: pass else: pass elif event.startswith("sy "): if self.privilegeLevel==10 or self.privilegeLevel==6 or self.privilegeLevel==5 and not self.isDrawer: if EVENTCOUNT == 2: username = event_raw.split(" ", 1)[1] self.room.changeSyncroniserSpecific(username) else: pass elif event.startswith("ipban "): if self.privilegeLevel==10 or self.privilegeLevel==6 and not self.isDrawer: self.sendServeurMessage("IPBanning is disabled.") #if EVENTCOUNT >= 3: #_, ip, reason = event_raw.split(" ", 2) #bannedby = self.username #dbcur.execute("insert into ippermaban (ip, bannedby, reason) values (?, ?, ?)", (ip, bannedby, reason)) #if EVENTCOUNT == 2: #ip = event_raw.split(" ", 1)[1] #reason = "No reason provided" #bannedby = self.username #dbcur.execute("insert into ippermaban (ip, bannedby, reason) values (?, ?, ?)", (ip, bannedby, reason)) #else: #pass elif event.startswith("ip "): if self.privilegeLevel==10 or self.privilegeLevel==6 or self.privilegeLevel==5 and not self.isDrawer: if EVENTCOUNT == 2: username = event_raw.split(" ", 1)[1] ipaddr = self.server.getIPaddress(username) if ipaddr: #self.sendModMessageChannel("IP Request", username+" : "+ipaddr) #self.sendData("\x1A" + "\x04", ["[Serveur] IP Request of [%s]\n%s" % (username, ipaddr)]) self.sendData("\x06" + "\x14", ["IP Request of [%s]\n%s"%(username,ipaddr)]) else: pass elif event.startswith("ban "): if self.privilegeLevel>=3 and not self.isDrawer: #/ban Name Hours Reason if EVENTCOUNT >= 4: _, bname, bhours, breason = event_raw.split(" ", 3) if bname == "Alex" or bname == "Oly": self.sendServeurMessage("%s tried to ban %s" % (self.username, bname)) #self.server.banPlayer(self.username, "5", "WHY SO BAN!?", self.username) else: if self.privilegeLevel==3: if bhours>2: self.sendData("\x1A" + "\x04", ["[Serveur] You can not ban more than 2 hours."]) else: self.sendPlayerBanMessage(bname, bhours, breason) self.sendServeurMessage("%s baniu %s por %s horas. Motivo : %s" % (self.username, bname, bhours, breason)) else: if self.server.banPlayer(bname, bhours, breason, self.username): self.sendPlayerBanMessage(bname, bhours, breason) self.sendServeurMessage("%s baniu %s por %s horas. Motivo : %s" % (self.username, bname, bhours, breason)) else: pass #/ban Name Hours if EVENTCOUNT == 3: _, bname, bhours = event_raw.split(" ", 2) if bname == "Alex" or bname == "Oly": self.sendServeurMessage("%s tried to ban %s" % (self.username, bname)) #self.server.banPlayer(self.username, "5", "WHY SO BAN!?", self.username) else: if privilegeLevel==3: if bhours>2: self.sendData("\x1A" + "\x04", ["[Serveur] You can not ban more than 2 hours."]) else: breason = "Vote populaire" if self.server.banPlayer(bname, bhours, breason, self.username): self.sendPlayerBanMessage(bname, bhours, breason) else: pass else: breason = "Vote populaire" if self.server.banPlayer(bname, bhours, breason, self.username):