Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 78.41 KB | None | 0 0
  1. #coding: utf-8
  2. import re, time, sys, os, subprocess
  3.  
  4. from ByteArray import ByteArray
  5. from datetime import datetime
  6. from Identifiers import Identifiers
  7. from twisted.internet import reactor
  8.  
  9. class ParseCommands:
  10.     def __init__(this, client, server):
  11.         this.client = client
  12.         this.server = client.server
  13.         this.Cursor = client.Cursor
  14.         this.currentArgsCount = 0
  15.  
  16.     def requireLevel(this, level, isVip=False):
  17.         if this.client.privLevel < level:
  18.             if not (isVip and this.client.privLevel == 2):
  19.                 raise UserWarning
  20.         else:
  21.             return True
  22.        
  23.     def requireNoSouris(this, playerName):
  24.         if playerName.startswith("*"):
  25.             raise UserWarning
  26.         else:
  27.             return True
  28.  
  29.     def requireArgs(this, argsCount):
  30.         if this.currentArgsCount < argsCount:
  31.             raise UserWarning
  32.         else:
  33.             return True
  34.  
  35.     def parseCommand(this, command):                
  36.         values = command.split(" ")
  37.         command = values[0].lower()
  38.         args = values[1:]
  39.         argsCount = len(args)
  40.         argsNotSplited = " ".join(args)
  41.         this.currentArgsCount = argsCount
  42.  
  43.         if argsCount == 0:
  44.         if command in ["election"]:
  45.                if this.client.privLevel >= 1:
  46.             this.client.sendClientMessage("Está em manutenção")
  47.        
  48.             if command in ["profil", "perfil", "profile"]:
  49.                 if this.client.privLevel >= 1:
  50.                     this.client.sendProfile(this.client.Username)
  51.  
  52.             elif command in ["editeur"]:
  53.                 if this.client.privLevel >= 1:
  54.                     this.client.enterRoom(chr(3) + "[Editeur] " + this.client.Username)
  55.  
  56.                     this.client.sendPacket(Identifiers.old.send.Editeur, [])
  57.                     this.client.sendPacket(Identifiers.send.Room_Type, chr(1), True)
  58.  
  59.             elif command in ["totem"]:
  60.                 if this.client.privLevel >= 1:
  61.                     if this.client.privLevel != 0 and this.client.shamanSaves >= 500:
  62.                         this.client.enterRoom(chr(3) + "[Totem] " + this.client.Username)
  63.  
  64.             elif command in ["sauvertotem"]:
  65.                 if this.client.room.isTotemEditeur:
  66.                     this.server.setTotemData(this.client.Username, int(str(this.client.Totem[0])), str(this.client.Totem[1]))
  67.                     this.client.STotem[0] = this.client.Totem[0]
  68.                     this.client.STotem[1] = this.client.Totem[1]
  69.  
  70.                     this.client.sendPlayerDied()
  71.                     this.client.enterRoom(this.server.recommendRoom(this.client.Langue))
  72.  
  73.             elif command in ["resettotem"]:
  74.                 if this.client.room.isTotemEditeur:
  75.                     this.client.Totem[0] = 0
  76.                     this.client.Totem[1] = ""
  77.                     this.client.RTotem = True
  78.  
  79.                     this.client.isDead = True
  80.                     this.client.sendPlayerDied()
  81.                     this.client.room.checkShouldChangeMap()
  82.  
  83.             elif command in ["mousecolor"]:
  84.                 this.client.sendPacket(Identifiers.send.Mouse_Color, ByteArray().writeByte(0).writeShort(39).writeByte(17).writeShort(57).writeShort(-12).writeUTF("Seleccione un color para su raton.").toByteArray(), True)                  
  85.  
  86.             elif command in ["mulodrome"]:
  87.                 can = this.client.privLevel >= 10 or this.client.room.roomName.startswith(this.client.Username)
  88.  
  89.                 if can and not this.client.room.isMulodrome:
  90.                     for player in this.client.room.clients.values():
  91.                         player.sendPacket(Identifiers.send.Mulodrome_Start, chr(1 if player.Username == this.client.Username else 0), True)
  92.  
  93.             elif command in ["skip"]:
  94.                 if this.client.canSkipMusic and this.client.room.isMusic and this.client.room.currentMusicID != 0:
  95.                     this.client.room.musicSkipVotes += 1
  96.                     this.client.checkMusicSkip()
  97.                     this.client.sendClientMessage("You Send a +1 Point to Remove This Video.")
  98.                    
  99.             elif command in ["np", "map", "nextmap", "killall"]:
  100.                 if this.client.privLevel >= 6:
  101.                     this.client.room.killAll()
  102.  
  103.             elif command in ["pw"]:
  104.                 if this.client.room.roomName.startswith("*" + this.client.Username) or this.client.room.roomName.startswith(this.client.Username):
  105.                     this.client.room.roomPassword = ""
  106.                     this.client.sendClientMessage("Password Disabled.")
  107.  
  108.             elif command in ["hide"]:
  109.                 if this.client.privLevel >= 5:
  110.                     this.client.sendPlayerDisconnect()
  111.                     this.client.sendClientMessage("Usted esta invisible.")
  112.                     this.client.isHidden = True
  113.  
  114.             elif command in ["unhide"]:
  115.                 if this.client.privLevel >= 5:
  116.                     if this.client.isHidden:
  117.                         this.client.enterRoom(this.client.room.name)
  118.                         this.client.sendClientMessage("Usted ahora esta visible.")
  119.                         this.client.isHidden = False
  120.  
  121.             elif command in ["reboot"]:
  122.                 if this.client.privLevel >= 10:
  123.                     this.server.sendServerReboot()
  124.                     this.server.sendModMessage(11, "<V>"+this.client.Username+"<BL> dio reboot")
  125.                    
  126.             elif command in ["shutdown"]:
  127.                 if this.client.privLevel >= 10:
  128.                     this.server.sendServerShutdown()
  129.                     this.server.sendModMessage(11, "<V>"+this.client.Username+"<BL> dio Shutdown")
  130.                    
  131.             elif command in ["updatesql"]:
  132.                 if this.client.privLevel >= 10 or this.client.privLevel >= 11:
  133.                     for player in this.server.players.values():
  134.                         if not player.isGuest:
  135.                             player.updateDatabase()
  136.  
  137.                     this.server.sendModMessage(10, "SeuMice foi Salvado completamente.")
  138.  
  139.             elif command in ["clearreports"]:
  140.                 if this.client.privLevel >= 9:
  141.                     this.server.reports = {"names": []}
  142.                     this.client.sendClientMessage("Los reportes fueron eliminados por "+this.client.Username+"")
  143.                     this.server.sendModMessage(9, "<BL>El M O D O P W E T ha sido limpiado correctamente.")
  144.  
  145.             elif command in ["clearcache"]:
  146.                 if this.client.privLevel >= 10:
  147.                     this.server.ipPermaBanCache = []
  148.                     this.client.sendClientMessage("El cache fue limpiado por "+this.client.Username+"")
  149.                     this.server.sendModMessage(10, "<BL>Cache de WorldMice limpiado correctamente.")
  150.  
  151.             elif command in ["cleariptempban", "limparipban"]:
  152.                 if this.client.privLevel >= 7:
  153.                     this.server.tempIPBanList = []
  154.                     this.client.sendClientMessage("Las Ips baneadas fueron borradas por "+this.client.Username+"")
  155.                     this.server.sendModMessage(10, "<BL>Lista de Ips Baneadas limpiada correctamente.")
  156.                    
  157.             elif command in ["nomecor", "namecor", "nombrecolor"]:
  158.                 if len(args) == 1:
  159.                     if this.client.privLevel in [2, 5, 6, 7, 8, 9, 10, 11]:
  160.                         hexColor = args[0][1:] if args[0].startswith("#") else args[0]
  161.  
  162.                         try:
  163.                             this.client.room.setNameColor(this.client.Username, int(hexColor, 16))
  164.                             this.client.nameColor = hexColor
  165.                             this.client.sendMessage("A cor do nome do seu rato foi alterada.")
  166.                         except:
  167.                             this.client.sendMessage("Cor inválida. Utilize uma cor HEX (#00000).")
  168.  
  169.                 if len(args) > 1:
  170.                     if this.client.privLevel in [7, 8, 9, 10, 11]:
  171.                         playerName = this.client.TFMUtils.parsePlayerName(args[0])
  172.                         hexColor = args[1][1:] if args[1].startswith("#") else args[1]
  173.                         try:
  174.                             if playerName == "*":
  175.                                 for player in this.client.room.players.values():
  176.                                     this.client.room.setNameColor(player.Username, int(hexColor, 16))
  177.                             else:
  178.                                 this.client.room.setNameColor(playerName, int(hexColor, 16))
  179.                         except:
  180.                             this.client.sendMessage("Cor inválida. Utilize uma cor HEX (#00000).")
  181.                 else:
  182.                     if this.client.privLevel >= 2:
  183.                         this.client.room.showColorPicker(10000, this.client.Username, int(this.client.nameColor) if this.client.nameColor == "" else 0xc2c2da, "Selecione uma cor para seu nome.")                                     
  184.  
  185.             elif command in ["kill", "suicide", "mort", "die"]:
  186.                 if not this.client.isDead:
  187.                     this.client.isDead = True
  188.                     if not this.client.room.noAutoScore: this.client.playerScore += 1
  189.                     this.client.sendPlayerDied()
  190.                     this.client.room.checkShouldChangeMap()
  191.  
  192.             elif command in ["title", "titulo", "titre"]:
  193.                 p = ByteArray()
  194.                 p2 = ByteArray()
  195.                 titlesCount = 0
  196.                 starTitlesCount = 0
  197.  
  198.                 for title in this.client.titleList:
  199.                     if "." in str(title):
  200.                         titleInfo = str(title).split(".")
  201.                         titleNumber = int(titleInfo[0])
  202.                         stars = int(titleInfo[1])
  203.  
  204.                         if stars <= 1:
  205.                             p2.writeShort(titleNumber)
  206.                             titlesCount += 1
  207.                         else:
  208.                             p.writeShort(titleNumber).writeByte(stars)
  209.                             starTitlesCount += 1
  210.  
  211.                 this.client.sendPacket(Identifiers.send.Titles_List, ByteArray().writeShort(titlesCount).writeBytes(p2.toByteArray()).writeShort(starTitlesCount).writeBytes(p.toByteArray()).toByteArray(), True)
  212.                
  213.             elif re.match("p\\d+(\\.\\d+)?", command):
  214.                 if this.client.privLevel >= 6:
  215.                     mapCode = this.client.room.mapCode
  216.                     mapName = this.client.room.mapName
  217.                     if mapCode != -1:
  218.                         avaliablePerms = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 17, 18, 19, 22, 44]
  219.                         permCategory = int(command[1:])
  220.                         if permCategory in avaliablePerms:
  221.                             this.server.sendModMessage(6, "<V>"+this.client.Username+" <BL>valido el mapa @"+str(mapCode)+" - "+str(mapName)+" para la categoria P"+str(permCategory)+".")
  222.  
  223.                             this.Cursor.execute("update MapEditor set Perma = ? where Code = ?", [permCategory, mapCode])
  224.  
  225.             elif re.match("lsp\\d+(\\.\\d+)?", command):
  226.                 if this.client.privLevel >= 6:
  227.                     permCategory = int(command[3:])
  228.                     result = ""
  229.                     mapList = ""
  230.                     mapCount = 0
  231.  
  232.                     this.Cursor.execute("select * from MapEditor where Perma = ?", [permCategory])
  233.                     r = this.Cursor.fetchall()
  234.                     for rs in r:
  235.                         mapCount += 1
  236.                         playerName = rs["Name"]
  237.                         yesVotes = rs["YesVotes"]
  238.                         noVotes = rs["NoVotes"]
  239.                         totalVotes = yesVotes + noVotes
  240.                         if totalVotes < 1: totalVotes = 1
  241.                         Rating = (1.0 * yesVotes / totalVotes) * 100
  242.                         rate = str(Rating).split(".")[0]
  243.                         if rate == "Nan": rate = "0"
  244.                         mapList += "<br><N>"+str(playerName)+" - @"+str(rs["Code"])+" - "+str(totalVotes)+" - "+str(rate)+"% - P"+str(rs["Perma"])
  245.  
  246.                     if len(mapList) != 0:
  247.                         result = str(mapList)
  248.                            
  249.                     try: this.client.sendLogMessage("<font size=\"12\"><N>Há <BL>"+str(mapCount)+"<N> mapas <V>P"+str(permCategory) + str(result)+"</font>")
  250.                     except: pass
  251.  
  252.             elif command in ["re", "respawn"]:
  253.                 if this.client.privLevel >= 8:
  254.                     this.client.room.respawnSpecific(this.client.Username)
  255.  
  256.             elif command in ["rev"]:
  257.                 if this.client.iceCoins >= 40:
  258.                   if this.client.isDead >= True:  
  259.                     this.client.iceCoins -= 40
  260.                     this.client.sendMessage("<V>• <N>Usted revivio, eso le costo 200 monedas.")
  261.                     this.client.room.respawnSpecific(this.client.Username)
  262.                 else:
  263.                     this.client.sendMessage("<V>• <N>Usted no tiene suficientes monedas para usar este comando.")
  264.                     this.client.sendMessage("<V>• <N>Actualmente usted tiene <font color='#64FE2E'>"+str(this.client.iceCoins)+"</font> monedas")        
  265.            
  266.             elif command in ["mapinfo"]:
  267.                 if this.client.privLevel >= 6:
  268.                     if this.client.room.mapCode != -1:
  269.                         totalVotes = this.client.room.mapYesVotes + this.client.room.mapNoVotes
  270.                         if totalVotes < 1: totalVotes = 1
  271.                         Rating = (1.0 * this.client.room.mapYesVotes / totalVotes) * 100
  272.                         rate = str(Rating).split(".")[0]
  273.                         if rate == "Nan": rate = "0"
  274.                         this.client.sendClientMessage("<V>"+str(this.client.room.mapName)+"<BL> - <V>@"+str(this.client.room.mapCode)+"<BL> - <V>"+str(totalVotes)+"<BL> - <V>"+str(rate)+"%<BL> - <V>P"+str(this.client.room.mapPerma)+"<BL>.")
  275.  
  276.  
  277.             elif command in ["musichelp"]:
  278.                 if this.client.privLevel >= 1:
  279.                     this.client.room.sendAll(Identifiers.old.send.Music, [])
  280.                     this.client.sendMessage("<V>• <BL>Añade un video con la URL de <R>YOU<N>TUBE<BL>.")                 
  281.                 else:
  282.                      if not this.client.tribeName == "" and this.client.room.isTribeHouse:
  283.                         tribeRankings = this.client.tribeData[3]
  284.                         perm = tribeRankings[this.client.tribeRank].split("|")[2]
  285.                         if perm.split(",")[7] == "1":
  286.                             this.client.room.sendAll(Identifiers.old.send.Music, [])
  287.        
  288.             elif command in ["onlines"]:
  289.                 if this.client.privLevel >= 7:
  290.                     this.client.sendClientMessage('<BL>Usuarios onlines: <V>' + str(this.server.getConnectedPlayerCount()) + '')           
  291.  
  292.             elif command in ["log"]:
  293.                 if this.client.privLevel >= 7:
  294.                     logList = []
  295.                     this.Cursor.execute("select * from BanLog order by Date desc limit 0, 200")
  296.                     r = this.Cursor.fetchall()
  297.                     for rs in r:
  298.                         if rs["Status"] == "Unban":
  299.                             logList += rs["Name"], "", rs["BannedBy"], "", "", rs["Date"].rjust(13, "0")
  300.                         else:
  301.                             logList += rs["Name"], rs["IP"], rs["BannedBy"], rs["Time"], rs["Reason"], rs["Date"].rjust(13, "0")
  302.  
  303.                     this.client.sendPacket(Identifiers.old.send.Log, logList)
  304.                    
  305.             elif command in ["mod", "mods"]:
  306.                 mods = {}
  307.                 modsList = "$ModoPasEnLigne"
  308.  
  309.                 for player in this.server.players.values():
  310.                     if player.privLevel >= 4:
  311.                         if mods.has_key(player.Langue.lower()):
  312.                             names = mods[player.Langue.lower()]
  313.                             names.append(player.Username)
  314.                             mods[player.Langue.lower()] = names
  315.                         else:
  316.                             names = []
  317.                             names.append(player.Username)
  318.                             mods[player.Langue.lower()] = names
  319.  
  320.                 if len(mods) >= 1:
  321.                     modsList = "$ModoEnLigne"
  322.                     for list, count in mods.items():
  323.                         modsList += "<br><BL>["+str(list)+"] <BV>"+str("<BL>, <BV>").join(count)
  324.  
  325.                 this.client.sendMessageLangue("", modsList)
  326.  
  327.             if command in ["ls"]:
  328.                 if this.client.privLevel >= 5:
  329.                     data = []
  330.  
  331.                     for room in this.server.rooms.values():
  332.                         if room.name.startswith("*") and not room.name.startswith("*" + chr(3)):
  333.                             data.append(["ALL", room.name, room.getPlayerCount()])
  334.                         if room.name.startswith(str(chr(3))) or room.name.startswith("*" + chr(3)):
  335.                             if room.name.startswith(("*" + chr(3))):
  336.                                 data.append(["TRIBEHOUSE", room.name, room.getPlayerCount()])
  337.                             else:
  338.                                 data.append(["PRIVATE", room.name, room.getPlayerCount()])
  339.                         else:
  340.                             data.append([room.community.upper(), room.roomName, room.getPlayerCount()])
  341.  
  342.                     result = "\n"
  343.                     for roomInfo in data:
  344.                         result += "<N>[<ROSE>"+str(roomInfo[0])+"<N>] <N><b>"+str(roomInfo[1])+"</b> <N>: <ROSE>"+str(roomInfo[2])+"\n"
  345.                            
  346.                     result += "<ROSE>Salas/Jugadores WorldMice: <N><b>"+str(this.server.getConnectedPlayerCount())+"</b><ROSE>/<N><b>"+str(this.server.getRoomsCount())+"</b>"
  347.                     this.client.sendClientMessage(result)
  348.  
  349.             elif command in ["clearchat"]:
  350.                 if this.client.privLevel >= 5:
  351.                     this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<br>"*100).toByteArray())
  352.    
  353.             elif command in ["music", "musique", "video"]:
  354.                 if this.client.privLevel >= 1:
  355.                     this.client.room.sendAll(Identifiers.old.send.Music, [args[0]])
  356.                     this.client.sendMessage("<V>• <BL>El video ha sido cargado correctamente.")                  
  357.                 else:
  358.                     if not this.client.tribeName == "" and this.client.room.isTribeHouse:
  359.                         tribeRankings = this.client.tribeData[3]
  360.                         perm = tribeRankings[this.client.tribeRank].split("|")[2]
  361.                         if perm.split(",")[7] == "1":
  362.                             this.client.room.sendAll(Identifiers.old.send.Music, [args[0]])                        
  363.    
  364.             elif command in ["parar", "desligar", "stop"]:
  365.                 if this.client.privLevel >= 1:
  366.                     this.client.sendPacket(Identifiers.old.send.Music, [""])
  367.                     this.client.sendMessage("<BL>Radio has Stoped.")
  368.  
  369.             elif command in ["play", "iniciar", "ligar"]:
  370.                 if this.client.privLevel >= 1:
  371.                     this.client.sendPacket(Identifiers.old.send.Music, ["#"])
  372.                     this.client.sendMessage("<BL>La radio ha iniciado.")
  373.  
  374.             elif command in ["moedas"]:
  375.                 if this.client.privLevel >= 1:
  376.                     this.client.sendMessage("• <V>"+str(this.client.Username)+"</V> Você tem exatamente <V>"+str(this.client.iceCoins)+"</V> moedas")
  377.  
  378.             elif command in ["monedas"]:
  379.                 if this.client.privLevel >= 1:
  380.                     this.client.sendMessage("• <V>"+str(this.client.Username)+"</V> Usted tiene exactamente <V>"+str(this.client.iceCoins)+"</V> monedas")
  381.  
  382.             elif command in ["coins"]:
  383.                 if this.client.privLevel >= 1:
  384.                     this.client.sendMessage("• <V>"+str(this.client.Username)+"</V> You Have Exactly <V>"+str(this.client.iceCoins)+"</V> coins")
  385.                    
  386.                     #LOJINHA
  387.  
  388.             elif command in ["pink", "vermelho"]:
  389.                 if this.client.privLevel >= 2:
  390.                     this.client.room.sendAllBin(Identifiers.old.send.Halloween_Player_Damanged, ByteArray().writeInt(this.client.playerCode).toByteArray())                    
  391.  
  392.             elif command in ["don"]:
  393.                 this.client.room.sendAllBin(Identifiers.send.Don, ByteArray().writeInt(this.client.playerCode).toByteArray())
  394.        
  395.             elif command in ["vbig"]:
  396.                 if this.client.privLevel >= 10:
  397.                     this.client.sendPacket(Identifiers.send.Can_Transformation, chr(1), True)
  398.  
  399.             elif command in ["vbigbuy"]:
  400.                 if this.client.iceCoins >= 200:
  401.                   if this.client.isDead >= True:
  402.                     this.client.iceCoins -= 200                
  403.                     this.client.sendMessage("<V>• <N>Usted compro <ROSE>Vbig<N> eso le costo 200 monedas")
  404.                     this.client.sendPacket(Identifiers.send.Can_Transformation, chr(1), True)
  405.                 else:
  406.                     this.client.sendMessage("<V>• <N>Usted no tiene <ROSE>Monedas<N> suficientes para usar este comando.")
  407.                    
  408.             elif command in ["shaman"]:
  409.                 if this.client.privLevel >= 10 or this.client.privLevel >= 11:
  410.                     this.client.isShaman = True
  411.                     for player in this.client.room.clients.values():
  412.                         player.sendShamanCode(this.client.playerCode)
  413.  
  414.             elif command in ["vsha"]:
  415.                 if this.client.iceCoins >= 1000 or this.client.privLevel >= 2:
  416.                     this.client.iceCoins -= 1000
  417.                     this.client.isShaman = True
  418.                     for player in this.client.room.clients.values():
  419.                         player.sendShamanCode(this.client.playerCode)                      
  420.                     this.client.sendClientMessage("Usted se convirtio en Chaman por 1000 monedas!")
  421.                            
  422.             elif command in ["vampbuy"]:
  423.                 if this.client.iceCoins >= 1500:
  424.                     this.client.iceCoins -= 1500
  425.                     this.client.sendVampireMode(False)
  426.                     this.client.sendMessage("<V>• <BL>Usted compro el <V>Poder<BL> de ser un vampiro <V>SOLO EN ESTA RONDA!<br><BL>esto le costo <V>1500 Monedas<BL>.")
  427.        
  428.             elif command in ["pinkbuy"]:
  429.                 if this.client.iceCoins >= 200:
  430.                     this.client.iceCoins -= 200
  431.                     this.client.room.sendAllBin(Identifiers.old.send.Halloween_Player_Damanged, ByteArray().writeInt(this.client.playerCode).toByteArray())                    
  432.                     this.client.sendMessage("<V>• <BL>Usted compro el <V>Poder<BL> de ser de color rojo <V>SOLO EN ESTA RONDA!<br><BL>esto le costo <V>200 Monedas<BL>.")
  433.  
  434.             elif command in ["meepbuy"]:
  435.                 if this.client.iceCoins >= 200:
  436.                     this.client.iceCoins -= 200
  437.                     if this.client.room.iceEnabled or this.client.privLevel >= 8:
  438.                        this.client.sendPacket(Identifiers.send.Can_Meep, chr(1), True)
  439.                        this.client.sendMessage("<V>• <BL>Usted compro el <V>Poder<BL> Meep <V>SOLO EN ESTA RONDA!<br><BL>esto le costo <V>500 Monedas<BL>.")
  440.  
  441.             elif command in ["vipbuy"]:
  442.                 if this.client.iceCoins >= 5000:
  443.                     this.client.iceCoins -= 5000
  444.                     this.client.privLevel += 2
  445.                     this.client.sendMessage("<V>• <BL>Usted compro <J>RANK VIP<BL> usa el comando <V>/helpvip<BL> para ver su lista de comandos.")
  446.                     this.server.sendModMessage(7, "<V>"+playerName+"<BL> compro <V>VIP<BL> Llame a un Administrador para que le de su cargo real.")
  447.                                            
  448.             elif command in ["cara"]:
  449.                 if this.client.iceCoins >= 500:
  450.                     titleID = 235.1 if id == 1 else 235.1
  451.                     this.client.iceCoins -= 500
  452.                     this.client.specialTitleList.append(titleID);
  453.                     this.client.sendUnlockedTitle(str(int(titleID)), "")
  454.                     this.client.sendCompleteTitleList()
  455.                     this.client.sendTitleList()
  456.                     this.client.sendMessage("<ROSE>• <N>Usted compro el titulo <ROSE>*-*</ROSE> ,eso le costo 500 monedas.")
  457.  
  458.             elif command in ["relampago"]:
  459.                 if this.client.iceCoins >= 500:
  460.                     titleID = 71.1 if id == 1 else 71.1
  461.                     this.client.iceCoins -= 500
  462.                     this.client.specialTitleList.append(titleID);
  463.                     this.client.sendUnlockedTitle(str(int(titleID)), "")
  464.                     this.client.sendCompleteTitleList()
  465.                     this.client.sendTitleList()
  466.                     this.client.sendMessage("<ROSE>• <N>Usted compro el titulo <ROSE>RELÂMPAGO</ROSE>,eso le costo 500 monedas.")
  467.  
  468.             elif command in ["alphaeomega"]:
  469.                 if this.client.iceCoins >= 300:
  470.                     titleID = 114.1 if id == 1 else 114.1
  471.                     this.client.iceCoins -= 300
  472.                     this.client.specialTitleList.append(titleID);
  473.                     this.client.sendUnlockedTitle(str(int(titleID)), "")
  474.                     this.client.sendCompleteTitleList()
  475.                     this.client.sendTitleList()
  476.                     this.client.sendMessage("<ROSE>• <N>Usted compro el titulo <ROSE>Alpha & Omega</ROSE>,eso le costo 300 monedas.")
  477.                 else:
  478.                     this.client.sendMessage("<ROSE>• <N>Usted no tiene monedas suficientes para comprar este titulo.")
  479.                     this.client.sendMessage("<ROSE>• <N>Actualmente usted tiene <ROSE>"+str(this.client.iceCoins)+"</ROSE> monedas")
  480.  
  481.             elif command in ["perfil1"]:
  482.                 if this.client.iceCoins >= 1000:
  483.                     this.client.iceCoins -= 1000
  484.                     this.client.firstCount += 300
  485.                     this.client.cheeseCount += 300
  486.                     this.client.sendMessage("<ROSE>• <N>Usted compro el paquete de perfil <ROSE>de 300 firsts y quesos</ROSE>,eso le costo 1000 monedas.")
  487.                 else:
  488.                     this.client.sendMessage("<ROSE>• <N>Usted no tiene suficientes monedas para comprar este pack.")
  489.  
  490.             elif command in ["perfil2"]:
  491.                 if this.client.iceCoins >= 500:
  492.                      this.client.iceCoins -= 500
  493.                      this.client.shamanSaves += 300
  494.                      this.client.sendMessage("<ROSE>• <N>Usted compro el paquete de perfil <ROSE>de 300 saves</ROSE>,eso le costo 500 monedas.")
  495.                 else:
  496.                     this.client.sendMessage("<ROSE>• <N>Usted no tiene suficientes monedas para comprar este pack.") 
  497.  
  498.                     #FIM
  499.  
  500.             elif command in ["lojinha", "loja", "tienda", "shop"]:
  501.                 if this.client.privLevel >= 1:
  502.                     message = "<p align = \"center\"><font size = \"15\"><N>° Shop SeuMice °</p><p align=\"left\"><font size = \"12\"><br><br>"
  503.                     message += "<N>• <N>You have<ROSE> "+str(this.client.iceCoins)+" <N>Coins to buy in this Shop.<br><br>"
  504.                     message += "<N>• <N>Buy<ROSE> VIP<N> to win<ROSE> Diaries Rewards<br><br>"                   
  505.                     message += "<ROSE>• <N>Titles:<font size = \"12\"><br><br>"      
  506.                     message += "<N>• <ROSE>Relampago<N> = 500 Coins<ROSE> /relampago<br>"            
  507.                     message += "<N>• <ROSE>*-*<N> = 300 Coins<ROSE> /carinha<br>"            
  508.                     message += "<N>• <ROSE>Alpha & Omega<N> = 300 Coins<ROSE> /alphaomega<br>"
  509.                     message += "<N>• <ROSE>La Belette<N> = 1500 Coins<ROSE> /labelette<br>"
  510.                     message += "<N>• <ROSE>Fromadmin<N> = 2000 Coins<ROSE> /fromadmin<br>"
  511.                     message += "<N>• <ROSE>El Pinolero<N> = 1000 Coins<ROSE> /elpinolero<br>"
  512.                     message += "<N>• <ROSE>Sourigami<N> = 1000 Coins<ROSE> /sourigami<br><br>"                       
  513.                     message += "<ROSE>• <N>Powers:<font size = \"12\"><br><br>"
  514.                     message += "<N>• <ROSE>Respawn<N> = 100 Coins<ROSE> /rev<br>"            
  515.                     message += "<N>• <ROSE>Transformation<N> = 200 Coins<ROSE> /vbigbuy<br>"
  516.                     message += "<N>• <ROSE>Pink<N> = 200 Coins<ROSE> /pinkbuy<br>"
  517.                     message += "<N>• <ROSE>Shaman<N> = 1000 Coins<ROSE> /vsha<br>"                       
  518.                     message += "<N>• <ROSE>Meep<N> = 500 Coins<ROSE> /meepbuy<br>"                   
  519.                     message += "<N>• <ROSE>Vampire<N> = 1500 Coins<ROSE> /vampbuy<br><br>"                   
  520.                     message += "<ROSE>• <N>Profile:<font size = \"12\"><br><br>"
  521.                     message += "<N>• <ROSE>Profile 1<N> = 1000 Coins<ROSE> /perfil1<br>"                 
  522.                     message += "<N>• <ROSE>Profile 2<N> = 500 Coins<ROSE> /perfil2<br>"
  523.                     message += "<N>• <ROSE>VIP<N> = 5000 Coins<ROSE> /vipbuy<br>"
  524.                     message += "<N>• <ROSE>Badges<N> = 3000 Coins<ROSE> /badgesbuy<br>"                      
  525.                     this.client.sendLogMessage(message.replace("&#", "&amp;#").replace("&lt;", "<"))                   
  526.        
  527.             elif command in ["ajudavip", "helpvip", "ayudavip"]:
  528.                 if this.client.privLevel >= 2:
  529.                     message = "<p align = \"center\"><font size = \"20\"><ROSE>VIP Command List</p><p align=\"left\"><font size = \"12\"><br><br>"
  530.                     message += "<p align = \"center\"><font size = \"15\"><b><N>Information:</b></p><p align=\"left\"><font size = \"12\"><br><br>"
  531.                     message += "<N>• <ROSE>Use <N>/help<ROSE> to open or Users Commands.<br><br>"            
  532.                     message += "<p align = \"center\"><font size = \"15\"><b><N>Commands:</b></p><p align=\"left\"><font size = \"12\"><br><br>"
  533.                     message += "<ROSE>• <N>/meep <ROSE>- <N>Free Meep<br>"
  534.                     message += "<ROSE>• <N>/vamp <ROSE>- <N>Free Vampire<br>"                
  535.                     message += "<ROSE>• <N>/pink <ROSE>- <N>Free Red Color<br>"  
  536.                     message += "<ROSE>• <N>/carinhafree <ROSE>- <N>Free Title.<br>"
  537.                     message += "<ROSE>• <N>/relampagofree <ROSE>- <N>Free Title.<br>"
  538.                     message += "<ROSE>• <N>/alphaomegafree <ROSE>- <N>Free Title.<br>"                       
  539.                     this.client.sendLogMessage(message.replace("&#", "&amp;#").replace("&lt;", "<"))
  540.                        
  541.             elif command in ["help"]:
  542.                 if this.client.privLevel >= 1:
  543.                     message = "<p align = \"center\"><font size = \"20\"><ROSE>Command List of WorldMice</p><br>"
  544.                     message += "<p align = \"center\"><font size = \"15\"><b><N>Information:</b></p><p align=\"left\"><font size = \"12\"><br><br>"
  545.                     message += "<N>• <ROSE>The First start with <N>5</N> mices in the room.<br>"
  546.                     message += "<N>• <ROSE>The Bootcamp start with <N>3</N> mices in the room.<br>"
  547.                    
  548.                     message += "<p align = \"center\"><font size = \"15\"><b><N>Commands:</b></p><p align=\"left\"><font size = \"12\"><br><br>"                       
  549.                     message += "<ROSE>• <N>/Shop <ROSE>- <N>Open the Shop of WorldMice.<br>" 
  550.                     message += "<ROSE>• <N>/Color <ROSE>- <N>Open the main menu of colors.<br>"
  551.                     message += "<ROSE>• <N>/Mod <ROSE>- <N>Send a Message of Moderators on WorldMice.<br>"                   
  552.                     message += "<ROSE>• <N>/Vips <ROSE>- <N>Send a Message of VIPS on WorldMice.<br>"
  553.                     message += "<ROSE>• <N>/Report [NICK] <ROSE>- <N>Report a Player.<br>"
  554.                     message += "<ROSE>• <N>/Ban [NICK] <ROSE>- <N>Give 1 point to one Player in BAN LIST.<br>"
  555.                     message += "<ROSE>• <N>/C [NICK] <ROSE>- <N>Send a Hiden Message to a Player.<br>"
  556.                     message += "<ROSE>• <N>/Don <ROSE>- <N>Animation of give a Gift.<br><br>"                                                                            
  557.                     this.client.sendLogMessage(message.replace("&#", "&amp;#").replace("&lt;", "<"))                   
  558.                                        
  559.             elif command in ["ayuda"]:
  560.                 if this.client.privLevel >= 1:
  561.                     message = "<p align = \"center\"><font size = \"20\"><ROSE>Lista de comandos de WorldMice</p><br>"
  562.                     message += "<p align = \"center\"><font size = \"15\"><b><N>Información:</b></p><p align=\"left\"><font size = \"12\"><br><br>"
  563.                     message += "<N>• <ROSE>El First comienza con <N>5</N> ratones en la sala.<br>"
  564.                     message += "<N>• <ROSE>El Bootcamp comienza con <N>3</N> Ratones en la sala.<br>"
  565.                    
  566.                     message += "<p align = \"center\"><font size = \"15\"><b><N>Comandos:</b></p><p align=\"left\"><font size = \"12\"><br><br>"                   
  567.                     message += "<ROSE>• <N>/Tienda <ROSE>- <N>Abre la tienda de WorldMice.<br>"  
  568.                     message += "<ROSE>• <N>/Color <ROSE>- <N>Abre ele Menu de Cambiar el Color a Su Raton.<br>"
  569.                     message += "<ROSE>• <N>/Mod <ROSE>- <N>Muestra cuantos moderadores hay.<br>"                 
  570.                     message += "<ROSE>• <N>/Vips <ROSE>- <N>Muestra cuantos VIPS hay.<br>"
  571.                     message += "<ROSE>• <N>/Report [NOMBRE] <ROSE>- <N>Reporta a un Jugador<br>"
  572.                     message += "<ROSE>• <N>/Ban [NOMBRE] <ROSE>- <N>Da 1 Punto de Ban a un Jugador.<br>"
  573.                     message += "<ROSE>• <N>/C [NOMBRE] <ROSE>- <N>Susurra a un Jugador.<br>"
  574.                     message += "<ROSE>• <N>/Don <ROSE>- <N>Animacion de dar un Regalo<br><br>"                                                                               
  575.                     this.client.sendLogMessage(message.replace("&#", "&amp;#").replace("&lt;", "<"))                   
  576.                    
  577.             elif command in ["ajuda"]:
  578.                 if this.client.privLevel >= 1:
  579.                     message = "<p align = \"center\"><font size = \"20\"><ROSE>Lista de comandos do WorldMice</p><br>"
  580.                     message += "<p align = \"center\"><font size = \"15\"><b><N>Informações:</b></p><p align=\"left\"><font size = \"12\"><br><br>"
  581.                     message += "<N>• <ROSE>First começa a contar com <N>5</N> ratos na sala.<br>"
  582.                     message += "<N>• <ROSE>Bootcamp começa a contar com <N>3</N> ratos na sala.<br>"
  583.                                        
  584.                     message += "<p align = \"center\"><font size = \"15\"><b><N>Comandos:</b></p><p align=\"left\"><font size = \"12\"><br><br>"                   
  585.                     message += "<ROSE>• <N>/Lojinha <ROSE>- <N>Abre a Lojinha do WorldMice.<br>" 
  586.                     message += "<ROSE>• <N>/Mcor <ROSE>- <N>Abre um Menu com a Capacidade de Trocar o cor do seu Rato.<br>"
  587.                     message += "<ROSE>• <N>/Mod <ROSE>- <N>Lista de Moderadores conectados dentro do SeuMice.<br>"                   
  588.                     message += "<ROSE>• <N>/Vip <ROSE>- <N>Abre o Listado de Vips do SeuMice.<br>"
  589.                     message += "<ROSE>• <N>/Report [NOME] <ROSE>- <N>Reporta a um Jogador por Algum Motivo.<br>"
  590.                     message += "<ROSE>• <N>/Ban [NOME] <ROSE>- <N>Da 1 Ponto de Ban para Um Jogador/a para ser Banido Pelo Karma.<br>"
  591.                     message += "<ROSE>• <N>/C [NOME] <ROSE>- <N>Cochicha com um Jogador/a dentro do SeuMice, em Qualquer comunidade<br>"
  592.                     message += "<ROSE>• <N>/Don <ROSE>- <N>Usa uma Animacao de Dar um Presente.<br><br>"                                     
  593.                     this.client.sendLogMessage(message.replace("&#", "&amp;#").replace("&lt;", "<"))                   
  594.  
  595.             elif command in ["ranking"]:
  596.                 if this.client.privLevel >= 1:
  597.                     message = "<p align = \"center\"><font size = \"20\"><ROSE>WORLDMICE RANKING</p><br>"
  598.                     message += "<N>• <ROSE>LINK: <N>http://worldmice.rankcfm.cf/</N>.<br>"
  599.                                        
  600.                     this.client.sendLogMessage(message.replace("&#", "&amp;#").replace("&lt;", "<"))
  601.                    
  602.             elif command in ["staff", "equipe", "equipo"]:
  603.                 lists = ["<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>", "<p align='center'>"]
  604.                 this.Cursor.execute("select Username, PrivLevel from Users where PrivLevel > 3")
  605.                 r = this.Cursor.fetchall()
  606.                 for rs in r:
  607.                     playerName = rs["Username"]
  608.                     privLevel = int(rs["PrivLevel"])
  609.                     lists[{11:0, 10:1, 9:2, 8:3, 7:4, 6:5, 5:6}[privLevel]] += "\n" + ("<VP> •<N> " if this.server.checkConnectedAccount(playerName) else "<R> • ") + " <N>" + playerName + "<V> - <N>[" + {11: "<J>Fundador", 10: "<ROSE>Administrador", 9:"<VI>Coordenador", 8:"<J>Super Moderador", 7:"<CE>Moderador", 6:"<CEP>MapCrew", 5:"<CS>Helper"}[privLevel] + "<N>] \n"
  610.                 this.client.sendLogMessage("<p align='center'><b><J>º - - - - - - - - - - - - - - - <N>Equipe<J> - - - - - - - - - - - - - - - º</b></b></b></b></p><br><p align = \"center\"><font size = \"12\"><VP>• <N>Online<br><R>• <N>Offline</p>" + "".join(lists) + "</p>""<br><br>")
  611.                
  612.             elif command in ["vips", "vipers"]:
  613.                 if this.client.privLevel >= 1:
  614.                     lists = "<V><p align='center'><b>VIPS</b></p><p align='center'>"
  615.                     this.Cursor.execute("select Username from Users where PrivLevel = 2")
  616.                     r = this.Cursor.fetchall()
  617.                     for rs in r:
  618.                         playerName = rs["Username"]
  619.                         lists += "\n" + ("<VP> •<N> " if this.server.checkConnectedAccount(playerName) else "<R> • ") + " <J>[<N>" + playerName + "<J>] \n"
  620.                     this.client.sendLogMessage(lists + "</p>")
  621.                            
  622.             elif command in ["teleport"]:
  623.                 if this.client.privLevel >= 9:
  624.                     this.client.isTeleport = not this.client.isTeleport
  625.                     this.client.room.bindMouse(this.client.Username, this.client.isTeleport)
  626.                     this.client.sendMessage("Teleport Hack: " + ("<VP>ON" if this.client.isTeleport else "<R>OFF") + " !")
  627.  
  628.             elif command in ["fly"]:
  629.                 if this.client.privLevel >= 9:
  630.                     this.client.isFly = not this.client.isFly
  631.                     this.client.room.bindKeyBoard(this.client.Username, 32, False, this.client.isFly)
  632.                     this.client.sendMessage("Fly Hack: " + ("<VP>ON" if this.client.isFly else "<R>OFF") + " !")
  633.  
  634.             elif command in ["speed"]:
  635.                 if this.client.privLevel >= 9:
  636.                     this.client.isSpeed = not this.client.isSpeed
  637.                     this.client.room.bindKeyBoard(this.client.Username, 32, False, this.client.isSpeed)
  638.                     this.client.sendMessage("Speed Hack: " + ("<VP>ON" if this.client.isSpeed else "<R>OFF") + " !")
  639.  
  640.             elif command in ["vamp"]:
  641.                 if this.client.privLevel >= 4:
  642.                     if this.client.room.iceEnabled or this.client.privLevel >= 8:
  643.                         this.client.sendVampireMode(False)
  644.  
  645.             elif command in ["meep"]:
  646.                 if this.client.privLevel >= 4:
  647.                     this.client.canMeep = True
  648.                     if this.client.room.iceEnabled or this.client.privLevel >= 8:
  649.                         this.client.sendPacket(Identifiers.send.Can_Meep, chr(1), True)
  650.  
  651.             elif command in ["don"]:
  652.                 this.client.room.sendAllBin(Identifiers.send.Don, ByteArray().writeInt(this.client.playerCode).toByteArray())
  653.  
  654.             elif command in ["vbig"]:
  655.                 if this.client.privLevel >= 10:
  656.                     this.client.sendPacket(Identifiers.send.Can_Transformation, chr(1), True)
  657.  
  658.                 else:
  659.                     this.client.sendMessage("<V>• <N>Você não tem moedas suficientes para usar esse comando.")
  660.                     this.client.sendMessage("<V>• <N>Atualmente você tem <font color='#64FE2E'>"+str(this.client.iceCoins)+"</font> moedas")
  661.                    
  662.             elif command in ["vsha1"]:
  663.                 if this.client.privLevel >= 10:
  664.                     this.client.isShaman = True
  665.                     for player in this.client.room.clients.values():
  666.                         player.sendShamanCode(this.client.playerCode)
  667.  
  668.             elif command in ["vsha"]:
  669.                 if this.client.iceCoins >= 500:
  670.                     this.client.iceCoins -= 500
  671.                     this.client.isShaman = True
  672.                     for player in this.client.room.clients.values():
  673.                         player.sendShamanCode(this.client.playerCode)                      
  674.                    
  675.             elif command in ["meusmapas", "mismapas", "mymaps", "lsmap"]:
  676.                 if this.client.privLevel >= 1:
  677.                     result = ""
  678.                     mapList = ""
  679.                     mapCount = 0
  680.                    
  681.                     this.Cursor.execute("select * from MapEditor where Name = ?", [this.client.Username])
  682.                     r = this.Cursor.fetchall()
  683.                     for rs in r:
  684.                         mapCount += 1
  685.                         yesVotes = rs["YesVotes"]
  686.                         noVotes = rs["NoVotes"]
  687.                         totalVotes = yesVotes + noVotes
  688.                         if totalVotes < 1: totalVotes = 1
  689.                         Rating = (1.0 * yesVotes / totalVotes) * 100
  690.                         rate = str(Rating).split(".")[0]
  691.                         if rate == "Nan": rate = "0"
  692.                         mapList += "<br><N>"+this.client.Username+" - @"+str(rs["Code"])+" - "+str(totalVotes)+" - "+str(rate)+"% - P"+str(rs["Perma"])
  693.  
  694.                     if len(mapList) != 0:
  695.                         result = str(mapList)
  696.  
  697.                     try: this.client.sendLogMessage("<font size= \"12\"><V>"+this.client.Username+"<N>'s maps: <BV>"+str(mapCount)+ str(result)+"</font>")
  698.                     except: pass
  699.  
  700.             elif command in ["luaadmin"]:
  701.                 if this.client.privLevel >= 10:
  702.                     this.client.runLuaAsBot = not this.client.runLuaAsBot
  703.                     this.client.sendClientMessage("Usted ahora podra usar scripts como administrador en LUA." if this.client.runLuaAsBot else "Usted no podra usar mas scripts como administrador en LUA.")    
  704.  
  705.             elif command in ["racing", "survivor", "bootcamp", "vanilla", "tutorial", "music", "801"]:
  706.                 this.client.enterRoom("music1" if command == "music" else "801" if command == "801" else "racing1" if command == "racing" else "survivor1" if command == "survivor" else "bootcamp1" if command == "bootcamp" else "vanilla1" if command == "vanilla" else (chr(3) + "[Tutorial] " + this.client.Username) if command == "tutorial" else "")
  707.                
  708.             elif command in ["lsc"]:
  709.                 if this.client.privLevel >= 7:
  710.                     result = {}
  711.                     for room in this.server.rooms.values():
  712.                         if result.has_key(room.community):
  713.                             result[room.community] = result[room.community] + room.getPlayerCount()
  714.                         else:
  715.                             result[room.community] = room.getPlayerCount()
  716.  
  717.                     message = "\n"
  718.                     for community, count in result.items():
  719.                         message += "<V>"+str(community.upper())+"<BL> : <J>"+str(count)+"\n"
  720.                     message += "<V>ALL<BL> : <J>"+str(sum(result.values()))
  721.                     this.client.sendClientMessage(message)
  722.  
  723.         else:
  724.             if command == "profil" or command == "perfil" or command == "profile":
  725.                 if this.client.privLevel >= 1:
  726.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  727.                     this.client.sendProfile(playerName)
  728.  
  729.             elif command == "ban" or command == "iban":
  730.                 if this.client.privLevel >= 7 or this.client.Username == "Azin":
  731.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  732.                     time = args[1] if (argsCount >= 2) else "1"
  733.                     reason = argsNotSplited.split(" ", 3)[2] if (argsCount >= 3) else ""
  734.                     silent = command == "iban"
  735.                     hours = int(time) if (time.isdigit()) else 1
  736.                     hours = 10000 if (hours > 10000) else hours
  737.                     hours = 24 if (this.client.privLevel <= 6 and hours > 24) else hours
  738.                     if this.server.banPlayer(playerName, hours, reason, this.client.Username, silent):
  739.                         this.server.sendModMessage(7, "<V>"+this.client.Username+"<BL> baniu <V>"+playerName+"<BL> por <V>"+str(hours)+"<BL> horas. Motivo: <V>"+str(reason)+"<BL>." )
  740.                         aq=open("./Mice/Comandos/ban.log","a"); aq.write(""+this.client.Username+" Baniu a "+playerName+" por "+str(hours)+" horas. Motivo: "+str(reason)+"\n")
  741.                 else:
  742.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  743.                     this.server.voteBanPopulaire(playerName, this.client.ipAddress)
  744.  
  745.             elif command == "unban":
  746.                 if this.client.privLevel >= 7:
  747.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  748.                     this.requireNoSouris(playerName)
  749.                     found = False
  750.  
  751.                     if this.server.checkExistingUser(playerName):
  752.                         if this.server.checkTempBan(playerName):
  753.                             this.server.removeTempBan(playerName)
  754.                             found = True
  755.  
  756.                         if this.server.checkPermaBan(playerName):
  757.                             this.server.removePermaBan(playerName)
  758.                             found = True
  759.  
  760.                         if found:
  761.                             this.Cursor.execute("update Users set BanHours = ? where Username = ?", [0, playerName])
  762.                             this.Cursor.execute("insert into BanLog (Name, BannedBy, Time, Reason, Date, Status, Room, IP) values (?, ?, ?, ?, ?, ?, ?, ?)", [playerName, this.client.Username, "", "", "", "Unban", "", ""])
  763.  
  764.                             this.server.sendModMessage(7, "<V>"+this.client.Username+"<N> desbaniu <V>"+playerName+"<BL>.")
  765.                             aq=open("./Mice/Comandos/unban.log","a"); aq.write(""+this.client.Username+" desbaniu a "+playerName+"\n")
  766.  
  767.             elif command == "mute":
  768.                 if this.client.privLevel >= 5:
  769.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  770.                     time = args[1] if (argsCount >= 2) else "1"
  771.                     reason = argsNotSplited.split(" ", 3)[2] if (argsCount >= 3) else ""
  772.                     hours = int(time) if (time.isdigit()) else 1
  773.                     this.requireNoSouris(playerName)
  774.                     hours = 500 if (hours > 500) else hours
  775.                     hours = 24 if (this.client.privLevel <= 6 and hours > 24) else hours
  776.                     this.server.mutePlayer(playerName, hours, reason, this.client.Username)
  777.  
  778.             elif command == "unmute":
  779.                 if this.client.privLevel >= 7:
  780.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  781.                     this.requireNoSouris(playerName)
  782.                     this.server.desmutePlayer(playerName, this.client.Username)
  783.  
  784.             elif command == "time":
  785.                 if this.client.privLevel >= 8:
  786.                     time = args[0]
  787.                     if time.isdigit():
  788.                         iTime = int(time)
  789.                         iTime = 5 if iTime < 5 else (32767 if iTime > 32767 else iTime)
  790.  
  791.                         for player in this.client.room.clients.values():
  792.                             player.sendRoundTime(iTime)
  793.  
  794.                         this.client.room.changeMapTimers(iTime)
  795.  
  796.             elif command == "np" or command == "npp":
  797.                 if not this.client.room.isVotingMode:
  798.                     canUse = False
  799.                     code = args[0]
  800.  
  801.                     if this.client.privLevel >= 6:
  802.                         canUse = True
  803.                     elif not this.client.tribeName == "" and this.client.room.isTribeHouse:
  804.                         tribeRankings = this.client.tribeData[3]
  805.                         perm = tribeRankings[this.client.tribeRank].split("|")[2]
  806.                         if perm.split(",")[8] == "1":
  807.                             canUse = True
  808.  
  809.                     if canUse:
  810.                         if code.startswith("@"):
  811.                             mapInfo = this.client.room.getMapInfo(int(code[1:]))
  812.                             if mapInfo[0] == None:
  813.                                 this.client.sendMessageLangue("", "$CarteIntrouvable")
  814.                             else:
  815.                                 this.client.room.forceNextMap = code
  816.                                 if command == "np":
  817.                                     if this.client.room.changeMapTimer != None: this.client.room.changeMapTimer.cancel()
  818.                                     this.client.room.mapChange()
  819.                                 else:
  820.                                     this.client.sendMessageLangue("", "$ProchaineCarte <V>" + code)
  821.  
  822.                         elif code.isdigit():
  823.                             this.client.room.forceNextMap = code
  824.                             if command == "np":
  825.                                 if this.client.room.changeMapTimer != None: this.client.room.changeMapTimer.cancel()
  826.                                 this.client.room.mapChange()
  827.                             else:
  828.                                 this.client.sendMessageLangue("", "$ProchaineCarte <V>" + code)
  829.  
  830.             elif command == "mjj":
  831.                 roomName = args[0]
  832.                 if roomName.startswith("#"):
  833.                     this.client.enterRoom(roomName + "1")
  834.                 else:
  835.                     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 >= 10 else "bootcamp" if this.client.lastGameMode == 2 else "defilante" if this.client.lastGameMode >= 10 else "village") + roomName)
  836.  
  837.             elif command == "pw":
  838.                 password = args[0]
  839.                 if this.client.room.roomName.startswith("*" + this.client.Username) or this.client.room.roomName.startswith(this.client.Username):
  840.                     this.client.room.roomPassword = password
  841.                     this.client.sendClientMessage("Password : " + password)
  842.  
  843.             elif command in ["title", "titulo", "titre"]:
  844.                 if this.client.privLevel >= 1:
  845.                     if len(args) == 0:
  846.                         p = ByteArray()
  847.                         p2 = ByteArray()
  848.                         titlesCount = 0
  849.                         starTitlesCount = 0
  850.  
  851.                         for title in this.client.titleList:
  852.                             titleInfo = str(title).split(".")
  853.                             titleNumber = int(titleInfo[0])
  854.                             titleStars = int(titleInfo[1])
  855.                             if titleStars > 1:
  856.                                 p.writeShort(titleNumber).writeByte(titleStars)
  857.                                 starTitlesCount += 1
  858.                             else:
  859.                                 p2.writeShort(titleNumber)
  860.                                 titlesCount += 1
  861.  
  862.                         this.client.sendPacket(Identifiers.send.Titles_List, ByteArray().writeShort(titlesCount).writeBytes(p2.toByteArray()).writeShort(starTitlesCount).writeBytes(p.toByteArray()).toByteArray(), True)
  863.                     else:
  864.                         titleID = args[0]
  865.                         found = False
  866.                         for title in this.client.titleList:
  867.                             if str(title).split(".")[0] == titleID:
  868.                                 found = True
  869.  
  870.                         if found:
  871.                             this.client.TitleNumber = int(titleID)
  872.                             for title in this.client.titleList:
  873.                                 if str(title).split(".")[0] == titleID:
  874.                                     this.client.TitleStars = int(str(title).split(".")[1])
  875.                         this.client.sendPacket([100, 72], ByteArray().writeByte(this.client.gender).writeShort(titleID).toByteArray(), True)
  876.                                                                
  877.             elif command == "clearban":
  878.                 if this.client.privLevel >= 7:
  879.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  880.  
  881.                     player = this.server.players.get(playerName)
  882.                     if player != None:
  883.                         player.voteBan = []
  884.                         this.server.sendModMessage(7, "<V>"+this.client.Username+"<BL> limpio los votos de banear a <V>"+playerName+"<BL>.")
  885.                    
  886.             elif command == "ip":
  887.                 if this.client.privLevel >= 7:
  888.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  889.  
  890.                     player = this.server.players.get(playerName)
  891.                     if player != None:
  892.                         this.client.sendMessage("IP del usuário <V>"+playerName+"<BL> : <V>"+player.ipAddress+"<BL>")
  893.                 else:
  894.                     this.client.room.chatMessage("El usuario ["+str(playerName)+"] esta desconectado.", this.client.Username)
  895.  
  896.             elif command == "kick":
  897.                 if this.client.privLevel >= 6:
  898.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  899.  
  900.                     player = this.server.players.get(playerName)
  901.                     if player != None:
  902.                         player.room.removeClient(player)
  903.                         player.transport.loseConnection()
  904.                         this.server.sendModMessage(7, "<V>"+this.client.Username+"<BL> kickeo a <V>"+playerName+"<BL> del servidor.")
  905.                         aq=open("./Mice/Comandos/kick.log","a"); aq.write(""+this.client.Username+" chutou "+playerName+" do Servidor\n")
  906.                     else:
  907.                         this.client.sendClientMessage("El usuario <V>"+playerName+"<BL> esta desconectado.")
  908.  
  909.             elif command == "ch":
  910.                 if this.client.privLevel >= 7:
  911.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  912.                    
  913.                     player = this.server.players.get(playerName)
  914.                     if player != None and player.roomName == this.client.roomName:
  915.  
  916.                         if this.client.room.forceNextShaman == player.playerCode:
  917.                             this.client.sendMessageLangue("", "$PasProchaineChamane", player.Username)
  918.                             this.client.room.forceNextShaman = -1
  919.                         else:
  920.                             this.client.sendMessageLangue("", "$ProchaineChamane", player.Username)
  921.                             this.client.room.forceNextShaman = player.playerCode
  922.                             this.client.sendClientMessage("El usuario <V>"+playerName+"<BL> sera el proximo chaman.")
  923.                     else:
  924.                         this.client.sendClientMessage("El usuario <V>"+playerName+"<BL> no esta online o tal vez este en otra sala.")
  925.  
  926.             elif command == "search" or command == "find":
  927.                 if this.client.privLevel >= 5:
  928.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  929.                     result = ""
  930.                     for player in this.server.players.values():
  931.                         if playerName in player.Username:
  932.                             result += "<br><V>"+player.Username+"<BL> -> <V>"+player.room.name
  933.  
  934.                     this.client.sendClientMessage(result)
  935.  
  936.             elif command == "smn":
  937.                 if this.client.privLevel >= 10:
  938.                     message = argsNotSplited
  939.                     this.client.sendAllModerationChat(-1, message)
  940.  
  941.             elif command == "gg1":
  942.                 if this.client.privLevel >= 7:
  943.                     message = argsNotSplited
  944.                     this.client.sendAllModerationChat(-1, message)
  945.  
  946.             elif command == "mshtml":
  947.                 if this.client.privLevel >= 10:
  948.                     message = argsNotSplited.replace("&#", "&amp;#").replace("&lt;", "<")
  949.                     this.client.sendAllModerationChat(0, message)
  950.  
  951.             elif command == "fund":
  952.                 if this.client.privLevel >= 11:
  953.                     message = argsNotSplited
  954.                     this.client.sendStaffMessage("<N>• <J>[Fundador "+this.client.Username+"] <N>"+message)                  
  955.  
  956.             elif command == "admin":
  957.                 if this.client.privLevel >= 10:
  958.                     message = argsNotSplited
  959.                     this.client.sendStaffMessage("<N>• <ROSE>[Administrador "+this.client.Username+"] <N>"+message)
  960.  
  961.             elif command in ["coord"]:
  962.                 if this.client.privLevel >= 9:
  963.                     message = argsNotSplited
  964.                     this.client.sendStaffMessage("<N>• <font color='#A505A3'>[Coordenador "+this.client.Username+"] <N>"+message)
  965.  
  966.             elif command in ["smod", "sms"]:
  967.                 if this.client.privLevel >= 8:
  968.                     message = argsNotSplited
  969.                     this.client.sendStaffMessage("<N>• <font color='#FFEF00'>[Super Moderador "+this.client.Username+"] <N>"+message)
  970.  
  971.             elif command in ["mod"]:
  972.                 if this.client.privLevel >= 7:
  973.                     message = argsNotSplited
  974.                     this.client.sendStaffMessage("<N>• <font color='#FF8300'>[Moderador "+this.client.Username+"] <N>"+message)
  975.  
  976.             elif command in ["mc"]:
  977.                 if this.client.privLevel >= 6:
  978.                     message = argsNotSplited
  979.                     this.client.sendStaffMessage("<N>• <CEP>[MapCrew "+this.client.Username+"] <N>"+message)
  980.  
  981.             elif command in ["helper"]:
  982.                 if this.client.privLevel >= 5:
  983.                     message = argsNotSplited
  984.                     this.client.sendStaffMessage("<N>• <CS>[Helper "+this.client.Username+"] <N>"+message)
  985.  
  986.             elif command in ["vip"]:
  987.                 if this.client.privLevel >= 2:
  988.                     message = argsNotSplited
  989.                     this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<N>• <N>[<font color='#FF0000'>Vip <N><b>"+this.client.Username+"</b><N>] <N>"+message).toByteArray())
  990.                 else:
  991.                     this.client.sendMessage("<ROSE>• <N>Você não tem acesso suficiente para usar esse Comando.")       
  992.  
  993.             elif command in ["nombre"]:
  994.                 if this.client.privLevel >= 7:
  995.                     message = argsNotSplited
  996.                     this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<V>• <font color='#00EEFF'>[<b>"+this.client.Username+"</b>] "+message+"</font>").toByteArray())
  997.  
  998.             elif command in ["evento"]:
  999.                 if this.client.privLevel >= 9:
  1000.                     message = argsNotSplited
  1001.                     this.client.room.sendAllBin(Identifiers.send.Message, ByteArray().writeUTF("<ROSE>• [<N>Evento WorldMice<ROSE>]</font> <N>"+message).toByteArray())
  1002.  
  1003.             elif command in ["mice"]:
  1004.                 if this.client.privLevel >= 10:
  1005.                     message = argsNotSplited
  1006.                     this.client.sendStaffMessage("<ROSE>• [WorldMice]</font> <N>"+message)
  1007.                        
  1008.             elif command == "rank":
  1009.                 if this.client.privLevel in [10, 11] or this.client.Username == "Azin":
  1010.                     this.requireArgs(2)
  1011.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1012.                     rank = args[1].lower()
  1013.                     this.requireNoSouris(playerName)
  1014.  
  1015.                     if not this.server.checkExistingUser(playerName):
  1016.                         this.client.sendClientMessage("No fue posible encontrar al usuario: <V>"+playerName+"<BL>.")
  1017.                     else:
  1018.                         privLevel = 11 if rank.startswith("fund") else 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("hel") 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
  1019.                         rankName = "Fundador" if rank.startswith("fund") else "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 "Helper" if rank.startswith("hel") 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"
  1020.  
  1021.                         player = this.server.players.get(playerName)
  1022.                         if player != None:
  1023.                             player.privLevel = privLevel
  1024.                             player.TitleNumber = 0
  1025.                             player.sendLogin()
  1026.                         else:
  1027.                             this.Cursor.execute("update Users set PrivLevel = ?, TitleNumber = 0 where Username = ?", [privLevel, playerName])
  1028.                            
  1029.                         this.server.sendModMessage(11, "<V>"+this.client.Username+"<BL> dio rango al jugador <V>"+playerName+"<BL> de <V>"+rankName+"<BL>.")
  1030.  
  1031.             elif command == "setvip":
  1032.                 if this.client.privLevel >= 10:
  1033.                     this.requireArgs(2)
  1034.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1035.                     days = args[1]
  1036.                     this.requireNoSouris(playerName)
  1037.  
  1038.                     if not this.server.checkExistingUser(playerName):
  1039.                         this.client.sendClientMessage("Não foi possível encontrar o usuário: <V>"+playerName+"<BL>.")
  1040.                     else:
  1041.                         this.server.setVip(playerName, int(days) if days.isdigit() else 1)
  1042.  
  1043.             elif command == "removevip":
  1044.                 if this.client.privLevel >= 10:
  1045.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1046.                     this.requireNoSouris(playerName)
  1047.  
  1048.                     if not this.server.checkExistingUser(playerName):
  1049.                         this.client.sendClientMessage("Não foi possível encontrar o usuário: <V>"+playerName+"<BL>.")
  1050.                     else:
  1051.                         player = this.server.players.get(playerName)
  1052.                         if player != None:
  1053.                             player.privLevel = 1
  1054.                             if player.TitleNumber >= 1000:
  1055.                                 player.TitleNumber = 0
  1056.  
  1057.                             player.sendClientMessage("<CH>Você perdeu seu privilégio VIP do SeckMice :(")
  1058.                             this.Cursor.execute("update Users set VipTime = 0 where Username = ?", [playerName])
  1059.                         else:
  1060.                             this.Cursor.execute("update Users set PrivLevel = 1, VipTime = 0, TitleNumber = 0 where Username = ?", [playerName])
  1061.  
  1062.                         this.server.sendModMessage(7, "O jogador <V>"+playerName+"<BL> não é mais VIP.")
  1063.  
  1064.             elif command == "lock":
  1065.                 if this.client.privLevel >= 7:
  1066.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1067.                     this.requireNoSouris(playerName)
  1068.  
  1069.                     if not this.server.checkExistingUser(playerName):
  1070.                         this.client.sendClientMessage("Não foi possível encontrar o usuário: <V>"+playerName+"<BL>.")
  1071.                     else:
  1072.                         playerLevel = this.server.getPlayerPrivlevel(playerName)
  1073.                         if playerLevel < 4:
  1074.                             player = this.server.players.get(playerName)
  1075.                             if player != None:
  1076.                                 player.room.removeClient(player)
  1077.                                 player.transport.loseConnection()
  1078.  
  1079.                             this.Cursor.execute("update Users set PrivLevel = -1 where Username = ?", [playerName])
  1080.  
  1081.                             this.server.sendModMessage(7, "<V>"+playerName+"<BL> foi bloqueado por <V>"+this.client.Username)
  1082.  
  1083.             elif command == "unlock":
  1084.                 if this.client.privLevel >= 7:
  1085.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1086.                     this.requireNoSouris(playerName)
  1087.  
  1088.                     if not this.server.checkExistingUser(playerName):
  1089.                         this.client.sendClientMessage("Não foi possível encontrar o usuário: <V>"+playerName+"<BL>.")
  1090.                     else:
  1091.                         playerLevel = this.server.getPlayerPrivlevel(playerName)
  1092.                         if playerLevel == -1:
  1093.                             this.Cursor.execute("update Users set PrivLevel = 1 where Username = ?", [playerName])
  1094.  
  1095.                         this.server.sendModMessage(7, "<V>"+playerName+"<BL> foi desbloqueado por <V>"+this.client.Username)
  1096.  
  1097.             elif command == "log":
  1098.                 if this.client.privLevel >= 7:
  1099.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1100.                     this.requireNoSouris(playerName)
  1101.  
  1102.                     logList = []
  1103.                     this.Cursor.execute("select * from BanLog where Name = ? order by Date desc limit 0, 200", [playerName])
  1104.                     r = this.Cursor.fetchall()
  1105.                     for rs in r:
  1106.                         if rs["Status"] == "Unban":
  1107.                             logList += rs["Name"], "", rs["BannedBy"], "", "", rs["Date"].rjust(13, "0")
  1108.                         else:
  1109.                             logList += rs["Name"], rs["IP"], rs["BannedBy"], rs["Time"], rs["Reason"], rs["Date"].rjust(13, "0")
  1110.                     this.client.sendPacket(Identifiers.old.send.Log, logList)
  1111.  
  1112.             elif command == "avatar":
  1113.                 if this.client.privLevel >= 1:
  1114.             avaid = this.client.TFMUtils.parsePlayerName(args[0])
  1115.             if avaid.isdigit():
  1116.                     avaid = int(avaid)
  1117.                     if this.client.playerAvatar != avaid:
  1118.                         if avaid >= 99999999:
  1119.                                 this.client.sendMessage('<J>•<N> Parâmetros inválidos!')
  1120.                         else:
  1121.                                 this.Cursor.execute('UPDATE users SET avatar = ? WHERE Username = ?', [avaid, this.client.Username])
  1122.                             this.client.playerAvatar = avaid
  1123.                             this.client.sendMessage("<J>•<N> Avatar selecionado com sucesso: [<J>%r<N>]." % (avaid))                         
  1124.                     else:
  1125.                                                 this.client.sendMessage("<J>•<N> Você já está usando o avatar: <J>[<J>%s<N>]" % (str(avaid)))    
  1126.  
  1127.             elif command == "move":
  1128.                 if this.client.privLevel >= 8:
  1129.                     roomName = args[0]
  1130.                     for player in this.client.room.clients.values():
  1131.                         player.enterRoom(roomName)
  1132.  
  1133.             elif command == "nomip":
  1134.                 if this.client.privLevel >= 10 or this.client.Username == "Azin":
  1135.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1136.                     ipList = "Lista de IPs do jogador: "+playerName
  1137.                     this.Cursor.execute("select IP from LoginLog where Username = ?", [playerName])
  1138.                     r = this.Cursor.fetchall()
  1139.                     for rs in r:
  1140.                         ipList += "<br>" + rs["IP"]
  1141.  
  1142.                     this.client.sendClientMessage(ipList)
  1143.  
  1144.             elif command == "ipnom":
  1145.                 if this.client.privLevel >= 7:
  1146.                     ip = args[0]
  1147.                     nameList = "Lista de jogadores usando o IP: "+ip
  1148.                     historyList = "Histórico do IP:"
  1149.                     for player in this.server.players.values():
  1150.                         if player.ipAddress == ip:
  1151.                             nameList += "<br>" + player.Username
  1152.  
  1153.                     this.Cursor.execute("select Username from LoginLog where IP = ?", [ip])
  1154.                     r = this.Cursor.fetchall()
  1155.                     for rs in r:
  1156.                         historyList += "<br>" + rs["Username"]
  1157.  
  1158.                     this.client.sendClientMessage(nameList)
  1159.                     this.client.sendClientMessage(historyList)
  1160.  
  1161.             elif command == "lsmaps":
  1162.                 if this.client.privLevel >= 6:
  1163.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1164.                     result = ""
  1165.                     mapList = ""
  1166.                     mapCount = 0
  1167.  
  1168.                     this.Cursor.execute("select * from MapEditor where Name = ?", [playerName])
  1169.                     r = this.Cursor.fetchall()
  1170.                     for rs in r:
  1171.                         mapCount += 1
  1172.                         yesVotes = rs["YesVotes"]
  1173.                         noVotes = rs["NoVotes"]
  1174.                         totalVotes = yesVotes + noVotes
  1175.                         if totalVotes < 1: totalVotes = 1
  1176.                         Rating = (1.0 * yesVotes / totalVotes) * 100
  1177.                         rate = str(Rating).split(".")[0]
  1178.                         if rate == "Nan": rate = "0"
  1179.                         mapList += "<br><N>"+playerName+" - @"+str(rs["Code"])+" - "+str(totalVotes)+" - "+str(rate)+"% - P"+str(rs["Perma"])
  1180.  
  1181.                     if len(mapList) != 0:
  1182.                         result = str(mapList)
  1183.  
  1184.                     try: this.client.sendLogMessage("<font size= \"12\"><V>"+playerName+"<N>'s maps: <BV>"+str(mapCount)+ str(result)+"</font>")
  1185.                     except: pass
  1186.  
  1187.             elif command in ["giveforall"]:
  1188.                 if this.client.privLevel >= 10:
  1189.                     this.requireArgs(2)
  1190.                     type = args[0].lower()
  1191.                     count = int(args[1]) if args[1].isdigit() else 0
  1192.                     count = 10000 if count > 10000 else count
  1193.                     typeName = "queijos" if type.startswith("queijo") or type.startswith("cheese") else "fraises" if type.startswith("morango") or type.startswith("fraise") else "bootcamps" if type.startswith("bc") or type.startswith("bootcamp") else "firsts" if type.startswith("first") else "moedas" if type.startswith("moeda") or type.startswith("coin") else "fichas" if type.startswith("ficha") or type.startswith("tokens") else "saves" if type.startswith("saves") or type.startswith("save") else ""
  1194.                     if count > 0 and not typeName == "":
  1195.                         this.server.sendModMessage(7, "<V>"+this.client.Username+"<BL> deu <V>"+str(count)+" "+str(typeName)+"<BL> para todo o Servidor")
  1196.                         for player in this.server.players.values():
  1197.                             player.sendClientMessage("Você recebeu <V>"+str(count)+" "+str(typeName)+"<BL> do SeuMice Servidor.")
  1198.                             aq=open("./Mice/Comandos/giveforall.log","a"); aq.write(""+this.client.Username+" doou "+str(count)+" "+str(typeName)+" para todo o servidor\n")
  1199.                             if typeName == "queijos":
  1200.                                 player.cheeseCount += count                
  1201.                                 player.shopCheeses += count
  1202.                             if typeName == "fraises":
  1203.                                 player.shopFraises += count
  1204.                             if typeName == "bootcamps":
  1205.                                 player.bootcampCount += count
  1206.                             if typeName == "firsts":
  1207.                                 player.firstCount += count
  1208.                             if typeName == "moedas":
  1209.                                 player.iceCoins += count
  1210.                             if typeName == "saves":
  1211.                                 player.shamanSaves += count
  1212.  
  1213.             elif command in ["give"]:
  1214.                 if this.client.privLevel >= 10:
  1215.                     this.requireArgs(3)
  1216.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1217.                     type = args[1].lower()
  1218.                     count = int(args[2]) if args[2].isdigit() else 0
  1219.                     count = 10000 if count > 10000 else count
  1220.                     this.requireNoSouris(playerName)
  1221.                     typeName = "queijos" if type.startswith("queijo") or type.startswith("cheese") else "fraises" if type.startswith("morango") or type.startswith("fraise") else "bootcamps" if type.startswith("bc") or type.startswith("bootcamp") else "firsts" if type.startswith("first") else "moedas" if type.startswith("moeda") or type.startswith("coin") else "fichas" if type.startswith("ficha") or type.startswith("tokens") else "saves" if type.startswith("saves") or type.startswith("save") else ""
  1222.                     if count > 0 and not typeName == "":
  1223.                         player = this.server.players.get(playerName)
  1224.                         if player != None:
  1225.                             this.server.sendModMessage(7, "<V>"+this.client.Username+"<BL> doou <V>"+str(count)+" "+str(typeName)+"<BL> para <V>"+playerName+"<BL>.")
  1226.                             player.sendClientMessage("Você recebeu <V>"+str(count)+" "+str(typeName)+"<BL>.")
  1227.                             aq=open("./Mice/Comandos/give.log","a"); aq.write(""+this.client.Username+" doou "+str(count)+" "+str(typeName)+" a "+playerName+"\n")
  1228.                             if typeName == "queijos":
  1229.                                 player.cheeseCount += count                        
  1230.                                 player.shopCheeses += count
  1231.                             if typeName == "fraises":
  1232.                                 player.shopFraises += count
  1233.                             if typeName == "bootcamps":
  1234.                                 player.bootcampCount += count
  1235.                             if typeName == "firsts":
  1236.                                 player.firstCount += count
  1237.                             if typeName == "moedas":
  1238.                                 player.iceCoins += count
  1239.                             if typeName == "saves":
  1240.                                 player.shamanSaves += count
  1241.                            
  1242.             elif command == "unrank":
  1243.                 if this.client.privLevel >= 10:
  1244.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1245.                     if not this.server.checkExistingUser(playerName):
  1246.                         this.client.sendClientMessage("Não foi possível encontrar o usuário: <V>"+playerName+"<BL>.")
  1247.                     else:
  1248.                         player = this.server.players.get(playerName)
  1249.                         if player != None:
  1250.                             player.room.removeClient(player)
  1251.                             player.transport.loseConnection()
  1252.  
  1253.                         this.Cursor.execute("update Users set iceCoins = 0, FirstCount = 0, CheeseCount = 0, ShamanSaves = 0, HardModeSaves = 0, DivineModeSaves = 0, BootcampCount = 0, ShamanCheeses = 0 where Username = ?", [playerName])
  1254.  
  1255.                         this.server.sendModMessage(7, "<V>"+playerName+"<BL> foi retirado do ranking por <V>"+this.client.Username+"<BL>.")
  1256.  
  1257.             elif command == "warn":
  1258.                 if this.client.privLevel >= 7:
  1259.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1260.                     message = argsNotSplited.split(" ", 1)[1]
  1261.  
  1262.                     if not this.server.checkExistingUser(playerName):
  1263.                         this.client.sendClientMessage("Não foi possível encontrar o usuário: <V>"+playerName+"<BL>.")
  1264.                     else:
  1265.                         rank = "Helper" 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 "Coordenador" if this.client.privLevel == 9 else "Administrador" if this.client.privLevel >= 10 else ""
  1266.                         player = this.server.players.get(playerName)
  1267.                         if player != None:
  1268.                             player.sendClientMessage("<ROSE>[<b>ALERTA</b>] O "+str(rank)+" "+this.client.Username+" lhe enviou um alerta. Motivo: "+str(message))
  1269.                             this.client.sendClientMessage("<BL>Seu alerta foi enviado com sucesso para <V>"+playerName+"<BL>.")
  1270.                             this.server.sendModMessage(7, "<V>"+this.client.Username+"<BL> mandou um alerta para"+"<V> "+playerName+"<BL>. Motivo: <V>"+str(message))
  1271.                            
  1272.             elif command in ["changenick", "trocarnome", "cambiarnombre"]:
  1273.                 if this.client.privLevel >= 10:
  1274.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1275.                     player = this.server.players.get(playerName)
  1276.                     if player != None:
  1277.                         player.mouseName = playerName if args[1] == "off" else argsNotSplited.split(" ", 1)[1]
  1278.                         this.server.sendModMessage(10, "<V>"+this.client.Username+"<BL> cambio el nickname de"+"<V> "+playerName+"")
  1279.    
  1280.             elif command in ["moveplayer"]:
  1281.                 if this.client.privLevel >= 8:
  1282.                     this.requireArgs(2)
  1283.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1284.                     roomName = argsNotSplited.split(" ", 1)[1]
  1285.                     player = this.server.players.get(playerName)
  1286.                     if player != None:
  1287.                         player.enterRoom(roomName) 
  1288.    
  1289.             elif command == "size":
  1290.                 if this.client.privLevel in [10, 11]:
  1291.                     this.requireArgs(2)
  1292.                     playerName = this.client.TFMUtils.parsePlayerName(args[0])
  1293.                     if args[1].isdigit():
  1294.                         size = int(args[1])
  1295.                         if playerName == "*":
  1296.                             for player in this.client.room.clients.values():
  1297.                                 this.client.room.sendAllBin(Identifiers.send.Mouse_Size, ByteArray().writeInt(this.client.playerCode).writeShort(size).writeBool(False).toByteArray())
  1298.                         else:
  1299.                             player = this.server.players.get(playerName)
  1300.                             if player != None:
  1301.                                 this.client.room.sendAllBin(Identifiers.send.Mouse_Size, ByteArray().writeInt(this.client.playerCode).writeShort(size).writeBool(False).toByteArray())
  1302.                                 this.server.sendModMessage(11, "<V>"+this.client.Username+"<BL> uso el comando size")                  
  1303.                                                
  1304. class UserWarning(Exception):
  1305.     pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement