self.room.isCustom: print '%s is now perm'%(self.room.customMap) self.room.informAll(TransformiceClientHandler.sendMapPerm, []) dbcur.execute('UPDATE mapeditor set perma = ? WHERE code = ?', ["0", str(self.room.customMap)]) self.sendServeurMessage("[%s] O mapa %s nao e mais permanente."%(self.username,str(self.room.customMap))) #elif event == "killall": #if self.privilegeLevel==10: #self.room.killAll() elif event == "np" or event == "map": if self.privilegeLevel>=3 and not self.isDrawer: self.room.killAll() elif event == "sy?": if self.privilegeLevel>=5 and not self.isDrawer: player = self.room.getPlayerName(self.room.currentSyncroniserCode) self.sendData("\x1A" + "\x04", ["[Serveur] Sync in cours: %s"%(player)]) elif event == "csr": if self.privilegeLevel==10 and not self.isDrawer: self.room.changeSyncroniserRandom() elif event == "log": if self.privilegeLevel>=5 and not self.isDrawer: #user, ip, who, hours, reason self.sendData("\x1A" + "\x17", ["Log em Construcao!"]) elif event in ("vote"): if self.privilegeLevel==10 and not self.isDrawer: self.sendVoteBox("Oly", 50, 0) else: pass elif event in ("greetingz"): if self.privilegeLevel==10 and not self.isDrawer: self.sendChangeGreeting() else: pass elif event in ("conjuration"): self.sendDestroyConjurationz() elif event in ("players", "ls"): if self.privilegeLevel>=5 and not self.isDrawer: #self.sendAdminMessageChannel("Server", "There are %s users online" % (self.server.getConnectedPlayerCount())) self.sendData("\x1A" + "\x04", ["[Serveur] Players online: %s" % (self.server.getConnectedPlayerCount())]) elif event in ("lsplayers"): if self.privilegeLevel>=5 and not self.isDrawer: self.sendData("\x1A" + "\x04", ["[Serveur] "+self.server.getConnectedPlayers()]) elif event in ("lsrooms"): if self.privilegeLevel>=5 and not self.isDrawer: self.sendData("\x1A" + "\x04", ["[Serveur] "+self.server.getConnectedRooms()]) elif event in ("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 = []