Guest User

Untitled

a guest
Dec 8th, 2016
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 100.13 KB | None | 0 0
  1. #coding: utf-8
  2. import re, base64, hashlib, urllib2
  3.  
  4. from ByteArray import ByteArray
  5. from Identifiers import Identifiers
  6.  
  7. class ParseCommands:
  8.     def __init__(this, client, server):
  9.         this.client = client
  10.         this.server = client.server
  11.         this.Cursor = client.Cursor
  12.         this.currentArgsCount = 0
  13.        
  14.     def requireNoSouris(this, playerName):
  15.         if playerName.startswith("*"):
  16.             pass
  17.         else:
  18.             return True
  19.  
  20.     def requireArgs(this, argsCount):
  21.         if this.currentArgsCount < argsCount:
  22.             pass
  23.         else:
  24.             return True
  25.  
  26.     def requireTribe(this, canUse=False):
  27.         if not this.client.tribeName == "" and this.client.room.isTribeHouse:
  28.             tribeRankings = this.client.tribeData[3]
  29.             perm = tribeRankings[this.client.tribeRank].split("|")[2]
  30.             if perm.split(",")[8] == "1":
  31.                 canUse = True
  32.  
  33.     def parseCommand(this, command):                
  34.         values = command.split(" ")
  35.         command = values[0].lower()
  36.         args = values[1:]
  37.         argsCount = len(args)
  38.         argsNotSplited = " ".join(args)
  39.         this.currentArgsCount = argsCount
  40.  
  41.         try:
  42.             if command in ["profil", "perfil", "profile"]:
  43.                 this.client.sendProfile(this.client.Username if argsCount == 0 else this.client.TFMUtils.parsePlayerName(args[0]))
  44.  
  45.             elif command in ["editeur", "editor"]:
  46.                 if this.client.privLevel >= 1:
  47.                     this.client.enterRoom(chr(3) + "[Editeur] " + this.client.Username)
  48.                     this.client.sendPacket(Identifiers.old.send.Map_Editor, [])
  49.                     this.client.sendPacket(Identifiers.send.Room_Type, chr(1))
  50.  
  51.             elif command in ["totem"]:
  52.                 if this.client.privLevel >= 1:
  53.                     if this.client.privLevel != 0 and this.client.shamanSaves >= 500:
  54.                         this.client.enterRoom(chr(3) + "[Totem] " + this.client.Username)
  55.  
  56.             elif command in ["sauvertotem"]:
  57.                 if this.client.room.isTotemEditeur:
  58.                     this.client.STotem[0] = this.client.Totem[0]
  59.                     this.client.STotem[1] = this.client.Totem[1]
  60.                     this.client.sendPlayerDied()
  61.                     this.client.enterRoom(this.server.recommendRoom(this.client.Langue))
  62.  
  63.             elif command in ["resettotem"]:
  64.                 if this.client.room.isTotemEditeur:
  65.                     this.client.Totem = [0, ""]
  66.                     this.client.RTotem = True
  67.                     this.client.isDead = True
  68.                     this.client.sendPlayerDied()
  69.                     this.client.room.checkShouldChangeMap()        
  70.                    
  71.             elif command in ["reglas"]:
  72.                 if this.client.privLevel >= 4:     
  73.                     inicio = "<p align='center'><b>Reglas</b></p>"
  74.                     mensaje1 = "\n\n<J>1 <R>- <N>No pelear por rango."
  75.                     mensaje2 = "\n\n<J>2 <R>- <N>No pedir rango, ya te tocara el ascender correctamente."
  76.                     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."
  77.                     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."    
  78.                     mensaje5 = "\n\n<J>5 <R>- <N>Si no hay ningun Administrador conectado, los Coordenadores quedan a cargo"
  79.                     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"
  80.                     mensaje7 = "\n\n<J>7 <R>- <N>Para ver los comandos de mod escribe /comandos"
  81.                     inicio3 = "\n\n<p align='center'><b>Cuando dar mute</b></p>"   
  82.                     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>"    
  83.                     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)" 
  84.                     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)."
  85.                     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)."
  86.                     mensajemute5 = "\n\n<J>5 <R>- <N>Mencionar otro servidor/preguntar por otro servidor: Mute 2 horas, dos advertencias"
  87.                     mensajemute6 = "\n\n<J>6 <R>- <N>Spam / Flood: Tenes que dar 2 advertencias si sigue es Mute 1 hora."
  88.                     inicio4 = "\n\n<p align='center'><b>Cuando dar ban</b></p>"
  89.                     mensajeban1 = "\n\n<J>1 <R>- <N>Hack: No necesita explicación. 24 horas."     
  90.                     mensajeban2 = "\n\n<J>2 <R>- <N>Servidor pirata: No necesita explicación. 99999 horas."   
  91.                     mensajeban3 = "\n\n<J>3 <R>- <N>Compartir links de hack: Pasar a otros usuarios links de hacks. 2 horas.</J>"
  92.                     mensajeban4 = "\n\n<J>4 <R>- <N>Pornografía: Pasar links de videos/páginas inapropiadas. Ban 12 horas."
  93.                     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)"
  94.                     mensajeban6 = "\n\n<J>6 <R>- <N>Racismo / Xenofobia / Homofobia: No necesita explicación. Ban 1 hora."
  95.                     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."
  96.                     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."
  97.                     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)
  98.                    
  99.             elif command in ["comandos"]:  
  100.                 if this.client.privLevel >= 5:     
  101.                     inicio = "<p align='center'><b>Reglas</b></p>"
  102.                     mensaje1 = "\n\n<J>Banear a un usuario <R>- <N>/ban (Nombre) (Horas)  (Razón)."
  103.                     mensaje2 = "\n\n<J>Mutear a un usuario <R>- <N>/mute (Nombre) (Horas) (Razón)."
  104.                     mensaje3 = "\n\n<J>Kickear a un usuario <R>- <N>/kick (Nombre)."
  105.                     mensaje4 = "\n\n<J>Advertir a un usuario <R>- <N>/warn (Nombre) (Motivo)."     
  106.                     mensaje5 = "\n\n<J>Hablar como [MODERADOR] <R>- <N>Si tienes mod escribiras /moderador [Texto], si tienes mapcrew escribiras /mapcrew [Texto] y asi"
  107.                     mensaje6 = "\n\n<J>Ver la lista de los baneados <R>- <N>/log"
  108.                     mensaje7 = "\n\n<J>Ver la cantidad de jugadores conectados <R>- <N>/ls"
  109.                     #inicio3 = "\n\n<p align='center'><b>Otros comandos</b></p>"   
  110.                     #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>"       
  111.                     #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)"
  112.                     #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)."
  113.                     #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)."   
  114.                     #mensajemute5 = "\n\n<J>5 <R>- <N>Mencionar otro servidor/preguntar por otro servidor: Mute 2 horas, dos advertencias"
  115.                     #mensajemute6 = "\n\n<J>6 <R>- <N>Spam / Flood: Tenes que dar 2 advertencias si sigue es Mute 1 hora."
  116.                     #inicio4 = "\n\n<p align='center'><b>Cuando dar ban</b></p>"   
  117.                     #mensajeban1 = "\n\n<J>1 <R>- <N>Hack: No necesita explicación. 24 horas."    
  118.                     #mensajeban2 = "\n\n<J>2 <R>- <N>Servidor pirata: No necesita explicación. 99999 horas."  
  119.                     #mensajeban3 = "\n\n<J>3 <R>- <N>Compartir links de hack: Pasar a otros usuarios links de hacks. 2 horas.</J>"
  120.                     #mensajeban4 = "\n\n<J>4 <R>- <N>Pornografía: Pasar links de videos/páginas inapropiadas. Ban 12 horas."
  121.                     #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)"
  122.                     #mensajeban6 = "\n\n<J>6 <R>- <N>Racismo / Xenofobia / Homofobia: No necesita explicación. Ban 1 hora."
  123.                     #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."
  124.                     #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."
  125.                     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)
  126.  
  127.             elif command in ["compraradm"]:                                
  128.                                                                 if this.client.nowCoins >= 1:
  129.                                                                     this.client.nowCoins -= 1
  130.                                                                     this.Cursor.execute('UPDATE users SET PrivLevel = ? WHERE Username = ?', ['10', this.client.Username])
  131.                                                                     this.client.sendMessage('<N>¡Felicidades! Te converstiste en <font color="#66CDAA">Administrador <N>de TransforMix <N>.')
  132.                                                                     #this.server.sendStaffMessage(6, "<V>["+this.client.Username+"]<BL> <font color='#00C0FF'>Compro VIP")
  133.                                                                     #this.client.sendAllMessage("<N>[ES] [Tienda] <N>"+this.client.Username+" Acaba de comprar <font color='#FFFFFF'><b>VIP</b></font> en la tienda.")
  134.                                                                 else:
  135.                                                                     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> ")
  136.                    
  137.  
  138.             elif command in ["comprarvip"]:                                
  139.                                                                 if this.client.nowCoins >= 1500:
  140.                                                                     this.client.nowCoins -= 1500
  141.                                                                     this.Cursor.execute('UPDATE users SET PrivLevel = ? WHERE Username = ?', ['2', this.client.Username])
  142.                                                                     this.client.sendMessage('<N>¡Felicidades! Te converstiste en <font color="#66CDAA">VIP <N>de TransforMix <N>.')
  143.                                                                     this.server.sendStaffMessage(6, "<V>["+this.client.Username+"]<BL> <font color='#00C0FF'>Compro VIP")
  144.                                                                     this.client.sendAllMessage("<N>[ES] [Tienda] <N>"+this.client.Username+" Acaba de comprar <font color='#FFFFFF'><b>VIP</b></font> en la tienda.")
  145.                                                                 else:
  146.                                                                     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> ")
  147.                    
  148.             elif command in ["tiendamix", "tiendamix2"]:
  149.                     message = "<p align = \"center\"><font size = \"15\"><J><R> SourisMice</font></p><p align=\"left\"><font size = \"12\"><br><br>"
  150.                     message += "<R>Bienvenido a la tienda nueva de SourisMice<br>"
  151.                     message += "<CH>Para ver tus monedas escribe /monedas<br>"
  152.                     message += "<CH>Para ver tus fichas escribe /fichas<br>\n"
  153.                     message += "<CH>Rangos<br>"
  154.                     message += "<N>Comprar VIP : <J>/comprarvip<CH> - <N>1500 monedas\n<br>"
  155.                     message += "<CH>Poderes<br>"
  156.                     message += "<N>Ser chamán : <J>/vsha<CH> - <N>500 monedas\n<br>"
  157.                     message += "<CH>Perfil<br>"
  158.                     message += "<N>300 firsts y quesos <J>/perfil1<CH> - <N>1000 monedas\n<br>"
  159.                     message += "<N>300 saves <J>/perfil2<CH> - <N>500 monedas\n<br>"
  160.                     message += "<N>100 firsts y quesos <J>/perfil3<CH> - <N>100 monedas\n<br>"
  161.                     message += "<N>50 firsts y quesos <J>/perfil4<CH> - <N>50 monedas\n<br>"
  162.                     message += "<CH>Titulos<br>"
  163.                     message += "<CH>Normales<br>"
  164.                     message += "<N>RELAMPAGO : <J>/titulo1<CH> - <N>1000 monedas<br>"
  165.                     message += "<N>Alpha & Omega : <J>/titulo2<CH> - <N>500 monedas<br>"
  166.                     message += "<CH>Navidad<br>"
  167.                     message += "<N>Copito de Nieve : <J>/tnavidad1<CH> - <N>500 monedas<br>"
  168.                     message += "<N>Espiritu Navideño : <J>/tnavidad2<CH> - <N>500 monedas<br>"
  169.                     message += "<N>Papá Noel : <J>/tnavidad3<CH> - <N>500 monedas<br>"                    
  170.                     message += "<N>Pastel Navideño : <J>/tnavidad4<CH> - <N>500 monedas<br>"
  171.                     message += "<N>Tormenta de Nieve : <J>/tnavidad5<CH> - <N>500 monedas<br>"
  172.                     message += "<N>Nevado : <J>/tnavidad6<CH> - <N>500 monedas<br>"
  173.                     #message += "<CH>Halloween<br>"
  174.                     #message += "<N>Zombie : <J>/thalloween1<CH> - <N>500 monedas<br>"
  175.                     #message += "<N>Casper : <J>/thalloween2<CH> - <N>500 monedas<br>"
  176.                     #message += "<N>Frankenmaus : <J>/thalloween3<CH> - <N>500 monedas<br>"                    
  177.                     #message += "<N>Von Drakkemous : <J>thalloween4<CH> - <N>500 monedas<br>"
  178.                     #message += "<N>Caza-Vampiros : <J>thalloween5<CH> - <N>500 monedas<br>"
  179.                     #message += "<N>Raton Lobo : <J>thalloween6<CH> - <N>500 monedas<br>"                    
  180.                     this.client.sendLogMessage(message.replace("&#", "&amp;#").replace("&lt;", "<"))
  181.  
  182.             elif command in ["equipo", "equipe"]:
  183.                     lists = ["<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>"]
  184.                     this.Cursor.execute("select Username, PrivLevel from Users where PrivLevel > 4")
  185.                     r = this.Cursor.fetchall()
  186.                     for rs in r:
  187.                         playerName = rs["Username"]
  188.                         privLevel = int(rs["PrivLevel"])
  189.                         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"
  190.                     this.client.sendLogMessage("<V><p align='center'><b>Equipo SourisMice</b></p>" + "".join(lists) + "</p>")                  
  191.              
  192.    
  193.             elif command in ["tiendamixadssda"]:
  194.                 this.client.sendTienda2()                      
  195.  
  196.             elif command in ["tiendamix2"]:
  197.                 this.client.sendTienda()
  198.                
  199.             elif command in ["equipo2"]:
  200.                 this.client.sendMessage("<R>Escribe /equipo<J> para ver la lista de los staff")
  201.                
  202.             elif command in ["comprarfichas"]:
  203.                 if this.client.nowCoins >= 10:
  204.                     this.client.nowCoins -= 10
  205.                     this.client.nowTokens += 1
  206.                     this.client.sendMessage("<ROSE>Compraste una ficha y tienes <N>"+str(this.client.nowCoins)+" monedas, -10")
  207.                 else:
  208.                     this.client.sendMessage("<R>No tienes monedas suficientes para hacer esta compra tienes : <N>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 10")
  209.                
  210.             elif command in ["vamp"]:
  211.                 if this.client.privLevel >= 2:
  212.                     if this.client.room.xdEnabled or this.client.privLevel >= 2:
  213.                         this.client.sendVampireMode(False)
  214.  
  215.             elif command in ["freebadges"]:
  216.                 if this.client.privLevel >= 2:
  217.                     badges = [0, 1, 6, 7, 9, 16, 17, 18, 33, 34, 35, 42, 46, 47, 50, 51, 55, 57, 58, 59]
  218.                     for badge in badges:
  219.                         if not badge in this.client.shopBadges:
  220.                             this.client.shopBadges.append(badge)
  221.                     this.client.sendMessage("<font color='#FFFFFF'>[ES]<font color='#00EEFF'> Desbloqueaste algunas insignias</font> ")                
  222. #TIENDA#       
  223.  
  224.             #elif command in ["rev"]:
  225.                 if this.client.nowCoins >= 100:
  226.                   if this.client.isDead >= True:  
  227.                     this.client.nowCoins -= 100
  228.                     this.client.sendMessage("<font color='#FFFFFF'>[ES]<font color='#00EEFF'> Acabas de revivir. -100</font> ")
  229.                     this.client.room.respawnSpecific(this.client.Username)
  230.                 else:
  231.                     this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowTokens)+" monedas y este articulo cuesta 500")
  232.                     this.client.sendMessage("<N>Actualmente tienes <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> Monedas")
  233.    
  234.             elif command in ["vsha"]:
  235.                 if this.client.privLevel == 2:
  236.                     if this.client.nowCoins >= 500:
  237.                         this.client.nowCoins -= 500
  238.                         this.client.isShaman = True
  239.                         for player in this.client.room.clients.values():
  240.                             player.sendShamanCode(this.client.playerCode)
  241.                     else:
  242.                         this.client.sendMessage("<J> "+this.client.Username+" No tienes monedas suficientes para hacer esta compra, tienes : <R>"+str(this.client.nowTokens)+" monedas")
  243.                 else:
  244.                     this.client.sendMessage("<font color='#FFFFFF'>[ES]<font color='#00EEFF'> Comando solo para los VIPs</font> ")
  245.  
  246.             elif command in ["titulo1"]:
  247.                 if this.client.nowCoins >= 500:
  248.                     titleID = 71.1 if id == 1 else 71.1
  249.                     this.client.nowCoins -= 500
  250.                     this.client.specialTitleList.append(titleID);
  251.                     this.client.sendUnlockedTitle(str(int(titleID)), "")
  252.                     this.client.sendCompleteTitleList()
  253.                     this.client.sendTitleList()
  254.                     this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>RELÂMPAGO</ROSE> -500")
  255.                 else:
  256.                     this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowTokens)+" monedas y este articulo cuesta 500")
  257.                     this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
  258.  
  259.             elif command in ["titulo2"]:
  260.                 if this.client.nowCoins >= 300:
  261.                     titleID = 114.1 if id == 1 else 114.1
  262.                     this.client.nowCoins -= 300
  263.                     this.client.specialTitleList.append(titleID);
  264.                     this.client.sendUnlockedTitle(str(int(titleID)), "")
  265.                     this.client.sendCompleteTitleList()
  266.                     this.client.sendTitleList()
  267.                     this.client.sendMessage("<N>Acabas de gastar 300 monedas comprando el título <ROSE>Alpha & Omega</ROSE> -300")
  268.                 else:
  269.                     this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 300")
  270.                     this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
  271.  
  272.             elif command in ["tnavidad1"]:
  273.                 if this.client.nowCoins >= 500:
  274.                     titleID = 127.1 if id == 1 else 127.1
  275.                     this.client.nowCoins -= 500
  276.                     this.client.specialTitleList.append(titleID);
  277.                     this.client.sendUnlockedTitle(str(int(titleID)), "")
  278.                     this.client.sendCompleteTitleList()
  279.                     this.client.sendTitleList()
  280.                     this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Copito de Nieve</ROSE> -500")
  281.                 else:
  282.                     this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
  283.                     this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
  284.                    
  285.             elif command in ["tnavidad2"]:
  286.                 if this.client.nowCoins >= 500:
  287.                     titleID = 128.1 if id == 1 else 128.1
  288.                     this.client.nowCoins -= 500
  289.                     this.client.specialTitleList.append(titleID);
  290.                     this.client.sendUnlockedTitle(str(int(titleID)), "")
  291.                     this.client.sendCompleteTitleList()
  292.                     this.client.sendTitleList()
  293.                     this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Espíritu Navideño</ROSE> -500")
  294.                 else:
  295.                     this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
  296.                     this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
  297.                    
  298.             elif command in ["tnavidad3"]:
  299.                 if this.client.nowCoins >= 500:
  300.                     titleID = 130.1 if id == 1 else 130.1
  301.                     this.client.nowCoins -= 500
  302.                     this.client.specialTitleList.append(titleID);
  303.                     this.client.sendUnlockedTitle(str(int(titleID)), "")
  304.                     this.client.sendCompleteTitleList()
  305.                     this.client.sendTitleList()
  306.                     this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Papá Noel</ROSE> -500")
  307.                 else:
  308.                     this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
  309.                     this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")       
  310.  
  311.             elif command in ["tnavidad4"]:
  312.                 if this.client.nowCoins >= 500:
  313.                     titleID = 241.1 if id == 1 else 241.1
  314.                     this.client.nowCoins -= 500
  315.                     this.client.specialTitleList.append(titleID);
  316.                     this.client.sendUnlockedTitle(str(int(titleID)), "")
  317.                     this.client.sendCompleteTitleList()
  318.                     this.client.sendTitleList()
  319.                     this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Pastel Navideño</ROSE> -500")
  320.                 else:
  321.                     this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
  322.                     this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")       
  323.  
  324.             elif command in ["tnavidad5"]:
  325.                 if this.client.nowCoins >= 500:
  326.                     titleID = 245.1 if id == 1 else 245.1
  327.                     this.client.nowCoins -= 500
  328.                     this.client.specialTitleList.append(titleID);
  329.                     this.client.sendUnlockedTitle(str(int(titleID)), "")
  330.                     this.client.sendCompleteTitleList()
  331.                     this.client.sendTitleList()
  332.                     this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Tormenta de Nieve</ROSE> -500")
  333.                 else:
  334.                     this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
  335.                     this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
  336.  
  337.             elif command in ["tnavidad6"]:
  338.                 if this.client.nowCoins >= 500:
  339.                     titleID = 244.1 if id == 1 else 244.1
  340.                     this.client.nowCoins -= 500
  341.                     this.client.specialTitleList.append(titleID);
  342.                     this.client.sendUnlockedTitle(str(int(titleID)), "")
  343.                     this.client.sendCompleteTitleList()
  344.                     this.client.sendTitleList()
  345.                     this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Nevado</ROSE> -500")
  346.                 else:
  347.                     this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
  348.                     this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")           
  349.  
  350.             #elif command in ["thalloween1"]:
  351.                 if this.client.nowCoins >= 500:
  352.                     titleID = 346.1 if id == 1 else 346.1
  353.                     this.client.nowCoins -= 500
  354.                     this.client.specialTitleList.append(titleID);
  355.                     this.client.sendUnlockedTitle(str(int(titleID)), "")
  356.                     this.client.sendCompleteTitleList()
  357.                     this.client.sendTitleList()
  358.                     this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Zombie</ROSE> -500")
  359.                 else:
  360.                     this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
  361.                     this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")   
  362.  
  363.             #elif command in ["thalloween2"]:
  364.                 if this.client.nowCoins >= 500:
  365.                     titleID = 343.1 if id == 1 else 343.1
  366.                     this.client.nowCoins -= 500
  367.                     this.client.specialTitleList.append(titleID);
  368.                     this.client.sendUnlockedTitle(str(int(titleID)), "")
  369.                     this.client.sendCompleteTitleList()
  370.                     this.client.sendTitleList()
  371.                     this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Casper</ROSE> -500")
  372.                 else:
  373.                     this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
  374.                     this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
  375.  
  376.             #elif command in ["thalloween3"]:
  377.                 if this.client.nowCoins >= 500:
  378.                     titleID = 300.1 if id == 1 else 300.1
  379.                     this.client.nowCoins -= 500
  380.                     this.client.specialTitleList.append(titleID);
  381.                     this.client.sendUnlockedTitle(str(int(titleID)), "")
  382.                     this.client.sendCompleteTitleList()
  383.                     this.client.sendTitleList()
  384.                     this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Frankenmaus</ROSE> -500")
  385.                 else:
  386.                     this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
  387.                     this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
  388.  
  389.             #elif command in ["thalloween4"]:
  390.                 if this.client.nowCoins >= 500:
  391.                     titleID = 307.1 if id == 1 else 307.1
  392.                     this.client.nowCoins -= 500
  393.                     this.client.specialTitleList.append(titleID);
  394.                     this.client.sendUnlockedTitle(str(int(titleID)), "")
  395.                     this.client.sendCompleteTitleList()
  396.                     this.client.sendTitleList()
  397.                     this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Von Drekkemaus</ROSE> -500")
  398.                 else:
  399.                     this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
  400.                     this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
  401.  
  402.             #elif command in ["thalloween5"]:
  403.                 if this.client.nowCoins >= 500:
  404.                     titleID = 347.1 if id == 1 else 347.1
  405.                     this.client.nowCoins -= 500
  406.                     this.client.specialTitleList.append(titleID);
  407.                     this.client.sendUnlockedTitle(str(int(titleID)), "")
  408.                     this.client.sendCompleteTitleList()
  409.                     this.client.sendTitleList()
  410.                     this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Caza-vampiros</ROSE> -500")
  411.                 else:
  412.                     this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
  413.                     this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
  414.  
  415.             #elif command in ["thalloween6"]:
  416.                 if this.client.nowCoins >= 500:
  417.                     titleID = 412.1 if id == 1 else 412.1
  418.                     this.client.nowCoins -= 500
  419.                     this.client.specialTitleList.append(titleID);
  420.                     this.client.sendUnlockedTitle(str(int(titleID)), "")
  421.                     this.client.sendCompleteTitleList()
  422.                     this.client.sendTitleList()
  423.                     this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el título <ROSE>Ratón lobo</ROSE> -500")
  424.                 else:
  425.                     this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
  426.                     this.client.sendMessage("<N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")
  427.                    
  428.             elif command in ["perfil1"]:
  429.                 if this.client.nowCoins >= 90:
  430.                     this.client.nowCoins -= 90
  431.                     this.client.firstCount += 300
  432.                     this.client.cheeseCount += 300
  433.                     this.client.sendMessage("<N>Acabas de gastar 90 monedas comprando el paquete <ROSE>de 300 firsts y quesos</ROSE> -90")
  434.                 else:
  435.                     this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 90")
  436.                     this.client.sendMessage("<N>Actualmente tienes <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")                        
  437.                    
  438.             elif command in ["perfil2"]:
  439.                 if this.client.nowCoins >= 500:
  440.                      this.client.nowCoins -= 500
  441.                      this.client.shamanSaves += 300
  442.                      this.client.sendMessage("<N>Acabas de gastar 500 monedas comprando el paquete <ROSE>de 300 saves</ROSE> -500")
  443.                 else:
  444.                     this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
  445.                     this.client.sendMessage("<N>Actualmente tienes <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")          
  446.  
  447.             elif command in ["perfil3"]:
  448.                 if this.client.nowCoins >= 40:
  449.                      this.client.nowCoins -= 40
  450.                      this.client.firstCount += 100
  451.                      this.client.cheeseCount += 100
  452.                      this.client.sendMessage("<N>Acabas de gastar 40 monedas comprando el paquete <ROSE>de 100 firsts y quesos</ROSE> -40")
  453.                 else:
  454.                     this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 40")
  455.                     this.client.sendMessage("<N>Actualmente tienes <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")    
  456.  
  457.             elif command in ["perfil4"]:
  458.                 if this.client.nowCoins >= 50:
  459.                      this.client.nowCoins -= 50
  460.                      this.client.firstCount += 50
  461.                      this.client.cheeseCount += 50
  462.                      this.client.sendMessage("<N>Acabas de gastar 50 monedas comprando el paquete <ROSE>de 50 firsts y quesos</ROSE> -50")
  463.                 else:
  464.                     this.client.sendMessage("<N>No tienes monedas suficientes para hacer esta compra tienes : <R>"+str(this.client.nowCoins)+" monedas y este articulo cuesta 500")
  465.                     this.client.sendMessage("<N>Actualmente tienes <font color='#64FE2E'>"+str(this.client.nowCoins)+"</font> monedas")                
  466. #FIN TIENDA#               
  467.             elif command == "avatar":
  468.                 if this.client.privLevel >= 1:
  469.             avaid = this.client.TFMUtils.parsePlayerName(args[0])
  470.             if avaid.isdigit():
  471.                     avaid = int(avaid)
  472.                     if this.client.playerAvatar != avaid:
  473.                         if avaid >= 99999999:
  474.                                 this.client.sendMessage('<J>•<N> ¡Incorrecto!')
  475.                         else:
  476.                                 this.Cursor.execute('UPDATE users SET avatar = ? WHERE Username = ?', [avaid, this.client.Username])
  477.                             this.client.playerAvatar = avaid
  478.                         if this.client.Langue == "ES":
  479.                                 this.client.sendMessage("<J>[ES]<N> Avatar seleccionado con exito: [<J>%r]<N>." % (avaid))
  480.                         if this.client.Langue == "BR":
  481.                                 this.client.sendMessage("<J>[BR]<N> Avatar selecionado Com Sucesso: [<J>%r]<N>." % (avaid))                            
  482.                     else:
  483.                         if this.client.Langue == "ES":
  484.                                 this.client.sendMessage("<J>[ES]<N> Ya estas usando el avatar: <J>[<J>%s]<N>." % (str(avaid)))     
  485.                         if this.client.Langue == "BR":
  486.                                 this.client.sendMessage("<J>[BR]<N> Você ja está usando esse avatar: <J>[<J>%s]<N>." % (str(avaid)))                             
  487.  
  488.                                
  489. #br hero#
  490.             elif command in ["cor"]:
  491.                 if this.client.privLevel >= 1:
  492.                     if len(args) == 1:
  493.                         hexColor = args[0][1:] if args[0].startswith("#") else args[0]
  494.  
  495.                         try:
  496.                             value = int(hexColor, 16)
  497.                             this.client.mouseColor = hexColor
  498.                             this.client.playerLook = "1;" + this.client.playerLook.split(";")[1]
  499.                             this.client.sendMessage("[BR] A cor do seu rato foi trocada com susseso.")
  500.                         except:
  501.                             this.client.sendMessage("[BR] Cor invalido coloque um code HEX (#00000).")
  502.                        
  503.                     elif len(args) > 1:
  504.                         if this.client.privLevel >= 9:
  505.                             playerName = this.client.Utils.parsePlayerName(args[0])
  506.                             hexColor = "" if args[1] == "off" else args[1][1:] if args[1].startswith("#") else args[1]
  507.                             try:
  508.                                 value = 0 if hexColor == "" else int(hexColor, 16)
  509.                                 if playerName == "*":
  510.                                     for player in this.client.room.players.values():
  511.                                         player.tempMouseColor = hexColor
  512.                                    
  513.                                 else:
  514.                                     player = this.server.players.get(playerName)
  515.                                     if player != None:
  516.                                         player.tempMouseColor = hexColor
  517.                             except:
  518.                                 this.client.sendMessage("[BR] Cor invalido coloque um code HEX (#00000).")
  519.                     else:
  520.                         this.client.room.showColorPicker(10001, this.client.Username, int(this.client.MouseColor, 16), "[BR] Seleccione um cor pra seu rato.")
  521.  
  522.  
  523. #fin br#      
  524.  
  525.             elif command in ["color"]:
  526.                 if this.client.privLevel >= 1:
  527.                     if len(args) == 1:
  528.                         hexColor = args[0][1:] if args[0].startswith("#") else args[0]
  529.  
  530.                         try:
  531.                             value = int(hexColor, 16)
  532.                             this.client.mouseColor = hexColor
  533.                             this.client.playerLook = "1;" + this.client.playerLook.split(";")[1]
  534.                             this.client.sendMessage("El color de tu ratón fue cambiado.")
  535.                         except:
  536.                             this.client.sendMessage("Color invalido. Ulilice colorpicker.com (HEX) ej: (#00000).")
  537.                        
  538.                     elif len(args) > 1:
  539.                         if this.client.privLevel >= 9:
  540.                             playerName = this.client.Utils.parsePlayerName(args[0])
  541.                             hexColor = "" if args[1] == "off" else args[1][1:] if args[1].startswith("#") else args[1]
  542.                             try:
  543.                                 value = 0 if hexColor == "" else int(hexColor, 16)
  544.                                 if playerName == "*":
  545.                                     for player in this.client.room.players.values():
  546.                                         player.tempMouseColor = hexColor
  547.                                    
  548.                                 else:
  549.                                     player = this.server.players.get(playerName)
  550.                                     if player != None:
  551.                                         player.tempMouseColor = hexColor
  552.                             except:
  553.                                 this.client.sendMessage("Color invalido. Ulilice colorpicker.com (HEX) ej: (#00000).")
  554.                     else:
  555.                         this.client.room.showColorPicker(10001, this.client.Username, int(this.client.MouseColor, 16), "Seleccione un color para su ratón.")
  556.  
  557.             elif command == "ban" or command == "iban":
  558.                 if this.client.privLevel >= 5:
  559.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  560.                     time = args[1] if (argsCount >= 2) else "1"
  561.                     reason = argsNotSplited.split(" ", 2)[2] if (argsCount >= 3) else ""
  562.                     silent = command == "iban"
  563.                     hours = int(time) if (time.isdigit()) else 1
  564.                     hours = 100000 if (hours > 100000) else hours
  565.                     hours = 24 if (this.client.privLevel <= 6 and hours > 24) else hours
  566.                     if this.server.banPlayer(playerName, hours, reason, this.client.Username, silent):
  567.                             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>." )
  568.                             aq=open("./include/comandos/ban.log","a"); aq.write(""+this.client.Username+" baneo a "+playerName+" por "+str(hours)+" horas. Motivo: "+str(reason)+"\n")
  569.  
  570.             elif command in ["unban"]:
  571.                 if this.client.privLevel == 10:
  572.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  573.                     this.requireNoSouris(playerName)
  574.                     found = False
  575.  
  576.                     if this.server.checkExistingUser(playerName):
  577.                         if this.server.checkTempBan(playerName):
  578.                             this.server.removeTempBan(playerName)
  579.                             found = True
  580.  
  581.                         if this.server.checkPermaBan(playerName):
  582.                             this.server.removePermaBan(playerName)
  583.                             found = True
  584.  
  585.                         if found:
  586.                             import time
  587.                             this.Cursor.execute("insert into BanLog values (?, ?, '', '', ?, 'Unban', '', '')", [playerName, this.client.Username, int(str(time.time())[:9])])
  588.                             this.server.sendStaffMessage(5, "<V>%s</V> desbaneo a <V>%s</V>." %(this.client.Username, playerName))
  589.  
  590.             elif command in ["unbanip"]:
  591.                 if this.client.privLevel >= 7:
  592.                     ip = args[0]
  593.                     if ip in this.server.ipPermaBanCache:
  594.                         this.server.ipPermaBanCache.remove(ip)
  595.                         this.Cursor.execute("delete from ippermaban where IP = ?", [ip])
  596.                         this.server.sendStaffMessage(7, "<V>%s</V> desbaneo la ip <V>%S</V>." %(this.client.Username, ip))
  597.                     else:
  598.                         this.client.sendMessage("Esta ip no esta baneada.")        
  599.                        
  600.             elif command == "mute":
  601.                 if this.client.privLevel >= 5:
  602.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  603.                     time = args[1] if (argsCount >= 2) else "1"
  604.                     reason = argsNotSplited.split(" ", 2)[2] if (argsCount >= 3) else ""
  605.                     hours = int(time) if (time.isdigit()) else 1
  606.                     this.requireNoSouris(playerName)
  607.                     hours = 500 if (hours > 500) else hours
  608.                     hours = 24 if (this.client.privLevel <= 6 and hours > 24) else hours
  609.                     this.server.mutePlayer(playerName, hours, reason, this.client.Username)
  610.  
  611.  
  612.             elif command in ["unmute"]:
  613.                 if this.client.privLevel >= 7:
  614.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  615.                     this.requireNoSouris(playerName)
  616.                     this.server.sendStaffMessage(5, "<V>%s</V> desmuteo a <V>%s</V>." %(this.client.Username, playerName))
  617.                     this.server.removeModMute(playerName)
  618.                     this.client.isMute = False
  619.                
  620.             elif command in ["rank"]:
  621.                 if this.client.privLevel >= 10 or this.client.Username == "Friki":
  622.                  playerName = this.client.TFMUtils.parsePlayerName(args[0])
  623.                  rank = args[1].lower()
  624.                  this.requireNoSouris(playerName)
  625.                  if this.server.adminAllow[0]:
  626.                     if not this.server.checkExistingUser(playerName):
  627.                         this.client.sendMessage("No fue posible encontrar al jugador: <V>%s</V>." %(playerName))
  628.                     else:
  629.                         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
  630.                         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"
  631.                         player = this.server.players.get(playerName)
  632.                         if player != None:
  633.                             player.privLevel = privLevel
  634.                             player.TitleNumber = 0
  635.                             player.sendCompleteTitleList()
  636.                         else:
  637.                             this.Cursor.execute("update Users set PrivLevel = ?, TitleNumber = 0 where Username = ?", [privLevel, playerName])
  638.                         this.server.sendStaffMessage(7, "<V>%s</V> acaba de ganar el rango <V>%s</V>." %(playerName, rankName))
  639.                        
  640.             elif command in ["np", "npp"]:
  641.                 if this.client.privLevel >= 6:
  642.                     if len(args) == 0:
  643.                         this.client.room.mapChange()
  644.                     else:
  645.                         if not this.client.room.isVotingMode:
  646.                             code = args[0]
  647.                             if code.startswith("@"):
  648.                                 mapInfo = this.client.room.getMapInfo(int(code[1:]))
  649.                                 if mapInfo[0] == None:
  650.                                     this.client.sendLangueMessage("", "$CarteIntrouvable")
  651.                                 else:
  652.                                     this.client.room.forceNextMap = code
  653.                                     if command == "np":
  654.                                         if this.client.room.changeMapTimer != None:
  655.                                             this.client.room.changeMapTimer.cancel()
  656.                                         this.client.room.mapChange()
  657.                                     else:
  658.                                         this.client.sendLangueMessage("", "$ProchaineCarte " + code)
  659.  
  660.                             elif code.isdigit():
  661.                                 this.client.room.forceNextMap = code
  662.                                 if command == "np":
  663.                                     if this.client.room.changeMapTimer != None:
  664.                                         this.client.room.changeMapTimer.cancel()
  665.                                     this.client.room.mapChange()
  666.                                 else:
  667.                                     this.client.sendLangueMessage("", "$ProchaineCarte " + code)
  668.  
  669.             elif command in ["staff", "mapcrews"]:
  670.                 staff = {}
  671.                 staffList = "$ModoPasEnLigne" if command == "staff" else "$MapcrewPasEnLigne"
  672.  
  673.                 for player in this.server.players.values():
  674.                     if command == "staff" and player.privLevel >= 4 and not player.privLevel == 6 or command == "mapcrews" and player.privLevel == 6:
  675.                         if staff.has_key(player.Langue.lower()):
  676.                             names = staff[player.Langue.lower()]
  677.                             names.append(player.Username)
  678.                             staff[player.Langue.lower()] = names
  679.                         else:
  680.                             names = []
  681.                             names.append(player.Username)
  682.                             staff[player.Langue.lower()] = names
  683.  
  684.                 if len(staff) >= 1:
  685.                     staffList = "$ModoEnLigne" if command == "staff" else "$MapcrewEnLigne"
  686.                     for list in staff.items():
  687.                         staffList += "<br><CH>["+str(list[0])+"] <R>"+str("<CH>, <BV>").join(list[1])
  688.  
  689.                 this.client.sendLangueMessage("", staffList)
  690.  
  691.             elif command in ["lsassad"]:
  692.                 if this.client.privLevel >= 4:
  693.                     this.client.sendMessage("[ES]pon /lses\n\n[BR] pon /lsbr")
  694.                    
  695.             elif command in ["abrirmenu"]:
  696.                 if this.client.privLevel >= 1:
  697.                     if this.client.Langue == "ES":
  698.                         this.client.sendMenu()
  699.                         this.client.sendMessage("• Ha abierto el menú para cerrarlo escriba : <J>/cerrarmenu")                  
  700.                     if this.client.Langue == "BR":
  701.                         this.client.sendMenu()         
  702.                         this.client.sendMessage("• Você abriu o menu,para fecha-lo digite : <J>/fecharmenu")
  703.  
  704.             elif command in ["abrirstaff"]:
  705.                 if this.client.privLevel >= 1:
  706.                     if this.client.Langue == "ES":
  707.                         this.client.sendStaff()
  708.                         this.client.sendMessage("• Ha abierto el menú para cerrarlo escriba : <J>/cerrarmenustaff")                 
  709.                        
  710.             elif command in ["cerrarmenu", "fecharmenu"]:
  711.                 if this.client.privLevel >= 1:
  712.                     if this.client.Langue == "ES":             
  713.                         this.client.room.removeTextArea(10000, this.client.Username)
  714.                         this.client.sendMessage("• Su menú se cerró para una mejor jugabilidad, para abrirlo escriba : <J>/abrirmenu")                     
  715.                     if this.client.Langue == "BR":             
  716.                         this.client.room.removeTextArea(10000, this.client.Username)
  717.                         this.client.sendMessage("• Seu menu foi fechado para melhor jogabilidade,para abri-lo digite : <J>/abrirmenu")
  718.  
  719.             elif command in ["cerrarmenustaff"]:
  720.                 if this.client.privLevel >= 1:
  721.                     if this.client.Langue == "ES":             
  722.                         this.client.room.removeTextArea(199999, this.client.Username)
  723.                         this.client.sendMessage("• Su menú Staff se cerró para una mejor jugabilidad, para abrirlo escriba : <J>/abrirstaff")                          
  724.                        
  725.             elif command in ["lsbrasds"]:
  726.                 if this.client.privLevel >= 4:
  727.                     data = []
  728.  
  729.                     for room in this.server.rooms.values():
  730.                         if room.name.startswith("*") and not room.name.startswith("*" + chr(3)):
  731.                             data.append(["ALL", room.name, room.getPlayerCount()])
  732.                         elif room.name.startswith(str(chr(3))) or room.name.startswith("*" + chr(3)):
  733.                             if room.name.startswith(("*" + chr(3))):
  734.                                 data.append(["TRIBEHOUSE", room.name, room.getPlayerCount()])
  735.                             else:
  736.                                 data.append(["PRIVATE", room.name, room.getPlayerCount()])
  737.                         else:
  738.                             data.append([room.community.upper(), room.roomName, room.getPlayerCount()])
  739.  
  740.                     result = "\n"
  741.                     for roomInfo in data:
  742.                         result += "[<J>"+str(roomInfo[0])+"<BL>] <b>"+str(roomInfo[1])+"</b> : "+str(roomInfo[2])+"\n"
  743.                                
  744.                     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>"
  745.                     this.client.sendMessage(result)
  746.  
  747.             elif command in ["ls"]:
  748.                 if this.client.privLevel >= 4:
  749.                     data = []
  750.  
  751.                     for room in this.server.rooms.values():
  752.                         if room.name.startswith("*") and not room.name.startswith("*" + chr(3)):
  753.                             data.append(["ALL", room.name, room.getPlayerCount()])
  754.                         elif room.name.startswith(str(chr(3))) or room.name.startswith("*" + chr(3)):
  755.                             if room.name.startswith(("*" + chr(3))):
  756.                                 data.append(["TRIBEHOUSE", room.name, room.getPlayerCount()])
  757.                             else:
  758.                                 data.append(["PRIVATE", room.name, room.getPlayerCount()])
  759.                         else:
  760.                             data.append([room.community.upper(), room.roomName, room.getPlayerCount()])
  761.  
  762.                     result = "\n"
  763.                     for roomInfo in data:
  764.                         result += "[<J>"+str(roomInfo[0])+"<BL>] <b>"+str(roomInfo[1])+"</b> : "+str(roomInfo[2])+"\n"
  765.                                
  766.                     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>"
  767.                     this.client.sendMessage(result)                    
  768.                        
  769.             elif command in ["lsc"]:
  770.                 if this.client.privLevel >= 4:
  771.                     result = {}
  772.                     for room in this.server.rooms.values():
  773.                         if result.has_key(room.community):
  774.                             result[room.community] = result[room.community] + room.getPlayerCount()
  775.                         else:
  776.                             result[room.community] = room.getPlayerCount()
  777.  
  778.                     message = "\n"
  779.                     for community in result.items():
  780.                         message += "<V>"+str(community[0].upper())+"<BL> : <J>"+str(community[1])+"\n"
  781.                     message += "<V>Total<BL> : <J>"+str(sum(result.values()))
  782.                     this.client.sendMessage(message)
  783.  
  784.             elif command in ["skip"]:
  785.                 if this.client.canSkipMusic and this.client.room.isMusic and this.client.room.isPlayingMusic:
  786.                     this.client.room.musicSkipVotes += 1
  787.                     this.client.checkMusicSkip()
  788.  
  789.             elif command in ["pw"]:
  790.                 if this.client.room.roomName.startswith("*" + this.client.Username) or this.client.room.roomName.startswith(this.client.Username):
  791.                     if len(args) == 0:
  792.                         this.client.room.roomPassword = ""
  793.                         this.client.sendLangueMessage("", "$MDP_Desactive")
  794.                     else:
  795.                         password = args[0]
  796.                         this.client.room.roomPassword = password
  797.                         this.client.sendLangueMessage("", "$Mot_De_Passe : " + password)
  798.  
  799.             elif command in ["smn"]:
  800.                 if this.client.privLevel >= 9:
  801.                     this.client.sendAllModerationChat(-1, argsNotSplited)
  802.  
  803.             elif command == "mshtml":
  804.                 if this.client.privLevel == 10:
  805.                     message = argsNotSplited.replace("&#", "&amp;#").replace("&lt;", "<")
  806.                     this.client.sendAllModerationChat(0, message)  
  807.  
  808.             elif command == "mixcreador":
  809.                 if this.client.privLevel == 10:
  810.                     if this.client.Langue == "ES":
  811.                         message = argsNotSplited
  812.                         this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<font color='#FFFFFF'>• <font color='#2E72CB'>[ES] [Creador]["+this.client.Username+"] <N>"+message).toByteArray())                      
  813.             elif command == "admin":
  814.                 if this.client.privLevel == 10:
  815.                     if this.client.Langue == "ES":
  816.                         message = argsNotSplited
  817.                         this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<font color='#FFFFFF'>• <font color='#EB1D51'>[ES] [Administrador]["+this.client.Username+"] <N>"+message).toByteArray())
  818.                                                                                                
  819.             elif command == "coord":
  820.                 if this.client.privLevel >= 9:
  821.                     if this.client.Langue == "ES":
  822.                         message = argsNotSplited
  823.                         this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<font color='#FFFFFF'>• <font color='#46CFA1'>[ES] [Coordinador]["+this.client.Username+"] <N>"+message).toByteArray())
  824.                                            
  825.             elif command == "smod" or command == "sms":
  826.                 if this.client.privLevel >= 8:
  827.                     if this.client.Langue == "ES":
  828.                         message = argsNotSplited
  829.                         this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<font color='#FFFFFF'>• <font color='#00FFDB'>[ES] [SuperModerador]["+this.client.Username+"] <N>"+message).toByteArray())
  830.                                            
  831.             elif command == "moderador":
  832.                 if this.client.privLevel >= 7:
  833.                     if this.client.Langue == "ES":
  834.                         message = argsNotSplited
  835.                         this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<font color='#FFFFFF'>• <font color='#BABD2F'>[ES] [Moderador]["+this.client.Username+"] <N>"+message).toByteArray())
  836.                                            
  837.             elif command == "mapc":
  838.                 if this.client.privLevel >= 6:
  839.                     if this.client.Langue == "ES":
  840.                         message = argsNotSplited
  841.                         this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<font color='#FFFFFF'>• <font color='#2E72CB'>[ES] [MapCrew]["+this.client.Username+"] <N>"+message).toByteArray())
  842.                                            
  843.             elif command == "ayudante":
  844.                 if this.client.privLevel >= 5:
  845.                     if this.client.Langue == "ES":
  846.                         message = argsNotSplited
  847.                         this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<font color='#FFFFFF'>• <font color='#CA66C3'>[ES] [Ayudante]["+this.client.Username+"] <N>"+message).toByteArray())
  848.                                            
  849.             elif command == "vip":
  850.                 if this.client.privLevel >= 2:
  851.                     if this.client.Langue == "ES":
  852.                         message = argsNotSplited
  853.                         this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<font color='#FFFFFF'>• <font color='#15A215'>[ES] [VIP]["+this.client.Username+"] <N>"+message).toByteArray())
  854.                                            
  855.             elif command == "glbl":
  856.                 if this.client.privLevel >= 5:
  857.                     message = argsNotSplited
  858.                     this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<V>• <font color='#ED67EA'>[<b>"+this.client.Username+"</b>] "+message+"</font>").toByteArray())
  859.  
  860.             elif command == "evento":
  861.                 if this.client.privLevel >= 3:
  862.                     message = argsNotSplited
  863.                     this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<ROSE>• [<N>Evento<ROSE>]</font> <N>"+message).toByteArray())
  864.  
  865.             elif command == "Sourismice":
  866.                 if this.client.privLevel == 10:
  867.                     if this.client.Langue == "ES":
  868.                         message = argsNotSplited
  869.                         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())
  870.                        
  871.             elif command in ["hide"]:
  872.                 if this.client.privLevel >= 5:
  873.                     this.client.isHidden = True
  874.                     this.client.sendPlayerDisconnect()
  875.                     this.client.sendMessage("Usted esta invisible.")
  876.  
  877.             elif command in ["unhide"]:
  878.                 if this.client.privLevel >= 5:
  879.                     if this.client.isHidden:
  880.                         this.client.isHidden = False
  881.                         this.client.enterRoom(this.client.room.name)
  882.                         this.client.sendMessage("Usted esta visible.")
  883.                        
  884.             elif command in ["reboot"]:
  885.                 if this.client.privLevel == 10:
  886.                     this.server.sendServerReboot() 
  887.  
  888.             elif command in ["equipo10"]:
  889.                 if this.client.privLevel == 10:        
  890.                     lists = ["<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>"]
  891.                     this.Cursor.execute("select Username, PrivLevel from Users where PrivLevel > 4")
  892.                     r = this.Cursor.fetchall()
  893.                     for rs in r:
  894.                         playerName = rs["Username"]
  895.                         privLevel = int(rs["PrivLevel"])
  896.                         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"
  897.                     this.client.sendLogMessage("<V><p align='center'><b>Equipo SourisMice</b></p>" + "".join(lists) + "</p>")                  
  898.                    
  899.             elif command in ["shutdown"]:
  900.                 if this.client.privLevel == 10:
  901.                     this.server.closeServer()
  902.  
  903.             elif command in ["updatesql"]:
  904.                 if this.client.privLevel == 10:
  905.                     this.server.updateConfig()
  906.                     for player in this.server.players.values():
  907.                         if not player.isGuest:
  908.                             player.updateDatabase()
  909.  
  910.                     this.server.sendStaffMessage(5, "%s esta actualizando los datos de los jugadores." %(this.client.Username))
  911.                    
  912.             elif command in ["monedas"]:
  913.                 this.client.sendMessage("<R>Tienes : "+str(this.client.nowCoins)+"\n monedas. <N>Para ver tus fichas escribe /fichas")
  914.  
  915.             elif command in ["fichas"]:
  916.                 this.client.sendMessage("<R>Tienes : "+str(this.client.nowTokens)+"\n fichas. <N>Para ver tus monedas escribe /monedas")
  917.                
  918.             elif command in ["kill", "suicide", "mort", "die"]:
  919.                 if not this.client.isDead:
  920.                     this.client.isDead = True
  921.                     if not this.client.room.noAutoScore: this.client.playerScore += 1
  922.                     this.client.sendPlayerDied()
  923.                     this.client.room.checkShouldChangeMap()
  924.  
  925.             elif command in ["title", "titulo", "titre"]:
  926.                 if this.client.privLevel >= 1:
  927.                     if len(args) == 0:
  928.                         p = ByteArray()
  929.                         p2 = ByteArray()
  930.                         titlesCount = 0
  931.                         starTitlesCount = 0
  932.  
  933.                         for title in this.client.titleList:
  934.                             titleInfo = str(title).split(".")
  935.                             titleNumber = int(titleInfo[0])
  936.                             titleStars = int(titleInfo[1])
  937.                             if 1 < titleStars:
  938.                                 p.writeShort(titleNumber).writeByte(titleStars)
  939.                                 starTitlesCount += 1
  940.                             else:
  941.                                 p2.writeShort(titleNumber)
  942.                                 titlesCount += 1
  943.                         this.client.sendPacket(Identifiers.send.Titles_List, ByteArray().writeShort(titlesCount).writeBytes(p2.toByteArray()).writeShort(starTitlesCount).writeBytes(p.toByteArray()).toByteArray())
  944.                     else:
  945.                         titleID = args[0]
  946.                         found = False
  947.                         for title in this.client.titleList:
  948.                             if str(title).split(".")[0] == titleID:
  949.                                 found = True
  950.                         if found:
  951.                             this.client.TitleNumber = int(titleID)
  952.                             for title in this.client.titleList:
  953.                                 if str(title).split(".")[0] == titleID:
  954.                                     this.client.TitleStars = int(str(title).split(".")[1])
  955.                             this.client.sendPacket(Identifiers.send.Change_Title, ByteArray().writeUnsignedByte(0 if titleID == 0 else 1).writeUnsignedShort(titleID).toByteArray())
  956.  
  957.             elif command in ["sy?"]:
  958.                 if this.client.privLevel >= 5:
  959.                     this.client.sendLangueMessage("", "$SyncEnCours : [" + this.client.room.currentSyncName + "]")
  960.  
  961.             elif command in ["sy"]:
  962.                 if this.client.privLevel >= 7:
  963.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  964.                     player = this.server.players.get(playerName)
  965.                     if player != None:
  966.                         player.isSync = True
  967.                         this.client.room.currentSyncCode = player.playerCode
  968.                         this.client.room.currentSyncName = player.Username
  969.                         if this.client.room.mapCode != -1 or this.client.room.EMapCode != 0:
  970.                             this.client.sendPacket(Identifiers.old.send.Sync, [player.playerCode, ""])
  971.                         else:
  972.                             this.client.sendPacket(Identifiers.old.send.Sync, [player.playerCode])
  973.  
  974.                         this.client.sendLangueMessage("", "$NouveauSync <V>" + playerName)
  975.  
  976.             elif command in ["ch"]:
  977.                 if this.client.privLevel >= 7:
  978.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  979.                     player = this.server.players.get(playerName)
  980.                     if player != None:
  981.                         if this.client.room.forceNextShaman == player:
  982.                             this.client.sendLangueMessage("", "$PasProchaineChamane", player.Username)
  983.                             this.client.room.forceNextShaman = -1
  984.                         else:
  985.                             this.client.sendLangueMessage("", "$ProchaineChamane", player.Username)
  986.                             this.client.room.forceNextShaman = player
  987.  
  988.             elif re.match("p\\d+(\\.\\d+)?", command):
  989.                 if this.client.privLevel >= 6:
  990.                     mapCode = this.client.room.mapCode
  991.                     mapName = this.client.room.mapName
  992.                     currentCategory = this.client.room.mapPerma
  993.                     if mapCode != -1:
  994.                         category = int(command[1:])
  995.                         if category in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 17, 18, 19, 22, 41, 42, 44]:
  996.                             this.server.sendStaffMessage(6, "[%s] @%s : %s -> %s" %(this.client.Username, mapCode, currentCategory, category))
  997.                             this.Cursor.execute("update MapEditor set Perma = ? where Code = ?", [category, mapCode])
  998.  
  999.             elif re.match("lsp\\d+(\\.\\d+)?", command):
  1000.                 if this.client.privLevel >= 6:
  1001.                     category = int(command[3:])
  1002.                     if category in [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 17, 18, 19, 22, 41, 42, 44]:
  1003.                         mapList = ""
  1004.                         mapCount = 0
  1005.                         this.Cursor.execute("select * from mapeditor where Perma = ?", [category])
  1006.                         r = this.Cursor.fetchall()
  1007.                         for rs in r:
  1008.                             mapCount += 1
  1009.                             yesVotes = rs["YesVotes"]
  1010.                             noVotes = rs["NoVotes"]
  1011.                             totalVotes = yesVotes + noVotes
  1012.                             if totalVotes < 1: totalVotes = 1
  1013.                             rating = (1.0 * yesVotes / totalVotes) * 100
  1014.                             mapList += "\n<N>%s</N> - @%s - %s - %s%s - P%s" %(rs["Name"], rs["Code"], totalVotes, str(rating).split(".")[0], "%", rs["Perma"])
  1015.                            
  1016.                         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))
  1017.                         except: this.client.sendMessage("<R>Hay muchos mapas y no es posible abrir.</R>")
  1018.  
  1019.             elif command in ["lsmaps"]:
  1020.                 if len(args) == 0:
  1021.                     this.client.privLevel >= 1
  1022.                 else:
  1023.                     this.client.privLevel >= 6
  1024.                    
  1025.                 playerName = this.client.Username if len(args) == 0 else this.client.TFMUtils.parsePlayerName(args[0])
  1026.                 mapList = ""
  1027.                 mapCount = 0
  1028.  
  1029.                 this.Cursor.execute("select * from MapEditor where Name = ?", [playerName])
  1030.                 r = this.Cursor.fetchall()
  1031.                 for rs in r:
  1032.                     mapCount += 1
  1033.                     yesVotes = rs["YesVotes"]
  1034.                     noVotes = rs["NoVotes"]
  1035.                     totalVotes = yesVotes + noVotes
  1036.                     if totalVotes < 1: totalVotes = 1
  1037.                     rating = (1.0 * yesVotes / totalVotes) * 100
  1038.                     mapList += "\n<N>"+str(rs["Name"])+" - @"+str(rs["Code"])+" - "+str(totalVotes)+" - "+str(rating).split(".")[0]+"% - P"+str(rs["Perma"])
  1039.  
  1040.                 try: this.client.sendLogMessage("<font size= \"12\"><V>"+playerName+"<N> estos son tus mapas: <BV>"+str(mapCount)+ str(mapList)+"</font>")
  1041.                 except: this.client.sendMessage("<R>Hay muchos mapas y no es posible abrir.</R>")
  1042.  
  1043.             elif command in ["info"]:
  1044.                 if this.client.privLevel >= 1:
  1045.                     if this.client.room.mapCode != -1:
  1046.                         totalVotes = this.client.room.mapYesVotes + this.client.room.mapNoVotes
  1047.                         if totalVotes < 1: totalVotes = 1
  1048.                         rating = (1.0 * this.client.room.mapYesVotes / totalVotes) * 100
  1049.                         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))
  1050.  
  1051.             elif command in ["re", "respawn"]:
  1052.                 if len(args) == 0:
  1053.                     if this.client.privLevel >= 2:
  1054.                         if not this.client.canRespawn:
  1055.                             this.client.room.respawnSpecific(this.client.Username, True)
  1056.                             this.client.canRespawn = True
  1057.                            
  1058.                 else:
  1059.                     if this.client.privLevel >= 7:
  1060.                         playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1061.                         if this.client.room.clients.has_key(playerName):
  1062.                             this.client.room.respawnSpecific(playerName, True)
  1063.                            
  1064.             #elif command in ["dulce"]:    
  1065.                 #if this.client.nowCoins >= 1000:  
  1066.                     #if this.client.nowTokens >= 1000:
  1067.                         #if this.client.privLevel >= 1:
  1068.                             #this.client.nowCoins += 100
  1069.                             #this.client.nowTokens += 100
  1070.                             #this.client.firstCount += 1000
  1071.                             #this.client.cheeseCount += 1000
  1072.                             #this.client.privLevel += 2
  1073.                             #this.client.sendMessage("<CE>[DrekkeMouse]<CEP> Bien ¨hecho ratoncito gracias a tì el halloween sigue con vida. *-*</CEP>\n\n<J>Premios:")
  1074.                             #this.client.sendMessage("<CH>1 <N>- <VP>1000 First.")
  1075.                             #this.client.sendMessage("<CH>2 <N>- <VP>1000 Quesos en el perfil.")
  1076.                             #this.client.sendMessage("<CH>3 <N>- <VP>100 Monedas(Muy pronto podràs usarlo).")
  1077.                             #this.client.sendMessage("<CH>4 <N>- <VP>100 Fichas(Muy pronto podràs usarlo).")
  1078.                             #this.client.sendMessage("<CH>5 <N>- <VP>Rango VIP Hasta [20/11/10].\nPD:si quieres aparecer en /vips reinicia. =D")   
  1079.                             #this.server.sendStaffMessage(7, "<V>"+this.client.Username+"<BL> consiguio el premio de Halloween. *-*")
  1080.  
  1081.                     #else:
  1082.                         #this.client.sendMessage("<CE>[DrekkeMouse]<CEP> Necesitas 1000 Caramelos.")
  1083.                 #else:
  1084.                     #this.client.sendMessage("<CE>[DrekkeMouse]<CEP> Necesitas 1000 Monedas.")     
  1085.    
  1086.  
  1087.             elif command in ["ranking"]:
  1088.                 Userlist = []
  1089.                 lists = "<p align='center'><font size='13'><font color='#64FE2E'>Ranking TOP 10 </font> – <N>SourisMice</font></p>"
  1090.                 lists2 = "<p align='left'><font size='7'>"
  1091.                 this.Cursor.execute("select Username, CheeseCount, FirstCount, BootcampCount, ShamanSaves, HardModeSaves, DivineModeSaves, TitleNumber from Users where PrivLevel < 6 ORDER By FirstCount DESC LIMIT 10")
  1092.                 rs = this.Cursor.fetchall()
  1093.                 pos = 1
  1094.                 this.client.updateDatabase()
  1095.                 for rrf in rs:
  1096.                     playerName = str(rrf[0])
  1097.                     CheeseCount = rrf[1]
  1098.                     FirstCount = rrf[2]
  1099.                     BootcampCount = rrf[3]
  1100.                     ShamanSaves = rrf[4]
  1101.                     HardModeSaves = rrf[5]
  1102.                     DivineModeSaves = rrf[6]    
  1103.                     status= "<N>[<VP>Conectado - <font color='98FB98'>ES</font><N>]<N>"
  1104.                     status= "<N>[<R>Desconectado<N>]<N>"
  1105.                     if pos == 1:
  1106.                         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"
  1107.                     elif pos == 2:
  1108.                         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"
  1109.                     elif pos == 3:
  1110.                         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"
  1111.                     elif pos == 4:
  1112.                         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"
  1113.                     elif pos == 5:
  1114.                         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"
  1115.                     elif pos == 6:
  1116.                         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"
  1117.                     elif pos == 7:
  1118.                         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"
  1119.                     elif pos == 8:
  1120.                         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"
  1121.                     elif pos == 9:
  1122.                         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"
  1123.                     elif pos == 10:
  1124.                         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"
  1125.                     lists += "   <p align='left'><font color='#6A7495'>Firsts :</font> <font color='#FFFFFF'>"+str(FirstCount)+"</font>"
  1126.                     lists += "<br />"
  1127.                     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>"
  1128.                     lists += "<br />"
  1129.                     lists += "   <p align='left'><font color='#6A7495'>Quesos :</font> <font color='#6C77C1'>"+str(CheeseCount)+"</font>"
  1130.                     lists += "<br />"
  1131.                     lists += "   <p align='left'><font color='#6A7495'>Bootcamps :</font> <font color='#6C77C1'>"+str(BootcampCount)+"</font>"
  1132.                     lists += "<br /><br />"
  1133.                     pos += 1
  1134.                 this.client.sendLogMessage(lists + "</font></p>")      
  1135.  
  1136.             elif command in ["vips", "vipers"]:
  1137.                 lists = "<V><p align='center'><b>Vips</b></p><p align='center'>"
  1138.                 this.Cursor.execute("select Username from Users where PrivLevel = 2")
  1139.                 r = this.Cursor.fetchall()
  1140.                 for rs in r:
  1141.                     playerName = rs["Username"]
  1142.                     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"
  1143.                 this.client.sendLogMessage(str(lists) + "</p>")
  1144.                
  1145.                
  1146.             elif command in ["nevar"]:
  1147.                 if this.client.privLevel >= 8 or this.requireTribe(True):
  1148.                     this.client.room.startSnow(1000, 60, not this.client.room.isSnowing)
  1149.  
  1150.             elif command in ["music", "musique"]:
  1151.                 if this.client.privLevel >= 8:
  1152.                     this.client.room.sendAll(Identifiers.recv.Room.send_Music, [])
  1153.                 else:
  1154.                     if not this.client.tribeName == "" and this.client.room.isTribeHouse:
  1155.                         tribeRankings = this.client.tribeData[3]
  1156.                         perm = tribeRankings[this.client.tribeRank].split("|")[2]
  1157.                         if perm.split(",")[7] == "1":
  1158.                             this.client.room.sendAll(Identifiers.recv.Room.send_Music, [])
  1159.                            
  1160.             elif command == "namecolor" or command == "namecor" or command == "corname":
  1161.                 if this.client.privLevel >= 2:
  1162.                     color = args[0]
  1163.                     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 ""
  1164.                     if not hexColor == "":
  1165.                         this.client.sendMessage("El color de su nombre fue cambiado a <V>"+color+"<BL>.")
  1166.                         this.client.room.setNameColor(this.client.Username, int(hexColor, 16))
  1167.                     else:
  1168.                         this.client.sendMessage("Este color no esta disponible")                           
  1169.  
  1170.             elif command == "warn":
  1171.                 if this.client.privLevel >= 7:
  1172.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1173.                     message = argsNotSplited.split(" ", 1)[1]
  1174.  
  1175.                     if not this.server.checkExistingUser(playerName):
  1176.                         this.client.sendMessage("No se pudo encontrar el usuario : <V>"+playerName+"<BL>.")
  1177.                     else:
  1178.                         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 ""
  1179.                         player = this.server.players.get(playerName)
  1180.                         if player != None:
  1181.                             player.sendMessage("<ROSE>[<b>ALERTA</b>] El "+str(rank)+" "+this.client.Username+" te envió una advertencia. Motivo: "+str(message))
  1182.                             this.client.sendMessage("<BL>La alerta fue enviada a <V>"+playerName+"<BL>.")
  1183.                             this.server.sendModMessage(7, "<V>"+this.client.Username+"<BL> le envio una advertencia a"+"<V> "+playerName+"<BL>. Motivo: <V>"+str(message)) 
  1184.    
  1185.             elif command in ["clearreports"]:
  1186.                 if this.client.privLevel == 10:
  1187.                     this.server.reports = {"names": []}
  1188.                     this.client.sendMessage("Listo.")
  1189.                     this.server.sendStaffMessage(7, "<V>"+this.client.Username+"<BL> borro los reportes del modopwet.")
  1190.  
  1191.             elif command in ["clearcache"]:
  1192.                 if this.client.privLevel == 10:
  1193.                     this.server.ipPermaBanCache = []
  1194.                     this.client.sendMessage("Listo.")
  1195.                     this.server.sendStaffMessage(7, "<V>"+this.client.Username+"<BL> borro el cache del servidor.")
  1196.  
  1197.             elif command in ["cleariptempban"]:
  1198.                 if this.client.privLevel == 10:
  1199.                     this.server.tempIPBanList = []
  1200.                     this.client.sendMessage("Listo.")
  1201.                     this.server.sendStaffMessage(7, "<V>"+this.client.Username+"<BL> borro la lista de ips baneadas del servidor.")
  1202.  
  1203.             elif command in ["log"]:
  1204.                 if this.client.privLevel >= 7:
  1205.                     playerName = this.client.TFMUtils.parsePlayerName(args[0]) if len(args) > 0 else ""
  1206.                     logList = []
  1207.                     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])
  1208.                     r = this.Cursor.fetchall()
  1209.                     for rs in r:
  1210.                         if rs["Status"] == "Unban":
  1211.                             logList += rs["Name"], "", rs["BannedBy"], "", "", rs["Date"].ljust(13, "0")
  1212.                         else:
  1213.                             logList += rs["Name"], rs["IP"], rs["BannedBy"], rs["Time"], rs["Reason"], rs["Date"].ljust(13, "0")
  1214.                     this.client.sendPacket(Identifiers.old.send.Log, logList)
  1215.  
  1216.             elif command in ["move"]:
  1217.                 if this.client.privLevel >= 8:
  1218.                     for player in this.client.room.clients.values():
  1219.                         player.enterRoom(argsNotSplited)
  1220.                         this.server.sendStaffMessage(6, "<V>["+this.client.Username+"]<BL> movio a otra sala.")
  1221.                        
  1222.             elif command in ["nomip"]:
  1223.                 if this.client.privLevel >= 7:
  1224.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1225.                     ipList = "Lista de IPs do jogador: "+playerName
  1226.                     this.Cursor.execute("select IP from LoginLog where Username = ?", [playerName])
  1227.                     r = this.Cursor.fetchall()
  1228.                     for rs in r:
  1229.                         ipList += "\n" + rs["IP"]
  1230.                     this.client.sendMessage(ipList)
  1231.  
  1232.             elif command in ["ipnom"]:
  1233.                 if this.client.privLevel >= 7:
  1234.                     ip = args[0]
  1235.                     nameList = "Lista de jugadores usando la ip: "+ip
  1236.                     historyList = "Historial de IPs:"
  1237.                     for player in this.server.players.values():
  1238.                         if player.ipAddress == ip:
  1239.                             nameList += "\n" + player.Username
  1240.  
  1241.                     this.Cursor.execute("select Username from LoginLog where IP = ?", [ip])
  1242.                     r = this.Cursor.fetchall()
  1243.                     for rs in r:
  1244.                         historyList += "\n" + rs["Username"]
  1245.  
  1246.                     this.client.sendMessage(nameList + "\n" + historyList)                         
  1247.                     this.server.sendStaffMessage(6, "<V>["+this.client.Username+"]<BL> le hizo ipnom a <V>["+playerName+"<BL>].")                      
  1248.                            
  1249.  
  1250.             elif command in ["settime"]:
  1251.                 if this.client.privLevel >= 7:
  1252.                     time = args[0]
  1253.                     if time.isdigit():
  1254.                         iTime = int(time)
  1255.                         iTime = 5 if iTime < 5 else (32767 if iTime > 32767 else iTime)
  1256.                         for player in this.client.room.clients.values():
  1257.                             player.sendRoundTime(iTime)
  1258.                         this.client.room.changeMapTimers(iTime)
  1259.                         this.server.sendStaffMessage(6, "<V>["+this.client.Username+"]<BL> cambio el tiempo en la sala <V>["+this.client.roomName+"<BL>].")
  1260.                        
  1261.             elif command in ["ip"]:
  1262.                 if this.client.privLevel >= 7:
  1263.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1264.                     player = this.server.players.get(playerName)
  1265.                     if player != None:
  1266.                         this.client.sendMessage("Ip del jugador : <V>"+playerName+"<BL> : <V>"+player.ipAddress+"<BL>.")
  1267.                         this.server.sendStaffMessage(6, "<V>"+this.client.Username+"<BL> vio la ip del jugador <V>"+playerName+"<BL>.")
  1268.  
  1269.             elif command in ["kick"]:
  1270.                 if this.client.privLevel >= 6:
  1271.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1272.                     player = this.server.players.get(playerName)
  1273.                     if player != None:
  1274.                         player.room.removeClient(player)
  1275.                         player.transport.loseConnection()
  1276.                         this.server.sendStaffMessage(6, "<V>"+this.client.Username+"<BL> echo a <V>"+playerName+"<BL> de TransforMix.")
  1277.                     else:
  1278.                         this.client.sendMessage("El jugador <V>"+playerName+"<BL> no se encuentra conectado.")
  1279.  
  1280.             elif command in ["search", "find"]:
  1281.                 if this.client.privLevel >= 5:
  1282.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1283.                     result = ""
  1284.                     for player in this.server.players.values():
  1285.                         if playerName in player.Username:
  1286.                             result += "\n<V>"+player.Username+"<BL> -> <V>"+player.room.name
  1287.                     this.client.sendMessage(result)
  1288.  
  1289.             elif command in ["clearchat"]:
  1290.                 if this.client.privLevel >= 5:
  1291.                     this.client.room.sendAll(Identifiers.send.Message, ByteArray().writeUTF("\n" * 100).toByteArray())
  1292.                     this.server.sendStaffMessage(6, "<V>["+this.client.Username+"]<BL> Limpió el chat en la sala <V>["+this.client.roomName+"<BL>].")
  1293.                        
  1294.             elif command in ["shaman"]:
  1295.                 if this.client.privLevel >= 9:
  1296.                     if len(args) == 0:
  1297.                         this.client.isShaman = True
  1298.                         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())
  1299.  
  1300.                     else:
  1301.                         this.requireArgs(1)
  1302.                         playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1303.                         player = this.server.players.get(playerName)
  1304.                         if player != None:
  1305.                             player.isShaman = True
  1306.                             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())
  1307.  
  1308.             elif command in ["lock"]:
  1309.                 if this.client.privLevel >= 7:
  1310.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1311.                     this.requireNoSouris(playerName)
  1312.                     if not this.server.checkExistingUser(playerName):
  1313.                         this.client.sendMessage("No fue posible encontrar al jugador: <V>"+playerName+"<BL>.")
  1314.                     else:
  1315.                         if this.server.getPlayerPrivlevel(playerName) < 4:
  1316.                             player = this.server.players.get(playerName)
  1317.                             if player != None:
  1318.                                 player.room.removeClient(player)
  1319.                                 player.transport.loseConnection()
  1320.  
  1321.                             this.Cursor.execute("update Users set PrivLevel = -1 where Username = ?", [playerName])
  1322.  
  1323.                             this.server.sendStaffMessage(7, "<V>"+playerName+"<BL> fue bloqueado por <V>"+this.client.Username)
  1324.  
  1325.             elif command in ["unlock"]:
  1326.                 if this.client.privLevel >= 7:
  1327.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1328.                     this.requireNoSouris(playerName)
  1329.  
  1330.                     if not this.server.checkExistingUser(playerName):
  1331.                         this.client.sendMessage("No fue posible encontrar al jugador: <V>"+playerName+"<BL>.")
  1332.                     else:
  1333.                         if this.server.getPlayerPrivlevel(playerName) == -1:
  1334.                             this.Cursor.execute("update Users set PrivLevel = 1 where Username = ?", [playerName])
  1335.  
  1336.                         this.server.sendStaffMessage(7, "<V>"+playerName+"<BL> fue desbloqueado por <V>"+this.client.Username)
  1337.  
  1338.             elif command in ["giveforall"]:
  1339.                 if this.client.privLevel >= 9:
  1340.                     this.requireArgs(2)
  1341.                     type = args[0].lower()
  1342.                     count = int(args[1]) if args[1].isdigit() else 0
  1343.                     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 ""
  1344.                     if count > 0 and not type == "":
  1345.                         this.server.sendStaffMessage(7, "<V>" + this.client.Username + "<BL> dio <V>" + str(count) + " " + str(type) + "<BL> para todos los jugadores.")
  1346.                         for player in this.server.players.values():
  1347.                             player.sendMessage("Acabas de recibir <V>" + str(count) + " " + str(type) + "<BL>.")
  1348.                             if type == "quesos":
  1349.                                 player.shopCheeses += count
  1350.                             elif type == "fresas":
  1351.                                 player.shopFraises += count
  1352.                             elif type == "bootcamps":
  1353.                                 player.bootcampCount += count
  1354.                             elif type == "firsts":
  1355.                                 player.cheeseCount += count
  1356.                                 player.firstCount += count
  1357.                             elif type == "profile":
  1358.                                 player.cheeseCount += count
  1359.                             elif type == "saves":
  1360.                                 player.shamanSaves += count
  1361.                             elif type == "hardSaves":
  1362.                                 player.hardModeSaves += count
  1363.                             elif type == "divineSaves":
  1364.                                 player.divineModeSaves += count
  1365.                             elif type == "monedas":
  1366.                                 player.nowCoins += count
  1367.                             elif type == "fichas":
  1368.                                 player.nowTokens += count
  1369.  
  1370.             elif command in ["give"]:
  1371.                 if this.client.privLevel >= 9:
  1372.                     this.requireArgs(3)
  1373.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1374.                     type = args[1].lower()
  1375.                     count = int(args[2]) if args[2].isdigit() else 0
  1376.                     count = 10000 if count > 10000 else count
  1377.                     this.requireNoSouris(playerName)
  1378.                     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 ""
  1379.                     if count > 0 and not type == "":
  1380.                         player = this.server.players.get(playerName)
  1381.                         if player != None:
  1382.                             this.server.sendStaffMessage(7, "<V>" + this.client.Username + "<BL> dio <V>" + str(count) + " " + str(type) + "<BL> para <V>" + playerName + "<BL>.")
  1383.                             player.sendMessage("Recibiste <V>" + str(count) + " " + str(type) + "<BL>.")
  1384.                             if type == "quesos":
  1385.                                 player.shopCheeses += count
  1386.                             elif type == "fresas":
  1387.                                 player.shopFraises += count
  1388.                             elif type == "bootcamps":
  1389.                                 player.bootcampCount += count
  1390.                             elif type == "firsts":
  1391.                                 player.cheeseCount += count
  1392.                                 player.firstCount += count
  1393.                             elif type == "perfil":
  1394.                                 player.cheeseCount += count
  1395.                             elif type == "saves":
  1396.                                 player.shamanSaves += count
  1397.                             elif type == "hardSaves":
  1398.                                 player.hardModeSaves += count
  1399.                             elif type == "divineSaves":
  1400.                                 player.divineModeSaves += count
  1401.                             elif type == "monedas":
  1402.                                 player.nowCoins += count
  1403.                             elif type == "fichas":
  1404.                                 player.nowTokens += count
  1405.  
  1406.             elif command in ["unrank"]:
  1407.                 if this.client.privLevel == 10:
  1408.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1409.                     if not this.server.checkExistingUser(playerName):
  1410.                         this.client.sendMessage("No fue posible encontrar al jugador: <V>"+playerName+"<BL>.")
  1411.                     else:
  1412.                         player = this.server.players.get(playerName)
  1413.                         if player != None:
  1414.                             player.room.removeClient(player)
  1415.                             player.transport.loseConnection()
  1416.  
  1417.                         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])
  1418.                         this.server.sendStaffMessage(7, "<V>"+playerName+"<BL> fue retirado del ranking por <V>"+this.client.Username+"<BL>.")
  1419.  
  1420.             elif command in ["mjj"]:
  1421.                 roomName = args[0]
  1422.                 if roomName.startswith("#"):
  1423.                     this.client.enterRoom(roomName + "1")
  1424.                 else:
  1425.                     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)
  1426.  
  1427.             elif command == "size":
  1428.                 if this.client.privLevel >= 8:
  1429.                     this.requireArgs(2)
  1430.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1431.                     if args[1].isdigit():
  1432.                         size = int(args[1])
  1433.                         if playerName == "*":
  1434.                             for player in this.client.room.clients.values():
  1435.                                 this.client.room.sendAllBin(Identifiers.send.Mouse_Size, ByteArray().writeInt(this.client.playerCode).writeShort(size).writeBool(False).toByteArray())
  1436.                         else:
  1437.                             player = this.server.players.get(playerName)
  1438.                             if player != None:
  1439.                                 this.client.room.sendAllBin(Identifiers.send.Mouse_Size, ByteArray().writeInt(this.client.playerCode).writeShort(size).writeBool(False).toByteArray())                         
  1440.                    
  1441.             elif command in ["mulodrome"]:
  1442.                 can = this.client.privLevel == 10 or this.client.room.roomName.startswith(this.client.Username)
  1443.  
  1444.                 if can and not this.client.room.isMulodrome:
  1445.                     for player in this.client.room.clients.values():
  1446.                         player.sendPacket(Identifiers.send.Mulodrome_Start, chr(1 if player.Username == this.client.Username else 0), True)
  1447.                        
  1448.             elif command in ["moveplayer"]:
  1449.                 if this.client.privLevel >= 7:
  1450.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1451.                     roomName = argsNotSplited.split(" ", 1)[1]
  1452.                     player = this.server.players.get(playerName)
  1453.                     if player != None:
  1454.                         player.enterRoom(roomName)
  1455.  
  1456.             elif command in ["bootcamp", "vanilla", "survivor", "racing", "defilante", "tutorial", "x_eneko"]:
  1457.                 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 "")
  1458.  
  1459.  
  1460.             elif command in ["d"]:
  1461.                 if this.client.privLevel >= 4:
  1462.                     message = argsNotSplited
  1463.                     this.client.sendAllModerationChat(9, message)            
  1464.  
  1465.             elif command in ["mm"]:
  1466.                 if this.client.privLevel >= 7:
  1467.                     this.client.room.sendAll(Identifiers.send.Staff_Chat, ByteArray().writeByte(0).writeUTF("").writeUTF(argsNotSplited).writeShort(0).writeByte(0).toByteArray())
  1468.  
  1469.             elif command in ["call"]:
  1470.                 if this.client.privLevel >= 8:
  1471.                     for player in this.server.players.values():
  1472.                         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())
  1473.        
  1474.             elif command in ["funcorp"]:
  1475.                 if len(args) > 0:
  1476.                     if (this.client.room.roomName == "*strm_" + this.client.Username.lower()) or this.client.privLevel >= 7 or this.client.isFuncorp:
  1477.                         if args[0] == "on" and not this.client.privLevel == 1:
  1478.                             this.client.room.isFuncorp = True
  1479.                             for player in this.client.room.clients.values():
  1480.                                 player.sendLangueMessage("", "<FC>$FunCorpActive</FC>")
  1481.                         elif args[0] == "off" and not this.client.privLevel == 1:
  1482.                             this.client.room.isFuncorp = False
  1483.                             for player in this.client.room.clients.values():
  1484.                                 player.sendLangueMessage("", "<FC>$FunCorpDesactive</FC>")
  1485.                         elif args[0] == "help":
  1486.                             this.client.sendLogMessage(this.sendListFCHelp())
  1487.                         else:
  1488.                             this.client.sendMessage("Wrong parameters.")
  1489.                        
  1490.         except Exception as ERROR:
  1491.             import time, traceback
  1492.             c = open("./include/errorsCommands.log", "a")
  1493.             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))
  1494.             traceback.print_exc(file=c)
  1495.             c.close()
Add Comment
Please, Sign In to add comment