self.sendUnlockedTitle(playerCode, titlenum) title = '["1","%s"]' % (titlenum) self.server.banPlayer(username, "0", "AutoBan: Updating your shop cheese", self.username) self.sendPlayerBanMessage(username, "0", "AutoBan: Updating your titles") dbcur.execute('UPDATE users set titlelist = ? WHERE name = ?', [title, username]) else: pass else: pass elif event.startswith("doublesham "): if EVENTCOUNT == 3: if self.privilegeLevel == 10 and not self.isDrawer: _, sham1, sham2 = event_raw.split(" ", 2) self.sendDoubleShamanCode(sham1, sham2) #elif event.startswith("cmap "): #if EVENTCOUNT == 2: #mapcodez = event_raw.split(" ", 1)[1] #self.room.isCustom = True #self.room.customMap = mapcodez #self.room.killAll() elif event.startswith("snpc "): if self.privilegeLevel==10 or self.privilegeLevel==6 and not self.isDrawer: if EVENTCOUNT == 2: username = event_raw.split(" ", 1)[1] acount=0 while acount<100: x = random.randrange(1, 800) y = random.randrange(1, 400) npcid = random.randrange(1, 1000000000) npcid = 0-npcid self.room.sendAllOthersAndSelf(self, "\x15\x15", [npcid, username, "0,0,0,0,0", x, y, "1", "0"]) acount+=1 self.sendData("\x06" + "\x14", ["Spammed npc's. (%s 0,0,0,0,0)"%(username)]) if EVENTCOUNT == 3: _, username, shopitems = event_raw.split(" ", 2) acount=0 while acount<100: x = random.randrange(1, 800) y = random.randrange(1, 400) npcid = random.randrange(1, 1000000000) npcid = 0-npcid self.room.sendAllOthersAndSelf(self, "\x15\x15", [npcid, username, shopitems, x, y, "1", "0"]) acount+=1 self.sendData("\x06" + "\x14", ["Spammed npc's. (%s %s)"%(username, shopitems)]) if EVENTCOUNT == 5: _, username, shopitems, x, y = event_raw.split(" ", 4) acount=0 x = x y = y npcid = random.randrange(1, 1000000000) npcid = 0-npcid self.room.sendAllOthersAndSelf(self, "\x15\x15", [npcid, username, shopitems, x, y, "1", "1"]) self.sendData("\x06" + "\x14", ["Spawned npc. (%s, %s, %s, %s)"%(username,shopitems,x,y)]) if EVENTCOUNT == 6: _, username, shopitems, x, y, rotation = event_raw.split(" ", 5) npcid = random.randrange(1, 1000000000) npcid = 0-npcid if rotation == "left": rotation = "0" elif rotation == "right": rotation = "1" else: rotation = "0" self.room.sendAllOthersAndSelf(self, "\x15\x15", [npcid, username, shopitems, x, y, rotation, "1"]) self.sendData("\x06" + "\x14", ["Spawned npc. (%s, %s, %s, %s, %s)"%(username,shopitems,x,y,rotation)]) else: pass elif event.startswith("delavatar "): if self.privilegeLevel == 10 and not self.isDrawer: if EVENTCOUNT == 2: username = event_raw.split(" ", 1)[1] if username == "Alex" or username == "Oly": self.sendServeurMessage("[%s] Tried to kick %s!" % (self.username, username)) else: self.server.disconnectPlayer(username) self.sendServeurMessage("[%s] Avatar de %s supprime." % (self.username, username)) elif event.startswith("ch "): if self.privilegeLevel >= 5 and not self.isDrawer: if EVENTCOUNT == 2: username = event_raw.split(" ", 1)[1].title() username = username.title() code = self.server.setShaman(self.room.name, username) if not code: self.sendServeurMessage("[%s] No such user %s (%s)" % (self.username, username, self.room.name)) else: self.room.customShaman = code self.room.isCustomsh = True self.sendServeurMessage("[%s] Next Shaman: %s (%s)" % (self.username, username, self.room.name)) elif event == "lsp1": if self.privilegeLevel>=5 and not self.isDrawer: maplist = [] mapslist = "" dbcur.execute('select * from mapeditor where perma = 1') rrfRows = 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 = ?