("startsnow"): if self.privilegeLevel==10 and not self.isDrawer: self.room.isSnowing=True self.sendStartSnowStorm() self.sendData("\x1A" + "\x04", ["Snow has started. To stop snow use /stopsnow."]) self.sendServeurMessage("[%s] Started snow (%s)" % (self.username, self.room.name)) print '%s started snow' % (self.username) elif event in ("new"): self.sendData("\x1A" + "\x04", ["- Fixed map rotation, everything should work normally. - /cmap mapcode has been added for custom maps - It will tell you if you use /startsnow or such. - /players will now tell you amount of players online - I'm currently fixing /find"]) elif event in ("stopsnow"): if self.privilegeLevel==10 and not self.isDrawer: self.room.isSnowing=False self.sendEndSnowStorm() self.sendServeurMessage("[%s] Stopped snow (%s)" % (self.username, self.room.name)) print '%s stopped snow' % (self.username) elif event == "mt": if self.tribeName == "": pass else: if self.tribeMuted: self.room.sendTribeMsg(self, "\x10\x04", [str(self.tribeName), '13', '1', self.username]) self.tribeMuted = False else: self.room.sendTribeMsg(self, "\x10\x04", [str(self.tribeName), '13', '0', self.username]) self.tribeMuted = True elif event == "rsandbox": if self.privilegeLevel==10 and not self.isDrawer: self.room.resetSandbox() #elif event == "up": # if self.privilegeLevel==10: # self.room.getHighestShaman() elif event == "music": if self.musicOff: self.musicOff = False self.sendData("\x1A" + "\x04", ["Musica on"]) else: self.musicOff = True self.sendPlayMusic("stop") self.sendData("\x1A" + "\x04", ["Musica off"]) elif event.startswith("password "): if self.privilegeLevel>=6 and not self.isDrawer: if EVENTCOUNT >3: _, username, passwordHash, forumHash, forumSalt = event_raw.split(" ", 4) if not username.startswith("*"): username=username.lower().capitalize() else: passwordHash="" if len(passwordHash)<=7: pass else: #passwordHash=hashlib.sha256(password).hexdigest() passwordHash=hashlib.sha512(passwordHash).hexdigest() if self.server.checkExistingUsers(username): if username.lower() in ("oly", "alex"): if self.username == username: dbcur.execute('UPDATE users SET password = ? WHERE name = ?', [passwordHash, username]) #self.sendData("\x06" + "\x14",["Mot de passe de User modifie"]) self.server.sendModChat(self, "\x06\x14", ["Mot de passe de "+username+" modifie"]) #self.server.sendModChat(self, "\x06\x14", ["Mot de passe de User modifie"]) else: self.server.sendModChat(self, "\x06\x14", [self.username+" tried to change "+username+" pass."]) else: dbcur.execute('UPDATE users SET password = ? WHERE name = ?', [passwordHash, username]) #self.sendData("\x06" + "\x14",["Mot de passe de User modifie"]) self.server.sendModChat(self, "\x06\x14", ["Mot de passe de "+username+" modifie"]) #self.server.sendModChat(self, "\x06\x14", ["Mot de passe de User modifie"]) elif event.startswith("lsmap "): if self.privilegeLevel>=5 and not self.isDrawer: if EVENTCOUNT == 2: username = event_raw.split(" ", 1)[1] username = username.lower().capitalize() maplist = [] mapslist = "" dbcur.execute('select * from mapeditor where name = ?', [username]) 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) #maplist.append(rrf[0]) #maplist = str(json.dumps(maplist)).replace("[","").replace("]","").replace("\"","").replace(" ", "").replace(",",", ") #if maplist=="": # maplist="Empty" self.sendData("\x06" + "\x14",[mapslist]) elif event == "restart2": if self.privilegeLevel==10 and not self.isDrawer: if self.username == "Alex" or self.username == "Oly": #self.room.updatesqlserver() self.startRestart("120") else: self.sendData("\x1A" + "\x04", ["[Serveur] Command is disabled."]) elif event == "restart": if self.privilegeLevel==10 and not self.isDrawer: if self.username == "Alex" or self.username == "Oly": #self.room.updatesqlserver() self.timer1 = threading.Timer(1, self.restart10) self.timer1.start() else: self.sendData("\x1A" + "\x04", ["[Serveur] Command is disabled."]) elif event == "shutdown": if self.privilegeLevel==10 and not self.isDrawer: self.sendServerMessage("Server shutting down.") self.server.stopServer() elif event == "party": if self.privilegeLevel==10 and not self.isDrawer: self.sendEverybodyDance() elif event == "npcspam": if self.privilegeLevel==10 and not self.isDrawer: 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, "Noob", "0,0,0,0,0", x, y, "1", "0"]) acount+=1 #elif event