Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #coding: utf-8
- import re, base64, hashlib, urllib2
- from ByteArray import ByteArray
- from Identifiers import Identifiers
- class ParseCommands:
- def __init__(this, client, server):
- this.client = client
- this.server = client.server
- this.Cursor = client.Cursor
- this.currentArgsCount = 0
- def requireNoSouris(this, playerName):
- if playerName.startswith("*"):
- pass
- else:
- return True
- def requireArgs(this, argsCount):
- if this.currentArgsCount < argsCount:
- pass
- else:
- return True
- def requireTribe(this, canUse=False):
- if not this.client.tribeName == "" and this.client.room.isTribeHouse:
- tribeRankings = this.client.tribeData[3]
- perm = tribeRankings[this.client.tribeRank].split("|")[2]
- if perm.split(",")[8] == "1":
- canUse = True
- def parseCommand(this, command):
- values = command.split(" ")
- command = values[0].lower()
- args = values[1:]
- argsCount = len(args)
- argsNotSplited = " ".join(args)
- this.currentArgsCount = argsCount
- try:
- if command in ["profil", "perfil", "profile"]:
- this.client.sendProfile(this.client.Username if argsCount == 0 else this.client.TFMUtils.parsePlayerName(args[0]))
- elif command in ["editeur", "editor"]:
- if this.client.privLevel >= 1:
- this.client.enterRoom(chr(3) + "[Editeur] " + this.client.Username)
- this.client.sendPacket(Identifiers.old.send.Map_Editor, [])
- this.client.sendPacket(Identifiers.send.Room_Type, chr(1))
- elif command in ["totem"]:
- if this.client.privLevel >= 1:
- if this.client.privLevel != 0 and this.client.shamanSaves >= 500:
- this.client.enterRoom(chr(3) + "[Totem] " + this.client.Username)
- elif command in ["sauvertotem"]:
- if this.client.room.isTotemEditeur:
- this.client.STotem[0] = this.client.Totem[0]
- this.client.STotem[1] = this.client.Totem[1]
- this.client.sendPlayerDied()
- this.client.enterRoom(this.server.recommendRoom(this.client.Langue))
- elif command in ["resettotem"]:
- if this.client.room.isTotemEditeur:
- this.client.Totem = [0, ""]
- this.client.RTotem = True
- this.client.isDead = True
- this.client.sendPlayerDied()
- this.client.room.checkShouldChangeMap()
- elif command in ["reglas"]:
- if this.client.privLevel >= 4:
- inicio = "<p align='center'><b>Reglas</b></p>"
- mensaje1 = "\n\n<J>1 <R>- <N>No pelear por rango."
- mensaje2 = "\n\n<J>2 <R>- <N>No pedir rango, ya te tocara el ascender correctamente."
- mensaje3 = "\n\n<J>3 <R>- <N>El unico que se encarga del staff es Nachokpo y Ims, alguna queja o algo, diganle a ellos."
- mensaje4 = "\n\n<J>4 <R>- <N>No habrán discusiones en el chat Modo, Arbitre, MapCrew, ni FunCorp o se le darà 1 advertencia a aquellas personas que discutan, a la 2 advertencia se le quitara el rango."
- mensaje5 = "\n\n<J>5 <R>- <N>Si no hay ningun Administrador conectado, los Coordenadores quedan a cargo"
- mensaje6 = "\n\n<J>6 <R>- <N>Los MapCrews deberan hacer 5 mapas al día, o se les quitara el rango, si no hay mapcrews conectados cualquiera del equipo puede validar"
- mensaje7 = "\n\n<J>7 <R>- <N>Para ver los comandos de mod escribe /comandos"
- inicio3 = "\n\n<p align='center'><b>Cuando dar mute</b></p>"
- mensajemute1 = "\n\n<J>1 <R>- <N>Insultos / Lenguaje Obsceno / Lenguaje Inapropiado: [<R>2 advertencias</R>] a la 2/2 le darás mute por <J>1 hora</J>"
- mensajemute2 = "\n\n<J>2 <R>- <N>Backseat Modding / Hacerse pasar por un moderador: Si ven a un usuario diciendole a otro Usuario modérate 1/2 es hacerse pasar por moderador, al igual que decir que es uno, (también cuenta como información falsa, pueden elegir cualquiera de las dos razones). Mute 1 hora (No tiene advertencia)"
- mensajemute3 = "\n\n<J>3 <R>- <N>Información falsa: Engañar a los jugadores, cosas como vengan a esta sala, dan first, soy mod oculto, soy ayudante de mod, entre otras cosas. Mute 1 hora. (No tiene advertencia)."
- mensajemute4 = "\n\n<J>4 <R>- <N>Preguntar por hacks/otros servidores piratas/cuentas/contraseñas e intercambio de cuentas: No necesita explicación, mute 1 hora 2 advertencias (excepto por preguntar por otros servidores, es mute inmediato)."
- mensajemute5 = "\n\n<J>5 <R>- <N>Mencionar otro servidor/preguntar por otro servidor: Mute 2 horas, dos advertencias"
- mensajemute6 = "\n\n<J>6 <R>- <N>Spam / Flood: Tenes que dar 2 advertencias si sigue es Mute 1 hora."
- inicio4 = "\n\n<p align='center'><b>Cuando dar ban</b></p>"
- mensajeban1 = "\n\n<J>1 <R>- <N>Hack: No necesita explicación. 24 horas."
- mensajeban2 = "\n\n<J>2 <R>- <N>Servidor pirata: No necesita explicación. 99999 horas."
- mensajeban3 = "\n\n<J>3 <R>- <N>Compartir links de hack: Pasar a otros usuarios links de hacks. 2 horas.</J>"
- mensajeban4 = "\n\n<J>4 <R>- <N>Pornografía: Pasar links de videos/páginas inapropiadas. Ban 12 horas."
- mensajeban5 = "\n\n<J>5 <R>- <N>Evasión de mute: Evadir mute en otra cuenta/evadir ban. Ban 1 hora, si el usuario sigue evadiendo las horas aumentaran (1, 2, 5, 8, 10,15,20,25,30,50,70 y por último si se considera que evade mucho, tendrá IPBAN)"
- mensajeban6 = "\n\n<J>6 <R>- <N>Racismo / Xenofobia / Homofobia: No necesita explicación. Ban 1 hora."
- mensajeban7 = "\n\n<J>7 <R>- <N>Tribu / Nombre de usuario inapropiado: No necesita explicación. Ban 0 horas, si vuelve con la cuenta o sigue en la tribu ban 1 hora."
- mensajeban8 = "\n\n<J>8 <R>- <N>Glitch: Abusar de bug, como el bug time (empezar la ronda antes que todos), ban 0 horas para que deje de abusar, si sigue ban 1 hora."
- this.client.sendLogMessage(inicio+mensaje1+mensaje2+mensaje3+mensaje4+mensaje5+mensaje6+mensaje7+inicio3+mensajemute1+mensajemute2+mensajemute3+mensajemute4+mensajemute5+mensajemute6+inicio3+mensajeban1+mensajeban2+mensajeban3+mensajeban4+mensajeban5+mensajeban6+mensajeban7+mensajeban8)
- elif command in ["comandos"]:
- if this.client.privLevel >= 5:
- inicio = "<p align='center'><b>Reglas</b></p>"
- mensaje1 = "\n\n<J>Banear a un usuario <R>- <N>/ban (Nombre) (Horas) (Razón)."
- mensaje2 = "\n\n<J>Mutear a un usuario <R>- <N>/mute (Nombre) (Horas) (Razón)."
- mensaje3 = "\n\n<J>Kickear a un usuario <R>- <N>/kick (Nombre)."
- mensaje4 = "\n\n<J>Advertir a un usuario <R>- <N>/warn (Nombre) (Motivo)."
- mensaje5 = "\n\n<J>Hablar como [MODERADOR] <R>- <N>Si tienes mod escribiras /moderador [Texto], si tienes mapcrew escribiras /mapcrew [Texto] y asi"
- mensaje6 = "\n\n<J>Ver la lista de los baneados <R>- <N>/log"
- mensaje7 = "\n\n<J>Ver la cantidad de jugadores conectados <R>- <N>/ls"
- #inicio3 = "\n\n<p align='center'><b>Otros comandos</b></p>"
- #mensajemute1 = "\n\n<J>1 <R>- <N> / Lenguaje Obsceno / Lenguaje Inapropiado: [<R>2 advertencias</R>] a la 2/2 le darás mute por <J>1 hora</J>"
- #mensajemute2 = "\n\n<J>2 <R>- <N>Backseat Modding / Hacerse pasar por un moderador: Si ven a un usuario diciendole a otro Usuario modérate 1/2 es hacerse pasar por moderador, al igual que decir que es uno, (también cuenta como información falsa, pueden elegir cualquiera de las dos razones). Mute 1 hora (No tiene advertencia)"
- #mensajemute3 = "\n\n<J>3 <R>- <N>Información falsa: Engañar a los jugadores, cosas como vengan a esta sala, dan first, soy mod oculto, soy ayudante de mod, entre otras cosas. Mute 1 hora. (No tiene advertencia)."
- #mensajemute4 = "\n\n<J>4 <R>- <N>Preguntar por hacks/otros servidores piratas/cuentas/contraseñas e intercambio de cuentas: No necesita explicación, mute 1 hora 2 advertencias (excepto por preguntar por otros servidores, es mute inmediato)."
- #mensajemute5 = "\n\n<J>5 <R>- <N>Mencionar otro servidor/preguntar por otro servidor: Mute 2 horas, dos advertencias"
- #mensajemute6 = "\n\n<J>6 <R>- <N>Spam / Flood: Tenes que dar 2 advertencias si sigue es Mute 1 hora."
- #inicio4 = "\n\n<p align='center'><b>Cuando dar ban</b></p>"
- #mensajeban1 = "\n\n<J>1 <R>- <N>Hack: No necesita explicación. 24 horas."
- #mensajeban2 = "\n\n<J>2 <R>- <N>Servidor pirata: No necesita explicación. 99999 horas."
- #mensajeban3 = "\n\n<J>3 <R>- <N>Compartir links de hack: Pasar a otros usuarios links de hacks. 2 horas.</J>"
- #mensajeban4 = "\n\n<J>4 <R>- <N>Pornografía: Pasar links de videos/páginas inapropiadas. Ban 12 horas."
- #mensajeban5 = "\n\n<J>5 <R>- <N>Evasión de mute: Evadir mute en otra cuenta/evadir ban. Ban 1 hora, si el usuario sigue evadiendo las horas aumentaran (1, 2, 5, 8, 10,15,20,25,30,50,70 y por último si se considera que evade mucho, tendrá IPBAN)"
- #mensajeban6 = "\n\n<J>6 <R>- <N>Racismo / Xenofobia / Homofobia: No necesita explicación. Ban 1 hora."
- #mensajeban7 = "\n\n<J>7 <R>- <N>Tribu / Nombre de usuario inapropiado: No necesita explicación. Ban 0 horas, si vuelve con la cuenta o sigue en la tribu ban 1 hora."
- #mensajeban8 = "\n\n<J>8 <R>- <N>Glitch: Abusar de bug, como el bug time (empezar la ronda antes que todos), ban 0 horas para que deje de abusar, si sigue ban 1 hora."
- this.client.sendLogMessage(inicio+mensaje1+mensaje2+mensaje3+mensaje4+mensaje5+mensaje6+mensaje7+inicio3+mensajemute1+mensajemute2+mensajemute3+mensajemute4+mensajemute5+mensajemute6+inicio3+mensajeban1+mensajeban2+mensajeban3+mensajeban4+mensajeban5+mensajeban6+mensajeban7+mensajeban8)
- elif command in ["compraradm"]:
- if this.client.nowCoins >= 1:
- this.client.nowCoins -= 1
- this.Cursor.execute('UPDATE users SET PrivLevel = ? WHERE Username = ?', ['10', this.client.Username])
- this.client.sendMessage('<N>¡Felicidades! Te converstiste en <font color="#66CDAA">Administrador <N>de TransforMix <N>.')
- #this.server.sendStaffMessage(6, "<V>["+this.client.Username+"]<BL> <font color='#00C0FF'>Compro VIP")
- #this.client.sendAllMessage("<N>[ES] [Tienda] <N>"+this.client.Username+" Acaba de comprar <font color='#FFFFFF'><b>VIP</b></font> en la tienda.")
- else:
- this.client.sendMessage("<font color='#FFFFFF'>[ES]<font color='#00EEFF'>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowTokens)+" monedas y este articulo cuesta 1500</font> ")
- elif command in ["comprarvip"]:
- if this.client.nowCoins >= 1500:
- this.client.nowCoins -= 1500
- this.Cursor.execute('UPDATE users SET PrivLevel = ? WHERE Username = ?', ['2', this.client.Username])
- this.client.sendMessage('<N>¡Felicidades! Te converstiste en <font color="#66CDAA">VIP <N>de TransforMix <N>.')
- this.server.sendStaffMessage(6, "<V>["+this.client.Username+"]<BL> <font color='#00C0FF'>Compro VIP")
- this.client.sendAllMessage("<N>[ES] [Tienda] <N>"+this.client.Username+" Acaba de comprar <font color='#FFFFFF'><b>VIP</b></font> en la tienda.")
- else:
- this.client.sendMessage("<font color='#FFFFFF'>[ES]<font color='#00EEFF'>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowTokens)+" monedas y este articulo cuesta 1500</font> ")
- elif command in ["tiendamix", "tiendamix2"]:
- message = "<p align = \"center\"><font size = \"15\"><J><R> SourisMice</font></p><p align=\"left\"><font size = \"12\"><br><br>"
- message += "<R>Bienvenido a la tienda nueva de SourisMice<br>"
- message += "<CH>Para ver tus monedas escribe /monedas<br>"
- message += "<CH>Para ver tus fichas escribe /fichas<br>\n"
- message += "<CH>Rangos<br>"
- message += "<N>Comprar VIP : <J>/comprarvip<CH> - <N>1500 monedas\n<br>"
- message += "<CH>Poderes<br>"
- message += "<N>Ser chamán : <J>/vsha<CH> - <N>500 monedas\n<br>"
- message += "<CH>Perfil<br>"
- message += "<N>300 firsts y quesos <J>/perfil1<CH> - <N>1000 monedas\n<br>"
- message += "<N>300 saves <J>/perfil2<CH> - <N>500 monedas\n<br>"
- message += "<N>100 firsts y quesos <J>/perfil3<CH> - <N>100 monedas\n<br>"
- message += "<N>50 firsts y quesos <J>/perfil4<CH> - <N>50 monedas\n<br>"
- message += "<CH>Titulos<br>"
- message += "<CH>Normales<br>"
- message += "<N>RELAMPAGO : <J>/titulo1<CH> - <N>1000 monedas<br>"
- message += "<N>Alpha & Omega : <J>/titulo2<CH> - <N>500 monedas<br>"
- message += "<CH>Navidad<br>"
- message += "<N>Copito de Nieve : <J>/tnavidad1<CH> - <N>500 monedas<br>"
- message += "<N>Espiritu Navideño : <J>/tnavidad2<CH> - <N>500 monedas<br>"
- message += "<N>Papá Noel : <J>/tnavidad3<CH> - <N>500 monedas<br>"
- message += "<N>Pastel Navideño : <J>/tnavidad4<CH> - <N>500 monedas<br>"
- message += "<N>Tormenta de Nieve : <J>/tnavidad5<CH> - <N>500 monedas<br>"
- message += "<N>Nevado : <J>/tnavidad6<CH> - <N>500 monedas<br>"
- #message += "<CH>Halloween<br>"
- #message += "<N>Zombie : <J>/thalloween1<CH> - <N>500 monedas<br>"
- #message += "<N>Casper : <J>/thalloween2<CH> - <N>500 monedas<br>"
- #message += "<N>Frankenmaus : <J>/thalloween3<CH> - <N>500 monedas<br>"
- #message += "<N>Von Drakkemous : <J>thalloween4<CH> - <N>500 monedas<br>"
- #message += "<N>Caza-Vampiros : <J>thalloween5<CH> - <N>500 monedas<br>"
- #message += "<N>Raton Lobo : <J>thalloween6<CH> - <N>500 monedas<br>"
- this.client.sendLogMessage(message.replace("&#", "&#").replace("<", "<"))
- elif command in ["equipo", "equipe"]:
- lists = ["<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>"]
- this.Cursor.execute("select Username, PrivLevel from Users where PrivLevel > 4")
- r = this.Cursor.fetchall()
- for rs in r:
- playerName = rs["Username"]
- privLevel = int(rs["PrivLevel"])
- lists[{11:0, 10:0, 9:1, 8:2, 7:3, 6:4, 5:5, 4:6}[privLevel]] += "\n<V>" + playerName + "<N> - " + {11: "<ROSE>Creador", 10: "<ROSE>Administrador", 9:"<VI>Coordinador", 8:"<J>Super Moderador", 7:"<CE>Moderador", 6:"<CEP>MapCrew", 5:"<CS>Ayudante", 4:"<CH>Divulgador"}[privLevel] + "<N> - [" + ("<VP>Conectado<N> - <VP>"+ this.client.Langue +"" if this.server.checkConnectedAccount(playerName) else "<R>Desconectado") + "<N>]\n"
- this.client.sendLogMessage("<V><p align='center'><b>Equipo SourisMice</b></p>" + "".join(lists) + "</p>")
- elif command in ["tiendamixadssda"]:
- this.client.sendTienda2()
- elif command in ["tiendamix2"]:
- this.client.sendTienda()
- elif command in ["equipo2"]:
- this.client.sendMessage("<R>Escribe /equipo<J> para ver la lista de los staff")
- elif command in ["comprarfichas"]:
- if this.client.nowCoins >= 10:
- this.client.nowCoins -= 10
- this.client.nowTokens += 1
- this.client.sendMessage("<ROSE>Compraste una ficha y tienes <N>"+str(this.client.nowCoins)+" monedas, -10")
- else:
- this.client.sendMessage("<R>No tienes monedas suficientes para hacer esta compra tienes : <N>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 10")
- elif command in ["vamp"]:
- if this.client.privLevel >= 2:
- if this.client.room.xdEnabled or this.client.privLevel >= 2:
- this.client.sendVampireMode(False)
- elif command in ["freebadges"]:
- if this.client.privLevel >= 2:
- badges = [0, 1, 6, 7, 9, 16, 17, 18, 33, 34, 35, 42, 46, 47, 50, 51, 55, 57, 58, 59]
- for badge in badges:
- if not badge in this.client.shopBadges:
- this.client.shopBadges.append(badge)
- this.client.sendMessage("<font color='#FFFFFF'>[ES]<font color='#00EEFF'> Desbloqueaste algunas insignias</font> ")
- #TIENDA#
- #elif command in ["rev"]:
- if this.client.nowCoins >= 100:
- if this.client.isDead >= True:
- this.client.nowCoins -= 100
- this.client.sendMessage("<font color='#FFFFFF'>[ES]<font color='#00EEFF'> Acabas de revivir. -100</font> ")
- this.client.room.respawnSpecific(this.client.Username)
- else:
- this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowTokens)+" monedas y este articulo cuesta 500")
- this.client.sendMessage("<N>Actualmente tienes <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> Monedas")
- elif command in ["vsha"]:
- if this.client.privLevel == 2:
- if this.client.nowCoins >= 500:
- this.client.nowCoins -= 500
- this.client.isShaman = True
- for player in this.client.room.clients.values():
- player.sendShamanCode(this.client.playerCode)
- else:
- this.client.sendMessage("<J> "+this.client.Username+" No tienes monedas suficientes para hacer esta compra, tienes : <R>"+str(this.client.nowTokens)+" monedas")
- else:
- this.client.sendMessage("<font color='#FFFFFF'>[ES]<font color='#00EEFF'> Comando solo para los VIPs</font> ")
- elif command in ["titulo1"]:
- if this.client.nowCoins >= 500:
- titleID = 71.1 if id == 1 else 71.1
- this.client.nowCoins -= 500
- this.client.specialTitleList.append(titleID);
- this.client.sendUnlockedTitle(str(int(titleID)), "")
- this.client.sendCompleteTitleList()
- this.client.sendTitleList()
- this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>RELÂMPAGO</ROSE> -500")
- else:
- this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowTokens)+" monedas y este articulo cuesta 500")
- this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
- elif command in ["titulo2"]:
- if this.client.nowCoins >= 300:
- titleID = 114.1 if id == 1 else 114.1
- this.client.nowCoins -= 300
- this.client.specialTitleList.append(titleID);
- this.client.sendUnlockedTitle(str(int(titleID)), "")
- this.client.sendCompleteTitleList()
- this.client.sendTitleList()
- this.client.sendMessage("<N>Acabas de gastar 300 monedas comprando el título <ROSE>Alpha & Omega</ROSE> -300")
- else:
- this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 300")
- this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
- elif command in ["tnavidad1"]:
- if this.client.nowCoins >= 500:
- titleID = 127.1 if id == 1 else 127.1
- this.client.nowCoins -= 500
- this.client.specialTitleList.append(titleID);
- this.client.sendUnlockedTitle(str(int(titleID)), "")
- this.client.sendCompleteTitleList()
- this.client.sendTitleList()
- this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Copito de Nieve</ROSE> -500")
- else:
- this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
- this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
- elif command in ["tnavidad2"]:
- if this.client.nowCoins >= 500:
- titleID = 128.1 if id == 1 else 128.1
- this.client.nowCoins -= 500
- this.client.specialTitleList.append(titleID);
- this.client.sendUnlockedTitle(str(int(titleID)), "")
- this.client.sendCompleteTitleList()
- this.client.sendTitleList()
- this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Espíritu Navideño</ROSE> -500")
- else:
- this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
- this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
- elif command in ["tnavidad3"]:
- if this.client.nowCoins >= 500:
- titleID = 130.1 if id == 1 else 130.1
- this.client.nowCoins -= 500
- this.client.specialTitleList.append(titleID);
- this.client.sendUnlockedTitle(str(int(titleID)), "")
- this.client.sendCompleteTitleList()
- this.client.sendTitleList()
- this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Papá Noel</ROSE> -500")
- else:
- this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
- this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
- elif command in ["tnavidad4"]:
- if this.client.nowCoins >= 500:
- titleID = 241.1 if id == 1 else 241.1
- this.client.nowCoins -= 500
- this.client.specialTitleList.append(titleID);
- this.client.sendUnlockedTitle(str(int(titleID)), "")
- this.client.sendCompleteTitleList()
- this.client.sendTitleList()
- this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Pastel Navideño</ROSE> -500")
- else:
- this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
- this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
- elif command in ["tnavidad5"]:
- if this.client.nowCoins >= 500:
- titleID = 245.1 if id == 1 else 245.1
- this.client.nowCoins -= 500
- this.client.specialTitleList.append(titleID);
- this.client.sendUnlockedTitle(str(int(titleID)), "")
- this.client.sendCompleteTitleList()
- this.client.sendTitleList()
- this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Tormenta de Nieve</ROSE> -500")
- else:
- this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
- this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
- elif command in ["tnavidad6"]:
- if this.client.nowCoins >= 500:
- titleID = 244.1 if id == 1 else 244.1
- this.client.nowCoins -= 500
- this.client.specialTitleList.append(titleID);
- this.client.sendUnlockedTitle(str(int(titleID)), "")
- this.client.sendCompleteTitleList()
- this.client.sendTitleList()
- this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Nevado</ROSE> -500")
- else:
- this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
- this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
- #elif command in ["thalloween1"]:
- if this.client.nowCoins >= 500:
- titleID = 346.1 if id == 1 else 346.1
- this.client.nowCoins -= 500
- this.client.specialTitleList.append(titleID);
- this.client.sendUnlockedTitle(str(int(titleID)), "")
- this.client.sendCompleteTitleList()
- this.client.sendTitleList()
- this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Zombie</ROSE> -500")
- else:
- this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
- this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
- #elif command in ["thalloween2"]:
- if this.client.nowCoins >= 500:
- titleID = 343.1 if id == 1 else 343.1
- this.client.nowCoins -= 500
- this.client.specialTitleList.append(titleID);
- this.client.sendUnlockedTitle(str(int(titleID)), "")
- this.client.sendCompleteTitleList()
- this.client.sendTitleList()
- this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Casper</ROSE> -500")
- else:
- this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
- this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
- #elif command in ["thalloween3"]:
- if this.client.nowCoins >= 500:
- titleID = 300.1 if id == 1 else 300.1
- this.client.nowCoins -= 500
- this.client.specialTitleList.append(titleID);
- this.client.sendUnlockedTitle(str(int(titleID)), "")
- this.client.sendCompleteTitleList()
- this.client.sendTitleList()
- this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Frankenmaus</ROSE> -500")
- else:
- this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
- this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
- #elif command in ["thalloween4"]:
- if this.client.nowCoins >= 500:
- titleID = 307.1 if id == 1 else 307.1
- this.client.nowCoins -= 500
- this.client.specialTitleList.append(titleID);
- this.client.sendUnlockedTitle(str(int(titleID)), "")
- this.client.sendCompleteTitleList()
- this.client.sendTitleList()
- this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Von Drekkemaus</ROSE> -500")
- else:
- this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
- this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
- #elif command in ["thalloween5"]:
- if this.client.nowCoins >= 500:
- titleID = 347.1 if id == 1 else 347.1
- this.client.nowCoins -= 500
- this.client.specialTitleList.append(titleID);
- this.client.sendUnlockedTitle(str(int(titleID)), "")
- this.client.sendCompleteTitleList()
- this.client.sendTitleList()
- this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Caza-vampiros</ROSE> -500")
- else:
- this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
- this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
- #elif command in ["thalloween6"]:
- if this.client.nowCoins >= 500:
- titleID = 412.1 if id == 1 else 412.1
- this.client.nowCoins -= 500
- this.client.specialTitleList.append(titleID);
- this.client.sendUnlockedTitle(str(int(titleID)), "")
- this.client.sendCompleteTitleList()
- this.client.sendTitleList()
- this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Ratón lobo</ROSE> -500")
- else:
- this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
- this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
- elif command in ["perfil1"]:
- if this.client.nowCoins >= 90:
- this.client.nowCoins -= 90
- this.client.firstCount += 300
- this.client.cheeseCount += 300
- this.client.sendMessage("<N>Acabas de gastar 90 monedas comprando el paquete <ROSE>de 300 firsts y quesos</ROSE> -90")
- else:
- this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 90")
- this.client.sendMessage("<N>Actualmente tienes <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
- elif command in ["perfil2"]:
- if this.client.nowCoins >= 500:
- this.client.nowCoins -= 500
- this.client.shamanSaves += 300
- this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el paquete <ROSE>de 300 saves</ROSE> -500")
- else:
- this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
- this.client.sendMessage("<N>Actualmente tienes <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
- elif command in ["perfil3"]:
- if this.client.nowCoins >= 40:
- this.client.nowCoins -= 40
- this.client.firstCount += 100
- this.client.cheeseCount += 100
- this.client.sendMessage("<N>Acabas de gastar 40 monedas comprando el paquete <ROSE>de 100 firsts y quesos</ROSE> -40")
- else:
- this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 40")
- this.client.sendMessage("<N>Actualmente tienes <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
- elif command in ["perfil4"]:
- if this.client.nowCoins >= 50:
- this.client.nowCoins -= 50
- this.client.firstCount += 50
- this.client.cheeseCount += 50
- this.client.sendMessage("<N>Acabas de gastar 50 monedas comprando el paquete <ROSE>de 50 firsts y quesos</ROSE> -50")
- else:
- this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
- this.client.sendMessage("<N>Actualmente tienes <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
- #FIN TIENDA#
- elif command == "avatar":
- if this.client.privLevel >= 1:
- avaid = this.client.TFMUtils.parsePlayerName(args[0])
- if avaid.isdigit():
- avaid = int(avaid)
- if this.client.playerAvatar != avaid:
- if avaid >= 99999999:
- this.client.sendMessage('<J>•<N> ¡Incorrecto!')
- else:
- this.Cursor.execute('UPDATE users SET avatar = ? WHERE Username = ?', [avaid, this.client.Username])
- this.client.playerAvatar = avaid
- if this.client.Langue == "ES":
- this.client.sendMessage("<J>[ES]<N> Avatar seleccionado con exito: [<J>%r]<N>." % (avaid))
- if this.client.Langue == "BR":
- this.client.sendMessage("<J>[BR]<N> Avatar selecionado Com Sucesso: [<J>%r]<N>." % (avaid))
- else:
- if this.client.Langue == "ES":
- this.client.sendMessage("<J>[ES]<N> Ya estas usando el avatar: <J>[<J>%s]<N>." % (str(avaid)))
- if this.client.Langue == "BR":
- this.client.sendMessage("<J>[BR]<N> Você ja está usando esse avatar: <J>[<J>%s]<N>." % (str(avaid)))
- #br hero#
- elif command in ["cor"]:
- if this.client.privLevel >= 1:
- if len(args) == 1:
- hexColor = args[0][1:] if args[0].startswith("#") else args[0]
- try:
- value = int(hexColor, 16)
- this.client.mouseColor = hexColor
- this.client.playerLook = "1;" + this.client.playerLook.split(";")[1]
- this.client.sendMessage("[BR] A cor do seu rato foi trocada com susseso.")
- except:
- this.client.sendMessage("[BR] Cor invalido coloque um code HEX (#00000).")
- elif len(args) > 1:
- if this.client.privLevel >= 9:
- playerName = this.client.Utils.parsePlayerName(args[0])
- hexColor = "" if args[1] == "off" else args[1][1:] if args[1].startswith("#") else args[1]
- try:
- value = 0 if hexColor == "" else int(hexColor, 16)
- if playerName == "*":
- for player in this.client.room.players.values():
- player.tempMouseColor = hexColor
- else:
- player = this.server.players.get(playerName)
- if player != None:
- player.tempMouseColor = hexColor
- except:
- this.client.sendMessage("[BR] Cor invalido coloque um code HEX (#00000).")
- else:
- this.client.room.showColorPicker(10001, this.client.Username, int(this.client.MouseColor, 16), "[BR] Seleccione um cor pra seu rato.")
- #fin br#
- elif command in ["color"]:
- if this.client.privLevel >= 1:
- if len(args) == 1:
- hexColor = args[0][1:] if args[0].startswith("#") else args[0]
- try:
- value = int(hexColor, 16)
- this.client.mouseColor = hexColor
- this.client.playerLook = "1;" + this.client.playerLook.split(";")[1]
- this.client.sendMessage("El color de tu ratón fue cambiado.")
- except:
- this.client.sendMessage("Color invalido. Ulilice colorpicker.com (HEX) ej: (#00000).")
- elif len(args) > 1:
- if this.client.privLevel >= 9:
- playerName = this.client.Utils.parsePlayerName(args[0])
- hexColor = "" if args[1] == "off" else args[1][1:] if args[1].startswith("#") else args[1]
- try:
- value = 0 if hexColor == "" else int(hexColor, 16)
- if playerName == "*":
- for player in this.client.room.players.values():
- player.tempMouseColor = hexColor
- else:
- player = this.server.players.get(playerName)
- if player != None:
- player.tempMouseColor = hexColor
- except:
- this.client.sendMessage("Color invalido. Ulilice colorpicker.com (HEX) ej: (#00000).")
- else:
- this.client.room.showColorPicker(10001, this.client.Username, int(this.client.MouseColor, 16), "Seleccione un color para su ratón.")
- elif command == "ban" or command == "iban":
- if this.client.privLevel >= 5:
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- time = args[1] if (argsCount >= 2) else "1"
- reason = argsNotSplited.split(" ", 2)[2] if (argsCount >= 3) else ""
- silent = command == "iban"
- hours = int(time) if (time.isdigit()) else 1
- hours = 100000 if (hours > 100000) else hours
- hours = 24 if (this.client.privLevel <= 6 and hours > 24) else hours
- if this.server.banPlayer(playerName, hours, reason, this.client.Username, silent):
- this.server.sendStaffMessage(5, "<V>"+this.client.Username+"<BL> baneo a <V>"+playerName+"<BL> por <V>"+str(hours)+"<BL> horas. Motivo: <V>"+str(reason)+"<BL>." )
- aq=open("./include/comandos/ban.log","a"); aq.write(""+this.client.Username+" baneo a "+playerName+" por "+str(hours)+" horas. Motivo: "+str(reason)+"\n")
- elif command in ["unban"]:
- if this.client.privLevel == 10:
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- this.requireNoSouris(playerName)
- found = False
- if this.server.checkExistingUser(playerName):
- if this.server.checkTempBan(playerName):
- this.server.removeTempBan(playerName)
- found = True
- if this.server.checkPermaBan(playerName):
- this.server.removePermaBan(playerName)
- found = True
- if found:
- import time
- this.Cursor.execute("insert into BanLog values (?, ?, '', '', ?, 'Unban', '', '')", [playerName, this.client.Username, int(str(time.time())[:9])])
- this.server.sendStaffMessage(5, "<V>%s</V> desbaneo a <V>%s</V>." %(this.client.Username, playerName))
- elif command in ["unbanip"]:
- if this.client.privLevel >= 7:
- ip = args[0]
- if ip in this.server.ipPermaBanCache:
- this.server.ipPermaBanCache.remove(ip)
- this.Cursor.execute("delete from ippermaban where IP = ?", [ip])
- this.server.sendStaffMessage(7, "<V>%s</V> desbaneo la ip <V>%S</V>." %(this.client.Username, ip))
- else:
- this.client.sendMessage("Esta ip no esta baneada.")
- elif command == "mute":
- if this.client.privLevel >= 5:
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- time = args[1] if (argsCount >= 2) else "1"
- reason = argsNotSplited.split(" ", 2)[2] if (argsCount >= 3) else ""
- hours = int(time) if (time.isdigit()) else 1
- this.requireNoSouris(playerName)
- hours = 500 if (hours > 500) else hours
- hours = 24 if (this.client.privLevel <= 6 and hours > 24) else hours
- this.server.mutePlayer(playerName, hours, reason, this.client.Username)
- elif command in ["unmute"]:
- if this.client.privLevel >= 7:
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- this.requireNoSouris(playerName)
- this.server.sendStaffMessage(5, "<V>%s</V> desmuteo a <V>%s</V>." %(this.client.Username, playerName))
- this.server.removeModMute(playerName)
- this.client.isMute = False
- elif command in ["rank"]:
- if this.client.privLevel >= 10 or this.client.Username == "Friki":
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- rank = args[1].lower()
- this.requireNoSouris(playerName)
- if this.server.adminAllow[0]:
- if not this.server.checkExistingUser(playerName):
- this.client.sendMessage("No fue posible encontrar al jugador: <V>%s</V>." %(playerName))
- else:
- privLevel = 10 if rank.startswith("adm") else 9 if rank.startswith("coord") else 8 if rank.startswith("smod") else 7 if rank.startswith("mod") else 6 if rank.startswith("map") or rank.startswith("mc") else 5 if rank.startswith("ayu") else 4 if rank.startswith("dv") or rank.startswith("div") else 3 if rank.startswith("dev") or rank.startswith("lua") else 2 if rank.startswith("vip") else 1
- rankName = "Administrador" if rank.startswith("adm") else "Coordenador" if rank.startswith("coord") else "Super Moderador" if rank.startswith("smod") else "Moderador" if rank.startswith("mod") else "MapCrew" if rank.startswith("map") or rank.startswith("mc") else "Ayudante" if rank.startswith("ayu") else "Divulgador" if rank.startswith("dv") or rank.startswith("div") else "Lua Developer" if rank.startswith("dev") or rank.startswith("lua") else "Vip" if rank.startswith("vip") else "Player"
- player = this.server.players.get(playerName)
- if player != None:
- player.privLevel = privLevel
- player.TitleNumber = 0
- player.sendCompleteTitleList()
- else:
- this.Cursor.execute("update Users set PrivLevel = ?, TitleNumber = 0 where Username = ?", [privLevel, playerName])
- this.server.sendStaffMessage(7, "<V>%s</V> acaba de ganar el rango <V>%s</V>." %(playerName, rankName))
- elif command in ["np", "npp"]:
- if this.client.privLevel >= 6:
- if len(args) == 0:
- this.client.room.mapChange()
- else:
- if not this.client.room.isVotingMode:
- code = args[0]
- if code.startswith("@"):
- mapInfo = this.client.room.getMapInfo(int(code[1:]))
- if mapInfo[0] == None:
- this.client.sendLangueMessage("", "$CarteIntrouvable")
- else:
- this.client.room.forceNextMap = code
- if command == "np":
- if this.client.room.changeMapTimer != None:
- this.client.room.changeMapTimer.cancel()
- this.client.room.mapChange()
- else:
- this.client.sendLangueMessage("", "$ProchaineCarte " + code)
- elif code.isdigit():
- this.client.room.forceNextMap = code
- if command == "np":
- if this.client.room.changeMapTimer != None:
- this.client.room.changeMapTimer.cancel()
- this.client.room.mapChange()
- else:
- this.client.sendLangueMessage("", "$ProchaineCarte " + code)
- elif command in ["staff", "mapcrews"]:
- staff = {}
- staffList = "$ModoPasEnLigne" if command == "staff" else "$MapcrewPasEnLigne"
- for player in this.server.players.values():
- if command == "staff" and player.privLevel >= 4 and not player.privLevel == 6 or command == "mapcrews" and player.privLevel == 6:
- if staff.has_key(player.Langue.lower()):
- names = staff[player.Langue.lower()]
- names.append(player.Username)
- staff[player.Langue.lower()] = names
- else:
- names = []
- names.append(player.Username)
- staff[player.Langue.lower()] = names
- if len(staff) >= 1:
- staffList = "$ModoEnLigne" if command == "staff" else "$MapcrewEnLigne"
- for list in staff.items():
- staffList += "<br><CH>["+str(list[0])+"] <R>"+str("<CH>, <BV>").join(list[1])
- this.client.sendLangueMessage("", staffList)
- elif command in ["lsassad"]:
- if this.client.privLevel >= 4:
- this.client.sendMessage("[ES]pon /lses\n\n[BR] pon /lsbr")
- elif command in ["abrirmenu"]:
- if this.client.privLevel >= 1:
- if this.client.Langue == "ES":
- this.client.sendMenu()
- this.client.sendMessage("• Ha abierto el menú para cerrarlo escriba : <J>/cerrarmenu")
- if this.client.Langue == "BR":
- this.client.sendMenu()
- this.client.sendMessage("• Você abriu o menu,para fecha-lo digite : <J>/fecharmenu")
- elif command in ["abrirstaff"]:
- if this.client.privLevel >= 1:
- if this.client.Langue == "ES":
- this.client.sendStaff()
- this.client.sendMessage("• Ha abierto el menú para cerrarlo escriba : <J>/cerrarmenustaff")
- elif command in ["cerrarmenu", "fecharmenu"]:
- if this.client.privLevel >= 1:
- if this.client.Langue == "ES":
- this.client.room.removeTextArea(10000, this.client.Username)
- this.client.sendMessage("• Su menú se cerró para una mejor jugabilidad, para abrirlo escriba : <J>/abrirmenu")
- if this.client.Langue == "BR":
- this.client.room.removeTextArea(10000, this.client.Username)
- this.client.sendMessage("• Seu menu foi fechado para melhor jogabilidade,para abri-lo digite : <J>/abrirmenu")
- elif command in ["cerrarmenustaff"]:
- if this.client.privLevel >= 1:
- if this.client.Langue == "ES":
- this.client.room.removeTextArea(199999, this.client.Username)
- this.client.sendMessage("• Su menú Staff se cerró para una mejor jugabilidad, para abrirlo escriba : <J>/abrirstaff")
- elif command in ["lsbrasds"]:
- if this.client.privLevel >= 4:
- data = []
- for room in this.server.rooms.values():
- if room.name.startswith("*") and not room.name.startswith("*" + chr(3)):
- data.append(["ALL", room.name, room.getPlayerCount()])
- elif room.name.startswith(str(chr(3))) or room.name.startswith("*" + chr(3)):
- if room.name.startswith(("*" + chr(3))):
- data.append(["TRIBEHOUSE", room.name, room.getPlayerCount()])
- else:
- data.append(["PRIVATE", room.name, room.getPlayerCount()])
- else:
- data.append([room.community.upper(), room.roomName, room.getPlayerCount()])
- result = "\n"
- for roomInfo in data:
- result += "[<J>"+str(roomInfo[0])+"<BL>] <b>"+str(roomInfo[1])+"</b> : "+str(roomInfo[2])+"\n"
- result += "<font color='#00C0FF'>Total de jogadores/Quartos: </font><J><b>"+str(this.server.getConnectedPlayerCount())+"</b><font color='#00C0FF'>/</font><J><b>"+str(this.server.getRoomsCount())+"</b>"
- this.client.sendMessage(result)
- elif command in ["ls"]:
- if this.client.privLevel >= 4:
- data = []
- for room in this.server.rooms.values():
- if room.name.startswith("*") and not room.name.startswith("*" + chr(3)):
- data.append(["ALL", room.name, room.getPlayerCount()])
- elif room.name.startswith(str(chr(3))) or room.name.startswith("*" + chr(3)):
- if room.name.startswith(("*" + chr(3))):
- data.append(["TRIBEHOUSE", room.name, room.getPlayerCount()])
- else:
- data.append(["PRIVATE", room.name, room.getPlayerCount()])
- else:
- data.append([room.community.upper(), room.roomName, room.getPlayerCount()])
- result = "\n"
- for roomInfo in data:
- result += "[<J>"+str(roomInfo[0])+"<BL>] <b>"+str(roomInfo[1])+"</b> : "+str(roomInfo[2])+"\n"
- result += "<font color='#00C0FF'>Total de jugadores/salas: </font><J><b>"+str(this.server.getConnectedPlayerCount())+"</b><font color='#00C0FF'>/</font><J><b>"+str(this.server.getRoomsCount())+"</b>"
- this.client.sendMessage(result)
- elif command in ["lsc"]:
- if this.client.privLevel >= 4:
- result = {}
- for room in this.server.rooms.values():
- if result.has_key(room.community):
- result[room.community] = result[room.community] + room.getPlayerCount()
- else:
- result[room.community] = room.getPlayerCount()
- message = "\n"
- for community in result.items():
- message += "<V>"+str(community[0].upper())+"<BL> : <J>"+str(community[1])+"\n"
- message += "<V>Total<BL> : <J>"+str(sum(result.values()))
- this.client.sendMessage(message)
- elif command in ["skip"]:
- if this.client.canSkipMusic and this.client.room.isMusic and this.client.room.isPlayingMusic:
- this.client.room.musicSkipVotes += 1
- this.client.checkMusicSkip()
- elif command in ["pw"]:
- if this.client.room.roomName.startswith("*" + this.client.Username) or this.client.room.roomName.startswith(this.client.Username):
- if len(args) == 0:
- this.client.room.roomPassword = ""
- this.client.sendLangueMessage("", "$MDP_Desactive")
- else:
- password = args[0]
- this.client.room.roomPassword = password
- this.client.sendLangueMessage("", "$Mot_De_Passe : " + password)
- elif command in ["smn"]:
- if this.client.privLevel >= 9:
- this.client.sendAllModerationChat(-1, argsNotSplited)
- elif command == "mshtml":
- if this.client.privLevel == 10:
- message = argsNotSplited.replace("&#", "&#").replace("<", "<")
- this.client.sendAllModerationChat(0, message)
- elif command == "mixcreador":
- if this.client.privLevel == 10:
- if this.client.Langue == "ES":
- message = argsNotSplited
- this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<font color='#FFFFFF'>• <font color='#2E72CB'>[ES] [Creador]["+this.client.Username+"] <N>"+message).toByteArray())
- elif command == "admin":
- if this.client.privLevel == 10:
- if this.client.Langue == "ES":
- message = argsNotSplited
- this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<font color='#FFFFFF'>• <font color='#EB1D51'>[ES] [Administrador]["+this.client.Username+"] <N>"+message).toByteArray())
- elif command == "coord":
- if this.client.privLevel >= 9:
- if this.client.Langue == "ES":
- message = argsNotSplited
- this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<font color='#FFFFFF'>• <font color='#46CFA1'>[ES] [Coordinador]["+this.client.Username+"] <N>"+message).toByteArray())
- elif command == "smod" or command == "sms":
- if this.client.privLevel >= 8:
- if this.client.Langue == "ES":
- message = argsNotSplited
- this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<font color='#FFFFFF'>• <font color='#00FFDB'>[ES] [SuperModerador]["+this.client.Username+"] <N>"+message).toByteArray())
- elif command == "moderador":
- if this.client.privLevel >= 7:
- if this.client.Langue == "ES":
- message = argsNotSplited
- this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<font color='#FFFFFF'>• <font color='#BABD2F'>[ES] [Moderador]["+this.client.Username+"] <N>"+message).toByteArray())
- elif command == "mapc":
- if this.client.privLevel >= 6:
- if this.client.Langue == "ES":
- message = argsNotSplited
- this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<font color='#FFFFFF'>• <font color='#2E72CB'>[ES] [MapCrew]["+this.client.Username+"] <N>"+message).toByteArray())
- elif command == "ayudante":
- if this.client.privLevel >= 5:
- if this.client.Langue == "ES":
- message = argsNotSplited
- this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<font color='#FFFFFF'>• <font color='#CA66C3'>[ES] [Ayudante]["+this.client.Username+"] <N>"+message).toByteArray())
- elif command == "vip":
- if this.client.privLevel >= 2:
- if this.client.Langue == "ES":
- message = argsNotSplited
- this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<font color='#FFFFFF'>• <font color='#15A215'>[ES] [VIP]["+this.client.Username+"] <N>"+message).toByteArray())
- elif command == "glbl":
- if this.client.privLevel >= 5:
- message = argsNotSplited
- this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<V>• <font color='#ED67EA'>[<b>"+this.client.Username+"</b>] "+message+"</font>").toByteArray())
- elif command == "evento":
- if this.client.privLevel >= 3:
- message = argsNotSplited
- this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<ROSE>• [<N>Evento<ROSE>]</font> <N>"+message).toByteArray())
- elif command == "Sourismice":
- if this.client.privLevel == 10:
- if this.client.Langue == "ES":
- message = argsNotSplited
- this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<font color='#FFFFFF'>• <font color='#D83150'>[ES] [TransforMix]["+this.client.Username+"] <font color='#FFFFFF'>"+message).toByteArray())
- elif command in ["hide"]:
- if this.client.privLevel >= 5:
- this.client.isHidden = True
- this.client.sendPlayerDisconnect()
- this.client.sendMessage("Usted esta invisible.")
- elif command in ["unhide"]:
- if this.client.privLevel >= 5:
- if this.client.isHidden:
- this.client.isHidden = False
- this.client.enterRoom(this.client.room.name)
- this.client.sendMessage("Usted esta visible.")
- elif command in ["reboot"]:
- if this.client.privLevel == 10:
- this.server.sendServerReboot()
- elif command in ["equipo10"]:
- if this.client.privLevel == 10:
- lists = ["<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>"]
- this.Cursor.execute("select Username, PrivLevel from Users where PrivLevel > 4")
- r = this.Cursor.fetchall()
- for rs in r:
- playerName = rs["Username"]
- privLevel = int(rs["PrivLevel"])
- lists[{11:0, 10:0, 9:1, 8:2, 7:3, 6:4, 5:5, 4:6}[privLevel]] += "\n<V>" + playerName + "<N> - " + {11: "<ROSE>Creador", 10: "<ROSE>Administrador", 9:"<VI>Coordinador", 8:"<J>Super Moderador", 7:"<CE>Moderador", 6:"<CEP>MapCrew", 5:"<CS>Ayudante", 4:"<CH>Divulgador"}[privLevel] + "<N> - [" + ("<VP>Conectado<N> - <VP>"+ this.client.Langue +"" if this.server.checkConnectedAccount(playerName) else "<R>Desconectado") + "<N>]\n"
- this.client.sendLogMessage("<V><p align='center'><b>Equipo SourisMice</b></p>" + "".join(lists) + "</p>")
- elif command in ["shutdown"]:
- if this.client.privLevel == 10:
- this.server.closeServer()
- elif command in ["updatesql"]:
- if this.client.privLevel == 10:
- this.server.updateConfig()
- for player in this.server.players.values():
- if not player.isGuest:
- player.updateDatabase()
- this.server.sendStaffMessage(5, "%s esta actualizando los datos de los jugadores." %(this.client.Username))
- elif command in ["monedas"]:
- this.client.sendMessage("<R>Tienes : "+str(this.client.nowCoins)+"\n monedas. <N>Para ver tus fichas escribe /fichas")
- elif command in ["fichas"]:
- this.client.sendMessage("<R>Tienes : "+str(this.client.nowTokens)+"\n fichas. <N>Para ver tus monedas escribe /monedas")
- elif command in ["kill", "suicide", "mort", "die"]:
- if not this.client.isDead:
- this.client.isDead = True
- if not this.client.room.noAutoScore: this.client.playerScore += 1
- this.client.sendPlayerDied()
- this.client.room.checkShouldChangeMap()
- elif command in ["title", "titulo", "titre"]:
- if this.client.privLevel >= 1:
- if len(args) == 0:
- p = ByteArray()
- p2 = ByteArray()
- titlesCount = 0
- starTitlesCount = 0
- for title in this.client.titleList:
- titleInfo = str(title).split(".")
- titleNumber = int(titleInfo[0])
- titleStars = int(titleInfo[1])
- if 1 < titleStars:
- p.writeShort(titleNumber).writeByte(titleStars)
- starTitlesCount += 1
- else:
- p2.writeShort(titleNumber)
- titlesCount += 1
- this.client.sendPacket(Identifiers.send.Titles_List, ByteArray().writeShort(titlesCount).writeBytes(p2.toByteArray()).writeShort(starTitlesCount).writeBytes(p.toByteArray()).toByteArray())
- else:
- titleID = args[0]
- found = False
- for title in this.client.titleList:
- if str(title).split(".")[0] == titleID:
- found = True
- if found:
- this.client.TitleNumber = int(titleID)
- for title in this.client.titleList:
- if str(title).split(".")[0] == titleID:
- this.client.TitleStars = int(str(title).split(".")[1])
- this.client.sendPacket(Identifiers.send.Change_Title, ByteArray().writeUnsignedByte(0 if titleID == 0 else 1).writeUnsignedShort(titleID).toByteArray())
- elif command in ["sy?"]:
- if this.client.privLevel >= 5:
- this.client.sendLangueMessage("", "$SyncEnCours : [" + this.client.room.currentSyncName + "]")
- elif command in ["sy"]:
- if this.client.privLevel >= 7:
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- player = this.server.players.get(playerName)
- if player != None:
- player.isSync = True
- this.client.room.currentSyncCode = player.playerCode
- this.client.room.currentSyncName = player.Username
- if this.client.room.mapCode != -1 or this.client.room.EMapCode != 0:
- this.client.sendPacket(Identifiers.old.send.Sync, [player.playerCode, ""])
- else:
- this.client.sendPacket(Identifiers.old.send.Sync, [player.playerCode])
- this.client.sendLangueMessage("", "$NouveauSync <V>" + playerName)
- elif command in ["ch"]:
- if this.client.privLevel >= 7:
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- player = this.server.players.get(playerName)
- if player != None:
- if this.client.room.forceNextShaman == player:
- this.client.sendLangueMessage("", "$PasProchaineChamane", player.Username)
- this.client.room.forceNextShaman = -1
- else:
- this.client.sendLangueMessage("", "$ProchaineChamane", player.Username)
- this.client.room.forceNextShaman = player
- elif re.match("p\\d+(\\.\\d+)?", command):
- if this.client.privLevel >= 6:
- mapCode = this.client.room.mapCode
- mapName = this.client.room.mapName
- currentCategory = this.client.room.mapPerma
- if mapCode != -1:
- category = int(command[1:])
- if category in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 17, 18, 19, 22, 41, 42, 44]:
- this.server.sendStaffMessage(6, "[%s] @%s : %s -> %s" %(this.client.Username, mapCode, currentCategory, category))
- this.Cursor.execute("update MapEditor set Perma = ? where Code = ?", [category, mapCode])
- elif re.match("lsp\\d+(\\.\\d+)?", command):
- if this.client.privLevel >= 6:
- category = int(command[3:])
- if category in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 17, 18, 19, 22, 41, 42, 44]:
- mapList = ""
- mapCount = 0
- this.Cursor.execute("select * from mapeditor where Perma = ?", [category])
- r = this.Cursor.fetchall()
- for rs in r:
- mapCount += 1
- yesVotes = rs["YesVotes"]
- noVotes = rs["NoVotes"]
- totalVotes = yesVotes + noVotes
- if totalVotes < 1: totalVotes = 1
- rating = (1.0 * yesVotes / totalVotes) * 100
- mapList += "\n<N>%s</N> - @%s - %s - %s%s - P%s" %(rs["Name"], rs["Code"], totalVotes, str(rating).split(".")[0], "%", rs["Perma"])
- try: this.client.sendLogMessage("<font size=\"12\"><N>Los</N> <BV>%s</BV> <N>mapas</N> <V>P%s %s</V></font>" %(mapCount, category, mapList))
- except: this.client.sendMessage("<R>Hay muchos mapas y no es posible abrir.</R>")
- elif command in ["lsmaps"]:
- if len(args) == 0:
- this.client.privLevel >= 1
- else:
- this.client.privLevel >= 6
- playerName = this.client.Username if len(args) == 0 else this.client.TFMUtils.parsePlayerName(args[0])
- mapList = ""
- mapCount = 0
- this.Cursor.execute("select * from MapEditor where Name = ?", [playerName])
- r = this.Cursor.fetchall()
- for rs in r:
- mapCount += 1
- yesVotes = rs["YesVotes"]
- noVotes = rs["NoVotes"]
- totalVotes = yesVotes + noVotes
- if totalVotes < 1: totalVotes = 1
- rating = (1.0 * yesVotes / totalVotes) * 100
- mapList += "\n<N>"+str(rs["Name"])+" - @"+str(rs["Code"])+" - "+str(totalVotes)+" - "+str(rating).split(".")[0]+"% - P"+str(rs["Perma"])
- try: this.client.sendLogMessage("<font size= \"12\"><V>"+playerName+"<N> estos son tus mapas: <BV>"+str(mapCount)+ str(mapList)+"</font>")
- except: this.client.sendMessage("<R>Hay muchos mapas y no es posible abrir.</R>")
- elif command in ["info"]:
- if this.client.privLevel >= 1:
- if this.client.room.mapCode != -1:
- totalVotes = this.client.room.mapYesVotes + this.client.room.mapNoVotes
- if totalVotes < 1: totalVotes = 1
- rating = (1.0 * this.client.room.mapYesVotes / totalVotes) * 100
- this.client.sendMessage(str(this.client.room.mapName)+" - @"+str(this.client.room.mapCode)+" - "+str(totalVotes)+" - "+str(rating).split(".")[0]+"% - P"+str(this.client.room.mapPerma))
- elif command in ["re", "respawn"]:
- if len(args) == 0:
- if this.client.privLevel >= 2:
- if not this.client.canRespawn:
- this.client.room.respawnSpecific(this.client.Username, True)
- this.client.canRespawn = True
- else:
- if this.client.privLevel >= 7:
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- if this.client.room.clients.has_key(playerName):
- this.client.room.respawnSpecific(playerName, True)
- #elif command in ["dulce"]:
- #if this.client.nowCoins >= 1000:
- #if this.client.nowTokens >= 1000:
- #if this.client.privLevel >= 1:
- #this.client.nowCoins += 100
- #this.client.nowTokens += 100
- #this.client.firstCount += 1000
- #this.client.cheeseCount += 1000
- #this.client.privLevel += 2
- #this.client.sendMessage("<CE>[DrekkeMouse]<CEP> Bien ¨hecho ratoncito gracias a tì el halloween sigue con vida. *-*</CEP>\n\n<J>Premios:")
- #this.client.sendMessage("<CH>1 <N>- <VP>1000 First.")
- #this.client.sendMessage("<CH>2 <N>- <VP>1000 Quesos en el perfil.")
- #this.client.sendMessage("<CH>3 <N>- <VP>100 Monedas(Muy pronto podràs usarlo).")
- #this.client.sendMessage("<CH>4 <N>- <VP>100 Fichas(Muy pronto podràs usarlo).")
- #this.client.sendMessage("<CH>5 <N>- <VP>Rango VIP Hasta [20/11/10].\nPD:si quieres aparecer en /vips reinicia. =D")
- #this.server.sendStaffMessage(7, "<V>"+this.client.Username+"<BL> consiguio el premio de Halloween. *-*")
- #else:
- #this.client.sendMessage("<CE>[DrekkeMouse]<CEP> Necesitas 1000 Caramelos.")
- #else:
- #this.client.sendMessage("<CE>[DrekkeMouse]<CEP> Necesitas 1000 Monedas.")
- elif command in ["ranking"]:
- Userlist = []
- lists = "<p align='center'><font size='13'><font color='#64FE2E'>Ranking TOP 10 </font> – <N>SourisMice</font></p>"
- lists2 = "<p align='left'><font size='7'>"
- this.Cursor.execute("select Username, CheeseCount, FirstCount, BootcampCount, ShamanSaves, HardModeSaves, DivineModeSaves, TitleNumber from Users where PrivLevel < 6 ORDER By FirstCount DESC LIMIT 10")
- rs = this.Cursor.fetchall()
- pos = 1
- this.client.updateDatabase()
- for rrf in rs:
- playerName = str(rrf[0])
- CheeseCount = rrf[1]
- FirstCount = rrf[2]
- BootcampCount = rrf[3]
- ShamanSaves = rrf[4]
- HardModeSaves = rrf[5]
- DivineModeSaves = rrf[6]
- status= "<N>[<VP>Conectado - <font color='98FB98'>ES</font><N>]<N>"
- status= "<N>[<R>Desconectado<N>]<N>"
- if pos == 1:
- lists += "<p align='left'><font color='#0DFF00' size='18'>"+str(pos)+"</font> <font color='#3C5064'>-</font> <N>Jugador : <font color='#009d9d'>"+str(playerName)+"" + '<N> -' + (' <N>[<VP>Online<N> - <T>ES</font><N>]<N>'if this.server.checkConnectedAccount(playerName) else'<N> [<R>Offline<N>]') + " \n"
- elif pos == 2:
- lists += "<p align='left'><font color='#FFEB00' size='18'>"+str(pos)+"</font> <font color='#3C5064'>-</font> <N>Jugador : <font color='#009d9d'>"+str(playerName)+"" + '<N> -' + (' <N>[<VP>Online<N> - <T>ES</font><N>]<N>'if this.server.checkConnectedAccount(playerName) else'<N> [<R>Offline<N>]') + " \n"
- elif pos == 3:
- lists += "<p align='left'><font color='#00FFF7' size='18'>"+str(pos)+"</font> <font color='#3C5064'>-</font> <N>Jugador : <font color='#009d9d'>"+str(playerName)+"" + '<N> -' + (' <N>[<VP>Online<N> - <T>ES</font><N>]<N>'if this.server.checkConnectedAccount(playerName) else'<N> [<R>Offline<N>]') + " \n"
- elif pos == 4:
- lists += "<p align='left'><font color='#606090'>"+str(pos)+"</font> <font color='#3C5064'>-</font> <N>Jugador : <font color='#009d9d'>"+str(playerName)+"" + '<N> -' + (' <N>[<VP>Online<N> - <T>ES</font><N>]<N>'if this.server.checkConnectedAccount(playerName) else'<N> [<R>Offline<N>]') + " \n"
- elif pos == 5:
- lists += "<p align='left'><font color='#606090'>"+str(pos)+"</font> <font color='#3C5064'>-</font> <N>Jugador : <font color='#009d9d'>"+str(playerName)+"" + '<N> -' + (' <N>[<VP>Online<N> - <T>ES</font><N>]<N>'if this.server.checkConnectedAccount(playerName) else'<N> [<R>Offline<N>]') + " \n"
- elif pos == 6:
- lists += "<p align='left'><font color='#606090'>"+str(pos)+"</font> <font color='#3C5064'>-</font> <N>Jugador : <font color='#009d9d'>"+str(playerName)+"" + '<N> -' + (' <N>[<VP>Online<N> - <T>ES</font><N>]<N>'if this.server.checkConnectedAccount(playerName) else'<N> [<R>Offline<N>]') + " \n"
- elif pos == 7:
- lists += "<p align='left'><font color='#606090'>"+str(pos)+"</font> <font color='#3C5064'>-</font> <N>Jugador : <font color='#009d9d'>"+str(playerName)+"" + '<N> -' + (' <N>[<VP>Online<N> - <T>ES</font><N>]<N>'if this.server.checkConnectedAccount(playerName) else'<N> [<R>Offline<N>]') + " \n"
- elif pos == 8:
- lists += "<p align='left'><font color='#606090'>"+str(pos)+"</font> <font color='#3C5064'>-</font> <N>Jugador : <font color='#009d9d'>"+str(playerName)+"" + '<N> -' + (' <N>[<VP>Online<N> - <T>ES</font><N>]<N>'if this.server.checkConnectedAccount(playerName) else'<N> [<R>Offline<N>]') + " \n"
- elif pos == 9:
- lists += "<p align='left'><font color='#606090'>"+str(pos)+"</font> <font color='#3C5064'>-</font> <N>Jugador : <font color='#009d9d'>"+str(playerName)+"" + '<N> -' + (' <N>[<VP>Online<N> - <T>ES</font><N>]<N>'if this.server.checkConnectedAccount(playerName) else'<N> [<R>Offline<N>]') + " \n"
- elif pos == 10:
- lists += "<p align='left'><font color='#606090'>"+str(pos)+"º</font> <font color='#3C5064'>-</font> <N>Jugador: <font color='#009d9d'>"+str(playerName)+"" + '<N> -' + (' <N>[<VP>Online<N> - <T>ES</font><N>]<N>'if this.server.checkConnectedAccount(playerName) else'<N> [<R>Offline<N>]') + " \n"
- lists += " <p align='left'><font color='#6A7495'>Firsts :</font> <font color='#FFFFFF'>"+str(FirstCount)+"</font>"
- lists += "<br />"
- lists += " <p align='left'><font color='#6A7495'>Ratones salvados :</font> <font color='#009d9d'>"+str(ShamanSaves)+" / "+"<font color='#FADE55'>"+str(HardModeSaves)+" / "+"<font color='#F52331'>"+str(DivineModeSaves)+"</font>"
- lists += "<br />"
- lists += " <p align='left'><font color='#6A7495'>Quesos :</font> <font color='#6C77C1'>"+str(CheeseCount)+"</font>"
- lists += "<br />"
- lists += " <p align='left'><font color='#6A7495'>Bootcamps :</font> <font color='#6C77C1'>"+str(BootcampCount)+"</font>"
- lists += "<br /><br />"
- pos += 1
- this.client.sendLogMessage(lists + "</font></p>")
- elif command in ["vips", "vipers"]:
- lists = "<V><p align='center'><b>Vips</b></p><p align='center'>"
- this.Cursor.execute("select Username from Users where PrivLevel = 2")
- r = this.Cursor.fetchall()
- for rs in r:
- playerName = rs["Username"]
- lists += "\n<N>" + str(playerName) + " - <N><J>VIP<V> - [<N>" + ("<VP>Conectado<N>" if this.server.checkConnectedAccount(playerName) else "<R>Desconectado<N>") + "<V>]<N>\n"
- this.client.sendLogMessage(str(lists) + "</p>")
- elif command in ["nevar"]:
- if this.client.privLevel >= 8 or this.requireTribe(True):
- this.client.room.startSnow(1000, 60, not this.client.room.isSnowing)
- elif command in ["music", "musique"]:
- if this.client.privLevel >= 8:
- this.client.room.sendAll(Identifiers.recv.Room.send_Music, [])
- else:
- if not this.client.tribeName == "" and this.client.room.isTribeHouse:
- tribeRankings = this.client.tribeData[3]
- perm = tribeRankings[this.client.tribeRank].split("|")[2]
- if perm.split(",")[7] == "1":
- this.client.room.sendAll(Identifiers.recv.Room.send_Music, [])
- elif command == "namecolor" or command == "namecor" or command == "corname":
- if this.client.privLevel >= 2:
- color = args[0]
- hexColor = "025BF5" if color == "azul" else "F3FA1E" if color == "amarillo" else "D968C8" if color == "rosa" else "11F58B" if color == "verde" else "575355" if color == "gris" else "FA0526" if color == "rojo" else "FAA405" if color == "naranja" else "CFC5E8" if color == "lila" else "05F6FA" if color == "azulclaro" else "7900FF" if color == "purpura" else "07E8BF" if color == "verdeoscuro" else "B6FCC4" if color == "verdeclaro" else "000001" if color == "negro" else ""
- if not hexColor == "":
- this.client.sendMessage("El color de su nombre fue cambiado a <V>"+color+"<BL>.")
- this.client.room.setNameColor(this.client.Username, int(hexColor, 16))
- else:
- this.client.sendMessage("Este color no esta disponible")
- elif command == "warn":
- if this.client.privLevel >= 7:
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- message = argsNotSplited.split(" ", 1)[1]
- if not this.server.checkExistingUser(playerName):
- this.client.sendMessage("No se pudo encontrar el usuario : <V>"+playerName+"<BL>.")
- else:
- rank = "Ayudante" if this.client.privLevel == 5 else "MapCrew" if this.client.privLevel == 6 else "Moderador" if this.client.privLevel == 7 else "Super Moderador" if this.client.privLevel == 8 else "Developer" if this.client.privLevel == 9 else "Administrador" if this.client.privLevel == 10 else ""
- player = this.server.players.get(playerName)
- if player != None:
- player.sendMessage("<ROSE>[<b>ALERTA</b>] El "+str(rank)+" "+this.client.Username+" te envió una advertencia. Motivo: "+str(message))
- this.client.sendMessage("<BL>La alerta fue enviada a <V>"+playerName+"<BL>.")
- this.server.sendModMessage(7, "<V>"+this.client.Username+"<BL> le envio una advertencia a"+"<V> "+playerName+"<BL>. Motivo: <V>"+str(message))
- elif command in ["clearreports"]:
- if this.client.privLevel == 10:
- this.server.reports = {"names": []}
- this.client.sendMessage("Listo.")
- this.server.sendStaffMessage(7, "<V>"+this.client.Username+"<BL> borro los reportes del modopwet.")
- elif command in ["clearcache"]:
- if this.client.privLevel == 10:
- this.server.ipPermaBanCache = []
- this.client.sendMessage("Listo.")
- this.server.sendStaffMessage(7, "<V>"+this.client.Username+"<BL> borro el cache del servidor.")
- elif command in ["cleariptempban"]:
- if this.client.privLevel == 10:
- this.server.tempIPBanList = []
- this.client.sendMessage("Listo.")
- this.server.sendStaffMessage(7, "<V>"+this.client.Username+"<BL> borro la lista de ips baneadas del servidor.")
- elif command in ["log"]:
- if this.client.privLevel >= 7:
- playerName = this.client.TFMUtils.parsePlayerName(args[0]) if len(args) > 0 else ""
- logList = []
- this.Cursor.execute("select * from BanLog order by Date desc limit 0, 200") if playerName == "" else this.Cursor.execute("select * from BanLog where Name = ? order by Date desc limit 0, 200", [playerName])
- r = this.Cursor.fetchall()
- for rs in r:
- if rs["Status"] == "Unban":
- logList += rs["Name"], "", rs["BannedBy"], "", "", rs["Date"].ljust(13, "0")
- else:
- logList += rs["Name"], rs["IP"], rs["BannedBy"], rs["Time"], rs["Reason"], rs["Date"].ljust(13, "0")
- this.client.sendPacket(Identifiers.old.send.Log, logList)
- elif command in ["move"]:
- if this.client.privLevel >= 8:
- for player in this.client.room.clients.values():
- player.enterRoom(argsNotSplited)
- this.server.sendStaffMessage(6, "<V>["+this.client.Username+"]<BL> movio a otra sala.")
- elif command in ["nomip"]:
- if this.client.privLevel >= 7:
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- ipList = "Lista de IPs do jogador: "+playerName
- this.Cursor.execute("select IP from LoginLog where Username = ?", [playerName])
- r = this.Cursor.fetchall()
- for rs in r:
- ipList += "\n" + rs["IP"]
- this.client.sendMessage(ipList)
- elif command in ["ipnom"]:
- if this.client.privLevel >= 7:
- ip = args[0]
- nameList = "Lista de jugadores usando la ip: "+ip
- historyList = "Historial de IPs:"
- for player in this.server.players.values():
- if player.ipAddress == ip:
- nameList += "\n" + player.Username
- this.Cursor.execute("select Username from LoginLog where IP = ?", [ip])
- r = this.Cursor.fetchall()
- for rs in r:
- historyList += "\n" + rs["Username"]
- this.client.sendMessage(nameList + "\n" + historyList)
- this.server.sendStaffMessage(6, "<V>["+this.client.Username+"]<BL> le hizo ipnom a <V>["+playerName+"<BL>].")
- elif command in ["settime"]:
- if this.client.privLevel >= 7:
- time = args[0]
- if time.isdigit():
- iTime = int(time)
- iTime = 5 if iTime < 5 else (32767 if iTime > 32767 else iTime)
- for player in this.client.room.clients.values():
- player.sendRoundTime(iTime)
- this.client.room.changeMapTimers(iTime)
- this.server.sendStaffMessage(6, "<V>["+this.client.Username+"]<BL> cambio el tiempo en la sala <V>["+this.client.roomName+"<BL>].")
- elif command in ["ip"]:
- if this.client.privLevel >= 7:
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- player = this.server.players.get(playerName)
- if player != None:
- this.client.sendMessage("Ip del jugador : <V>"+playerName+"<BL> : <V>"+player.ipAddress+"<BL>.")
- this.server.sendStaffMessage(6, "<V>"+this.client.Username+"<BL> vio la ip del jugador <V>"+playerName+"<BL>.")
- elif command in ["kick"]:
- if this.client.privLevel >= 6:
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- player = this.server.players.get(playerName)
- if player != None:
- player.room.removeClient(player)
- player.transport.loseConnection()
- this.server.sendStaffMessage(6, "<V>"+this.client.Username+"<BL> echo a <V>"+playerName+"<BL> de TransforMix.")
- else:
- this.client.sendMessage("El jugador <V>"+playerName+"<BL> no se encuentra conectado.")
- elif command in ["search", "find"]:
- if this.client.privLevel >= 5:
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- result = ""
- for player in this.server.players.values():
- if playerName in player.Username:
- result += "\n<V>"+player.Username+"<BL> -> <V>"+player.room.name
- this.client.sendMessage(result)
- elif command in ["clearchat"]:
- if this.client.privLevel >= 5:
- this.client.room.sendAll(Identifiers.send.Message, ByteArray().writeUTF("\n" * 100).toByteArray())
- this.server.sendStaffMessage(6, "<V>["+this.client.Username+"]<BL> Limpió el chat en la sala <V>["+this.client.roomName+"<BL>].")
- elif command in ["shaman"]:
- if this.client.privLevel >= 9:
- if len(args) == 0:
- this.client.isShaman = True
- this.client.room.sendAll(Identifiers.send.New_Shaman, ByteArray().writeInt(this.client.playerCode).writeUnsignedByte(this.client.shamanType).writeUnsignedByte(this.client.shamanLevel).writeShort(this.client.server.getShamanBadge(this.client.playerCode)).toByteArray())
- else:
- this.requireArgs(1)
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- player = this.server.players.get(playerName)
- if player != None:
- player.isShaman = True
- this.client.room.sendAll(Identifiers.send.New_Shaman, ByteArray().writeInt(player.playerCode).writeUnsignedByte(player.shamanType).writeUnsignedByte(player.shamanLevel).writeShort(player.server.getShamanBadge(player.playerCode)).toByteArray())
- elif command in ["lock"]:
- if this.client.privLevel >= 7:
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- this.requireNoSouris(playerName)
- if not this.server.checkExistingUser(playerName):
- this.client.sendMessage("No fue posible encontrar al jugador: <V>"+playerName+"<BL>.")
- else:
- if this.server.getPlayerPrivlevel(playerName) < 4:
- player = this.server.players.get(playerName)
- if player != None:
- player.room.removeClient(player)
- player.transport.loseConnection()
- this.Cursor.execute("update Users set PrivLevel = -1 where Username = ?", [playerName])
- this.server.sendStaffMessage(7, "<V>"+playerName+"<BL> fue bloqueado por <V>"+this.client.Username)
- elif command in ["unlock"]:
- if this.client.privLevel >= 7:
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- this.requireNoSouris(playerName)
- if not this.server.checkExistingUser(playerName):
- this.client.sendMessage("No fue posible encontrar al jugador: <V>"+playerName+"<BL>.")
- else:
- if this.server.getPlayerPrivlevel(playerName) == -1:
- this.Cursor.execute("update Users set PrivLevel = 1 where Username = ?", [playerName])
- this.server.sendStaffMessage(7, "<V>"+playerName+"<BL> fue desbloqueado por <V>"+this.client.Username)
- elif command in ["giveforall"]:
- if this.client.privLevel >= 9:
- this.requireArgs(2)
- type = args[0].lower()
- count = int(args[1]) if args[1].isdigit() else 0
- type = "quesos" if type.startswith("queijo") or type.startswith("quesos") else "fresas" if type.startswith("morango") or type.startswith("fresas") else "bootcamps" if type.startswith("bc") or type.startswith("bootcamp") else "firsts" if type.startswith("first") else "perfil" if type.startswith("perfilqj") else "saves" if type.startswith("saves") else "hardSaves" if type.startswith("hardsaves") else "divineSaves" if type.startswith("divinesaves") else "monedas" if type.startswith("moneda") or type.startswith("coin") else "fichas" if type.startswith("ficha") or type.startswith("tokens") else ""
- if count > 0 and not type == "":
- this.server.sendStaffMessage(7, "<V>" + this.client.Username + "<BL> dio <V>" + str(count) + " " + str(type) + "<BL> para todos los jugadores.")
- for player in this.server.players.values():
- player.sendMessage("Acabas de recibir <V>" + str(count) + " " + str(type) + "<BL>.")
- if type == "quesos":
- player.shopCheeses += count
- elif type == "fresas":
- player.shopFraises += count
- elif type == "bootcamps":
- player.bootcampCount += count
- elif type == "firsts":
- player.cheeseCount += count
- player.firstCount += count
- elif type == "profile":
- player.cheeseCount += count
- elif type == "saves":
- player.shamanSaves += count
- elif type == "hardSaves":
- player.hardModeSaves += count
- elif type == "divineSaves":
- player.divineModeSaves += count
- elif type == "monedas":
- player.nowCoins += count
- elif type == "fichas":
- player.nowTokens += count
- elif command in ["give"]:
- if this.client.privLevel >= 9:
- this.requireArgs(3)
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- type = args[1].lower()
- count = int(args[2]) if args[2].isdigit() else 0
- count = 10000 if count > 10000 else count
- this.requireNoSouris(playerName)
- type = "quesos" if type.startswith("quijo") or type.startswith("queso") else "fresas" if type.startswith("morango") or type.startswith("fresas") else "bootcamps" if type.startswith("bc") or type.startswith("bootcamp") else "firsts" if type.startswith("first") else "profile" if type.startswith("perfilquesos") or type.startswith("perfilqj") else "saves" if type.startswith("saves") else "hardSaves" if type.startswith("hardsaves") else "divineSaves" if type.startswith("divinesaves") else "moedas" if type.startswith("moeda") or type.startswith("monedas") else "fichas" if type.startswith("ficha") or type.startswith("fichas") else ""
- if count > 0 and not type == "":
- player = this.server.players.get(playerName)
- if player != None:
- this.server.sendStaffMessage(7, "<V>" + this.client.Username + "<BL> dio <V>" + str(count) + " " + str(type) + "<BL> para <V>" + playerName + "<BL>.")
- player.sendMessage("Recibiste <V>" + str(count) + " " + str(type) + "<BL>.")
- if type == "quesos":
- player.shopCheeses += count
- elif type == "fresas":
- player.shopFraises += count
- elif type == "bootcamps":
- player.bootcampCount += count
- elif type == "firsts":
- player.cheeseCount += count
- player.firstCount += count
- elif type == "perfil":
- player.cheeseCount += count
- elif type == "saves":
- player.shamanSaves += count
- elif type == "hardSaves":
- player.hardModeSaves += count
- elif type == "divineSaves":
- player.divineModeSaves += count
- elif type == "monedas":
- player.nowCoins += count
- elif type == "fichas":
- player.nowTokens += count
- elif command in ["unrank"]:
- if this.client.privLevel == 10:
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- if not this.server.checkExistingUser(playerName):
- this.client.sendMessage("No fue posible encontrar al jugador: <V>"+playerName+"<BL>.")
- else:
- player = this.server.players.get(playerName)
- if player != None:
- player.room.removeClient(player)
- player.transport.loseConnection()
- this.Cursor.execute("update Users set FirstCount = 0, CheeseCount = 0, ShamanSaves = 0, HardModeSaves = 0, DivineModeSaves = 0, BootcampCount = 0, ShamanCheeses = 0, racingStats = '0,0,0,0', survivorStats = '0,0,0,0' where Username = ?", [playerName])
- this.server.sendStaffMessage(7, "<V>"+playerName+"<BL> fue retirado del ranking por <V>"+this.client.Username+"<BL>.")
- elif command in ["mjj"]:
- roomName = args[0]
- if roomName.startswith("#"):
- this.client.enterRoom(roomName + "1")
- else:
- this.client.enterRoom(("" if this.client.lastGameMode == 1 else "vanilla" if this.client.lastGameMode == 3 else "survivor" if this.client.lastGameMode == 8 else "racing" if this.client.lastGameMode == 9 else "music" if this.client.lastGameMode == 11 else "bootcamp" if this.client.lastGameMode == 2 else "defilante" if this.client.lastGameMode == 10 else "village") + roomName)
- elif command == "size":
- if this.client.privLevel >= 8:
- this.requireArgs(2)
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- if args[1].isdigit():
- size = int(args[1])
- if playerName == "*":
- for player in this.client.room.clients.values():
- this.client.room.sendAllBin(Identifiers.send.Mouse_Size, ByteArray().writeInt(this.client.playerCode).writeShort(size).writeBool(False).toByteArray())
- else:
- player = this.server.players.get(playerName)
- if player != None:
- this.client.room.sendAllBin(Identifiers.send.Mouse_Size, ByteArray().writeInt(this.client.playerCode).writeShort(size).writeBool(False).toByteArray())
- elif command in ["mulodrome"]:
- can = this.client.privLevel == 10 or this.client.room.roomName.startswith(this.client.Username)
- if can and not this.client.room.isMulodrome:
- for player in this.client.room.clients.values():
- player.sendPacket(Identifiers.send.Mulodrome_Start, chr(1 if player.Username == this.client.Username else 0), True)
- elif command in ["moveplayer"]:
- if this.client.privLevel >= 7:
- playerName = this.client.TFMUtils.parsePlayerName(args[0])
- roomName = argsNotSplited.split(" ", 1)[1]
- player = this.server.players.get(playerName)
- if player != None:
- player.enterRoom(roomName)
- elif command in ["bootcamp", "vanilla", "survivor", "racing", "defilante", "tutorial", "x_eneko"]:
- this.client.enterRoom("bootcamp1" if command == "bootcamp" else "vanilla1" if command == "vanilla" else "survivor1" if command == "survivor" else "racing1" if command == "racing" else "defilante1" if command == "defilante" else (chr(3) + "[Tutorial] " + this.client.Username) if command == "tutorial" else "Treinamento " + this.client.Username if command == "x_eneko" else "")
- elif command in ["d"]:
- if this.client.privLevel >= 4:
- message = argsNotSplited
- this.client.sendAllModerationChat(9, message)
- elif command in ["mm"]:
- if this.client.privLevel >= 7:
- this.client.room.sendAll(Identifiers.send.Staff_Chat, ByteArray().writeByte(0).writeUTF("").writeUTF(argsNotSplited).writeShort(0).writeByte(0).toByteArray())
- elif command in ["call"]:
- if this.client.privLevel >= 8:
- for player in this.server.players.values():
- player.sendPacket(Identifiers.send.Tribulle, ByteArray().writeShort(Identifiers.tribulle.send.ET_RecoitMessagePrive).writeUTF(this.client.Username).writeUTF(argsNotSplited).writeByte(this.client.langueByte).writeByte(0).toByteArray())
- elif command in ["funcorp"]:
- if len(args) > 0:
- if (this.client.room.roomName == "*strm_" + this.client.Username.lower()) or this.client.privLevel >= 7 or this.client.isFuncorp:
- if args[0] == "on" and not this.client.privLevel == 1:
- this.client.room.isFuncorp = True
- for player in this.client.room.clients.values():
- player.sendLangueMessage("", "<FC>$FunCorpActive</FC>")
- elif args[0] == "off" and not this.client.privLevel == 1:
- this.client.room.isFuncorp = False
- for player in this.client.room.clients.values():
- player.sendLangueMessage("", "<FC>$FunCorpDesactive</FC>")
- elif args[0] == "help":
- this.client.sendLogMessage(this.sendListFCHelp())
- else:
- this.client.sendMessage("Wrong parameters.")
- except Exception as ERROR:
- import time, traceback
- c = open("./include/errorsCommands.log", "a")
- c.write("\n" + "=" * 60 + "\n- Time: %s\n- Player: %s\n- Error Command: \n" %(time.strftime("%d/%m/%Y - %H:%M:%S"), this.client.Username))
- traceback.print_exc(file=c)
- c.close()
Add Comment
Please, Sign In to add comment