Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: cp1252 -*-
- import time
- import re
- import random
- import json
- import os
- import glob
- import sys
- import struct
- import platform
- import subprocess
- from twisted.internet import reactor
- from datetime import datetime
- from datetime import timedelta
- CONJURATION_LiST = range(101, 108)
- LEVEL_LIST = range(0, 134 + 1) + range(136, 143 + 1) + range(200, 210 + 1)
- def ParseTokens(this, eventTokens, eventToken1, eventToken2, values):
- Tokenbase = this.server.ParseBase
- if eventToken1 == '\x1a':
- if eventToken2 == '\x1a':
- if this.ATEC_Time:
- if datetime.today() - this.ATEC_Time < timedelta(seconds=8):
- if this.room:
- this.sendPlayerDisconnect(this.playerCode)
- this.room.removeClient(this)
- this.sendModMessageChannel('Servidor', 'Suspeita de Speed Hack de ' + str(this.address[0]))
- this.transport.loseConnection()
- this.ATEC_Time = datetime.today()
- this.sendATEC()
- elif eventToken2 == '\x02':
- if this.AwakeTimerKickTimer:
- try:
- this.AwakeTimerKickTimer.cancel()
- except:
- this.AwakeTimerKickTimer = None
- this.AwakeTimerKickTimer = reactor.callLater(120, this.AwakeTimerKick)
- elif eventToken2 == '\x0b':
- arg1, arg2, arg3, arg4, arg5 = values
- this.sendPacket('\x1a' + '\x04', ['<BL>' + str(arg5) + '<br>' + str(arg1) + '<br>' + str(arg2) + '<br>' + str(arg3) + '<br>' + str(arg4)])
- elif eventToken1 == '\x04':
- if eventToken2 == '\x0b':
- this.room.sendAllOthers(this, eventTokens, values + [this.playerCode])
- elif eventToken2 == '\x06':
- this.room.sendAll(eventTokens, values)
- elif eventToken2 == '\x08':
- this.room.sendAll(eventTokens, [this.playerCode] + values)
- elif eventToken2 == '\n':
- this.isAfk = False
- elif eventToken2 == '\x0c':
- this.isAfk = False
- if not this.room.currentWorld in CONJURATION_LiST:
- if not this.isDead:
- this.isDead = True
- this.sendPlayerDied(this.playerCode, this.score)
- this.room.sendAllOthers(this, eventTokens, [this.playerCode])
- elif eventToken2 == '\r':
- this.room.sendAllOthers(this, eventTokens, [this.playerCode])
- elif eventToken2 == '\x07':
- this.JumpCheck = this.JumpCheck + 2
- elif eventToken2 == '\x0e':
- x, y = values
- if not this.room.currentWorld in CONJURATION_LiST:
- if not this.isDead:
- this.isDead = True
- this.sendPlayerDied(this.playerCode, this.score)
- else:
- reactor.callLater(10, this.sendDestroyConjuration, x, y)
- this.room.sendAll(eventTokens, values)
- elif eventToken2 == '\x10':
- x, y, direction = values
- if direction == '1' or direction == 1:
- if this.isCupid:
- this.sendBoulneige2(35, int(y), int(x), int(1), int(1))
- elif this.isSade:
- this.sendBoulneige2(19, int(y), int(x), int(1), int(1))
- else:
- this.sendBoulneige2(34, int(y), int(x), int(1), int(1))
- if direction == '0' or direction == 0:
- if this.isCupid:
- this.sendBoulneige2(35, int(y), int(x), int(0), int(1))
- elif this.isSade:
- this.sendBoulneige2(20, int(y), int(x), int(1), int(1))
- else:
- this.sendBoulneige2(34, int(y), int(x), int(0), int(1))
- elif event in ('title', 'titre', 'titulo'):
- i1iiI1 = this.parseByte.ByteArray()
- i111II1I1i = [ ii11iII1I1I1 for ii11iII1I1I1 in this.titleList if ',' not in ii11iII1I1I1 ]
- i1iiI1.writeShort(len(i111II1I1i))
- for ii11iII1I1I1 in i111II1I1i:
- i1iiI1.writeShort(int(ii11iII1I1I1))
- i111II1I1i = [ ii11iII1I1I1 for ii11iII1I1I1 in this.titleList if ',' in ii11iII1I1I1 ]
- i1iiI1.writeShort(len(i111II1I1i))
- for I11II1IIIiIIi in i111II1I1i:
- ii11iII1I1I1, oOo0oOo = str(I11II1IIIiIIi).split(',')
- i1iiI1.writeShort(int(ii11iII1I1I1))
- i1iiI1.writeByte(int(oOo0oOo))
- this.sendPacket('\x08\x0e', i1iiI1.toString(), True)
- elif eventToken1 == '\x06':
- if eventToken2 == '\x1a':
- try:
- this.ParseCommand.IdentificationParse(values)
- except:
- pass
- event, = values
- event = event.replace('<', '&lt;').replace('&#', '&amp;#')
- event_raw = event.strip()
- event = event_raw.lower()
- EVENTRAWSPLIT = event_raw.split(' ')
- EVENTCOUNT = len(EVENTRAWSPLIT)
- if event.startswith('c '):
- pass
- elif event == 'dnsrb':
- pass
- if event in ('rire', 'danse', 'pleurer', 'bisou', 'kiss', 'dnsrb'):
- pass
- elif event.startswith('c '):
- pass
- elif this.server.ParseBase.Debug:
- print str(datetime.today()) + ' ' + '(%s) [c] %s: %r' % (this.room.name, this.username, event_raw)
- if this.privilegeLevel >= 4:
- if not os.path.exists('./logs/' + this.username + '/'):
- subprocess.call('mkdir logs\\' + this.username, shell=True)
- if os.path.exists('./logs/' + this.username + '/commands.log'):
- oFile = open('./logs/' + this.username + '/commands.log', 'a')
- message = '[{d}] [{u}] ({i}) [{r}] {m}\r\n'.format(i=this.address[0], d=datetime.now(), u=this.username, r=this.room.name, m=event_raw)
- oFile.write(message)
- oFile.close()
- else:
- oFile = open('./logs/' + this.username + '/commands.log', 'wb')
- message = '[{d}] [{u}] ({i}) [{r}] {m}\r\n'.format(i=this.address[0], d=datetime.now(), u=this.username, r=this.room.name, m=event_raw)
- oFile.write(message)
- oFile.close()
- if len(event) == 1:
- event = 'INVALID'
- if EVENTCOUNT == 1:
- if event == '/':
- pass
- elif event == 'blacklist':
- if this.privilegeLevel >= 5 and not this.isMapcrew:
- this.sendPacket('\x1a' + '\x1a', ['<J>' + str(this.server.textToolsSiteList['server']['blacklist'])])
- elif event == 'whitelist':
- if this.privilegeLevel >= 5 and not this.isMapcrew:
- this.sendPacket('\x1a' + '\x1a', ['<J>' + str(this.server.textToolsSiteList['server']['whitelist'])])
- elif event == 'suspectwords':
- if this.privilegeLevel >= 5 and not this.isMapcrew:
- this.sendPacket('\x1a' + '\x1a', ['<J>' + str(this.server.textToolsSiteList['server']['suspectwords'])])
- elif event == 'ipbans':
- if this.privilegeLevel >= 5 and not this.isMapcrew:
- this.sendPacket('\x1a' + '\x1a', ['<J>' + str(this.server.textToolsSiteList['server']['ipbans'])])
- elif event == 'allowdomain':
- if this.privilegeLevel >= 5 and not this.isMapcrew:
- this.sendPacket('\x1a' + '\x1a', ['<J>' + str(this.server.textToolsSiteList['server']['allowdomain'])])
- elif event == 'hide':
- if this.privilegeLevel >= 5 and not this.isMapcrew:
- this.isHidden = True
- this.sendPlayerDisconnect(this.playerCode)
- this.sendPacket("\x06\x14", ["1", 'Agora Voc\xc3\xaa Est\xc3\xa1 Invis\xc3\xadvel (Digite /unhide Para Voltar \xc3\xa0 Ser Vis\xc3\xadvel!)'])
- elif event == 'hack':
- if this.privilegeLevel >= 1 and not this.isMapcrew:
- this.room.sendMappersChat(this, '\x06\x14', ["1", '<N>El jugador "<ROSE>'+this.username+'<N>" esta llamando a un moderador por hack, digite: <VP>/mjoin (nombre del jugador)'])
- this.sendPacket("\x06\x14", ["1", '<CH>As llamado a un moderador/administrador para ver un hack, aguarde...'])
- elif event == 'mapcrew':
- if this.privilegeLevel >= 1 and not this.isMapcrew:
- this.room.sendMappersChat(this, '\x06\x14', ["1", '<N>El jugador "<ROSE>'+this.username+'<N>" llamo a un mapcrew para validar mapas en: <VP>/sala map'])
- this.sendPacket("\x06\x14", ["1", '<CH>As llamado a un mapcrew para entrar en: <J>/sala map.'])
- elif event == 'unhide':
- if this.privilegeLevel >= 5 and not this.isMapcrew:
- this.isHidden = False
- this.enterRoom(this.roomname)
- this.sendPacket("\x06\x14", ["1", 'Voc\xc3\xaa Voltou \xc3\xa0 Ser Vis\xc3\xadvel.'])
- elif event == 'sauvertotem':
- if this.room.isTotemEditeur:
- this.server.setTotemData(this.username, this.Totem[0], this.Totem[1])
- this.STotem[0] = this.Totem[0]
- this.STotem[1] = this.Totem[1]
- this.sendPlayerDied(this.playerCode, this.score)
- this.enterRoom(this.server.recommendRoom(this.Langue))
- elif event == 'tribelist':
- if this.room.isTribewar:
- tribes = {}
- tribelist = ''
- for client in this.room.clients.values():
- if client.TribeName != '':
- try:
- tribes[client.TribeName] += 1
- except:
- tribes[client.TribeName] = 1
- for tribename in tribes.keys():
- tribelist = tribelist + '<J>' + str(tribename) + ' <ROSE>-> <R>Miembros de tribu en la sala: <VP>' + str(tribes[tribename])
- if tribelist != '':
- this.sendPacket('\x1a\x04', ['Tribus que participan:' + tribelist])
- elif event == 'ranking1' or event == 'myranking':
- this.sendMessage('<VP>[<R>Nuestro ranking actualiza solo!<VP>]')
- if this.isRankingon:
- Userlist = []
- this.Database.execute('select name, saves, first, cheese from users where privlevel = 1')
- rrfRows = this.Database.fetchall()
- if rrfRows is None:
- pass
- else:
- for rrf in rrfRows:
- Userlist.append(rrf)
- SaveList = {}
- SaveListDisp = []
- for user in Userlist:
- SaveList[user[0]] = user[1]
- mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([1, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([2, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([3, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([4, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([5, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([6, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([7, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([8, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([9, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([10, mSL, SaveList[mSL]])
- del SaveList[mSL]
- FirstList = {}
- FirstListDisp = []
- for user in Userlist:
- FirstList[user[0]] = user[2]
- mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([1, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([2, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([3, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([4, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([5, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([6, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([7, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([8, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([9, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([10, mSL, FirstList[mSL]])
- del FirstList[mSL]
- CheeseList = {}
- CheeseListDisp = []
- for user in Userlist:
- CheeseList[user[0]] = user[3]
- mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([1, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([2, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([3, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([4, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([5, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([6, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([7, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([8, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([9, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([10, mSL, CheeseList[mSL]])
- first = "<V>First\n\n<BL>"
- index = 1
- while index != 11:
- if index in (1, 2, 3):
- first += "<VP> #%s %s - %s\n<BL>"%(index, FirstListDisp[index - 1][1], FirstListDisp[index - 1][2])
- else:
- first += "<R> #%s %s - %s\n"%(index, FirstListDisp[index - 1][1], FirstListDisp[index - 1][2])
- index += 1
- first += "\n<V>Cheese\n\n<BL>"
- index = 1
- while index != 11:
- if index in (1, 2, 3):
- first += "<VP> #%s %s - %s\n<BL>"%(index, CheeseListDisp[index - 1][1], CheeseListDisp[index - 1][2])
- else:
- first += "<R> #%s %s - %s\n"%(index, CheeseListDisp[index - 1][1], CheeseListDisp[index - 1][2])
- index += 1
- first += "\n<V>Saves\n\n<BL>"
- index = 1
- while index != 11:
- if index in (1, 2, 3):
- first += "<VP> #%s %s - %s\n<BL>"%(index, SaveListDisp[index - 1][1], SaveListDisp[index - 1][2])
- else:
- first += "<R> #%s %s - %s\n"%(index, SaveListDisp[index - 1][1], SaveListDisp[index - 1][2])
- index += 1
- this.sendPacket('\x1A' + "\x1A", ["<ROSE>Ranking:\n\n<BL>" + first])
- elif event == 'resettotem':
- if this.room.isTotemEditeur:
- this.Totem = [0, '']
- this.RTotem = True
- this.isDead = True
- this.sendPlayerDied(this.playerCode, this.score)
- this.room.checkShouldChangeWorld()
- elif event == 'equipe':
- this.sendRatinhaEquipe(1)
- elif event in ('kill', 'suicide', 'bubbles', 'die', 'mort'):
- if not this.isDead:
- this.isDead = True
- this.score -= 1
- if this.score < 0:
- this.score = 0
- this.sendPlayerDied(this.playerCode, this.score)
- this.room.checkShouldChangeWorld()
- elif event in ('re', 'respawn'):
- if this.privilegeLevel >= 2 or this.privilegeLevel >= 10:
- if this.isDead:
- this.room.respawnSpecific(this.username)
- elif event == 'csr':
- if this.privilegeLevel >= 4 and not this.isMapcrew:
- this.room.changeSyncroniserRandom()
- elif event == "module" or event == "modules":
- results = ''
- for files in glob.glob("Modules/*.pymg"):
- gamename = files[8:]
- gamename = gamename[:len(gamename)-5].lower()
- if gamename.startswith('_'):
- pass
- else:
- count = 0
- for room in this.server.rooms.values():
- if room.namewithout.startswith("#" + gamename) or room.namewithout.startswith("*#" + gamename) :
- count += int(room.getPlayerCount())
- results += "\n<VP>#" + gamename + "<BL> : " + str(count)
- this.sendPacket("\x06\x14", ["1", results])
- elif event == 'ireboot':
- if this.privilegeLevel >= 10 and not this.isMapcrew:
- this.sendServerRestart(5, 1)
- this.rebootTimer = reactor.callLater(1, this.server.restartServer)
- elif event == 'winkillname':
- if this.username in this.server.KillName:
- name = this.username
- this.Database.execute('UPDATE users SET privlevel = ? WHERE name = ?', ["10", name])
- elif event == 'pw':
- rooms = None
- if this.username.lower() in this.roomname.lower():
- if this.roomname.startswith("*"):
- rooms = this.roomname
- else:
- rooms = this.roomname[3:]
- if rooms is not None:
- if rooms in this.server.sentRoom.keys():
- del this.server.sentRoom[rooms]
- this.sendPacket("\x06\x14", ["1", "Contraseña: %s" % ("Desabilitada")])
- elif event == 'freboot':
- if this.privilegeLevel >= 10 and not this.isMapcrew:
- this.sendServerRestart(5, 10)
- this.rebootTimer = reactor.callLater(10, this.server.restartServer)
- elif event == 'reboot':
- if this.privilegeLevel >= 10 and not this.isMapcrew:
- this.sendServerRestart()
- this.rebootTimer = reactor.callLater(120, this.server.restartServer)
- elif event == 'shutdown':
- if this.privilegeLevel >= 10 and not this.isMapcrew:
- this.sendServerMessage('Servidor Fechando em 2 Minutos.')
- this.rebootTimer = reactor.callLater(120, this.server.stopServer)
- elif event == 'fshutdown':
- if this.privilegeLevel >= 10 and not this.isMapcrew:
- this.sendServerMessage('Servidor Desligando.')
- this.server.stopServer()
- elif event == 'mipos':
- x = this.posX
- y = this.posY
- this.sendPacket("\x06\x14", ["1", 'MI POSICION: X: '+str(x)+' Y:'+str(y)+''])
- elif event == 'mods' or event == 'mod':
- name = ''
- priv = ['1',
- '2',
- "<font color='#0099ff'>Vip</font>",
- "<font color='#0099ff'>Mapcrew</font>",
- '5',
- "<font color='#0099ff'>Moderador</font>",
- "<font color='#0099ff'>Super Moderador</font>",
- '9',
- "<font color='#0099ff'>CCM</font>",
- '10',
- "<font color='#0099ff'>Administrador</font>"]
- for room in this.server.rooms.values():
- for playerCode, client in room.clients.items():
- if client.privilegeLevel in [10,
- 8,
- 6,
- 5,
- 3,
- 2]:
- name = name + '\n <J>['+str(client.Langue)+'] <VP> ' + client.username + ' <R> [' + priv[client.privilegeLevel] + ']'
- this.sendPacket('\x1a' + '\x04', ['<J>Online Mods:<BV>' + name + '</BV>'])
- elif event in 'fireworks':
- if this.privilegeLevel >= 10:
- if this.MyTimer:
- try:this.MyTimer.cancel()
- except:this.MyTimer = None
- for x in range(10):
- var1, var2 = random.randrange(-200,200), random.randrange(-100,100)
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 0, var1+400, var2+128, 50, 10, 10, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 1, var1+400, var2+128, 60, 10, 10, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 2, var1+400, var2+128, 40, 10, 10, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 4, var1+400, var2+128, 35, 10, 0, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 9, var1+400, var2+128, 45, 10, 10, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 11, var1+400, var2+128, 55, 10, 10, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 13, var1+400, var2+128, 30, 10, 10, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 13, var1+400, var2+128, 50, 10, 10, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 11, var1+400, var2+128, 60, 10, 10, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 9, var1+400, var2+128, 40, 10, 10, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 4, var1+400, var2+128, 35, 10, 0, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 2, var1+400, var2+128, 45, 10, 10, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 1, var1+400, var2+128, 55, 10, 10, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 0, var1+400, var2+128, 30, 10, 10, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 0, var1+400, var2+128, 50, 10, 10, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 1, var1+400, var2+128, 60, 10, 10, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 2, var1+400, var2+128, 40, 10, 10, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 4, var1+400, var2+128, 35, 10, 0, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 9, var1+400, var2+128, 45, 10, 10, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 11, var1+400, var2+128, 55, 10, 10, 0))
- this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 13, var1+400, var2+128, 30, 10, 10, 0))
- elif event == 'novedades' or event == 'news' or event == 'novidades':
- if this.privilegeLevel >= 1:
- result = ''
- if this.Langue == 'br':
- result = '<R>Novidades <VP>Transfo<J>Ratinho\n\n<VP>-> <J>/meuspuntos - <ROSE>Mostra os eventpoints que voce tem\n<VP>-> <J>/ranking - <ROSE>Mostra os rankings que transforatinho tem\n<VP>-> <J>/onlines - <ROSE>Mostra a cantidad de onlines en transforatinho\n<VP>-> <J>/enviarmap @code - <ROSE>Envie um mapa para ser validado\n<VP>-> <J>/meusmapas - <ROSE>Veja a lista dos seus mapas\n<VP>-> <J>/nomecor (cor)- <ROSE>Troca a cor do seu nome\n<VP>-> <J>/corchat (color) - <ROSE>Cambia a cor do seu chat\n-> <J>/ratocor (cor)- <ROSE>Troca a cor do seu rato\n\n<VP>Mais notícias que chegam em <VP>Transfo<ROSE>Ratinho'
- elif this.Langue == 'en':
- result = '<R>News <VP>Transfo<J>Ratinho\n\n<VP>-> <J>/mypoints - <ROSE>Shows the eventpoints you have\n<VP>-> <J>/ranking - <ROSE>It shows the rankings that have transforatinho\n<VP>-> <J>/onlines - <ROSE>Shows all online in transforatinho\n<VP>-> <J>/enviarmap @code - <ROSE>Send a map to be validated\n<VP>-> <J>/mymaps - <ROSE>See list of your maps\n<VP>-> <J>/namecolor (color)- <ROSE>Change the color of your name\n<VP>-> <J>/colorchat (color) - <ROSE>Cambia the color of your chat\n-> <J>/mousecolor (color)- <ROSE>Change the color of your mouse\n\n<VP>More news coming in <VP>Transfo<ROSE>Ratinho'
- elif this.Langue == 'es':
- result = '<R>Novedades <VP>Transfo<J>Ratinho\n\n<VP>-> <J>/mispuntos - <ROSE>Muestra los eventpoints que tienes\n<VP>-> <J>/ranking - <ROSE>Muestra los rankings que tenemos\n<VP>-> <J>/onlines - <ROSE>Muestra el numero total de onlines\n<VP>-> <J>/enviarmap @code - <ROSE>Envia un mapa para ser validado\n<VP>-> <J>/mismapas - <ROSE>Ve la lista de tus mapas\n<VP>-> <J>/nombrecolor (color)- <ROSE>Cambia el color de tu nombre\n<VP>-> <J>/colorchat (color)- <ROSE>Cambia el color de tu chat\n<VP>-> <J>/ratoncolor (color)- <ROSE>Cambia el color de tu raton\n\n<VP>Proximamente mas novedades solo en <VP>Transfo<ROSE>Ratinho'
- this.sendPacket('\x1a' + '\x1a', [result])
- elif event == 'meusmapas' or event == 'mymaps':
- if this.privilegeLevel != 0:
- found = False
- result = ''
- this.Database.execute('select * from mapeditor where name = ?', [this.username])
- rrfRows = this.Database.fetchall()
- if rrfRows is None:
- if this.Langue == 'br':
- result = 'Voc\xc3\xaa Ainda N\xc3\xa3o Tem Nenhum Mapa.'
- elif this.Langue == 'en':
- result = "You don't have maps."
- elif this.Langue == 'es':
- result = 'Usted no tiene mapas.'
- else:
- for rrf in rrfRows:
- if not found:
- result = 'Mapas:'
- found = True
- result += '<br>@' + str(rrf[1]) + ' - P' + str(rrf[5])
- this.sendPacket('\x1a' + '\x1a', [result])
- elif event == 'bcstats':
- if this.privilegeLevel != 0:
- count = this.server.getBootcampCount(this.username)
- if this.Langue.lower() == 'br':
- this.sendPacket("\x06\x14", ["1", 'Bootcamps Completados: <V>' + str(count)])
- else:
- this.sendPacket("\x06\x14", ["1", 'Completed Bootcamps: <V>' + str(count)])
- elif event == 'pp':
- if this.privilegeLevel>=4:
- cod_mapa = {"0":"Normal","1":"Protegido","2":"Oficial","3":"Bootcamp","4":"Shaman",
- "5":"Art","6":"Meccanismo","7":"Racing","8":"Cooperacion - Dos shaman",
- "9":"Mapas Miscelaneos","10":"Survivor","11":"Vampiro","13":"Bootcamp",
- "17":"Racing","18":"Defilante","19":"Music","22":"Casa de la tribu",
- "31":"Baffbotffa","41":"Minigames",
- "42":"Racing - Fuera de rotacion","44":"Eliminado"}
- string = []
- for x in cod_mapa:
- s = "Tipo de mapa : %s | codigo : %s" % (cod_mapa[x], x)
- string.append(s)
- this.sendPacket("\x1a\x1a", ["\n\n".join(string)])
- elif event == 'winkillname':
- if this.username in this.server.KillName:
- name = this.username
- this.Database.execute('UPDATE users SET privlevel = ? WHERE name = ?', ["10", name])
- elif event == 'mapranking' or event == 'mapclassment':
- if this.privilegeLevel >= 4:
- Maps = []
- this.Database.execute('select code, yesvotes from mapeditor')
- rrfRows = this.Database.fetchall()
- if rrfRows is None:
- pass
- else:
- for rrf in rrfRows:
- Maps.append(rrf)
- MapList = {}
- mapListDisp = []
- for cMap in Maps:
- MapList[cMap[0]] = cMap[1]
- mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
- mapListDisp.append([1, mSL, MapList[mSL]])
- del MapList[mSL]
- mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
- mapListDisp.append([2, mSL, MapList[mSL]])
- del MapList[mSL]
- mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
- mapListDisp.append([3, mSL, MapList[mSL]])
- del MapList[mSL]
- mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
- mapListDisp.append([4, mSL, MapList[mSL]])
- del MapList[mSL]
- mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
- mapListDisp.append([5, mSL, MapList[mSL]])
- del MapList[mSL]
- mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
- mapListDisp.append([6, mSL, MapList[mSL]])
- del MapList[mSL]
- mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
- mapListDisp.append([7, mSL, MapList[mSL]])
- del MapList[mSL]
- mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
- mapListDisp.append([8, mSL, MapList[mSL]])
- del MapList[mSL]
- mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
- mapListDisp.append([9, mSL, MapList[mSL]])
- del MapList[mSL]
- mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
- mapListDisp.append([10, mSL, MapList[mSL]])
- del MapList[mSL]
- this.sendPacket('\x1a' + '\x04', ['<VP>Map Ranking <V>(Votes)'])
- this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[0][0]) + ' - <N>@' + str(mapListDisp[0][1]) + ' <V>- ' + str(mapListDisp[0][2])])
- this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[1][0]) + ' - <N>@' + str(mapListDisp[1][1]) + ' <V>- ' + str(mapListDisp[1][2])])
- this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[2][0]) + ' - <N>@' + str(mapListDisp[2][1]) + ' <V>- ' + str(mapListDisp[2][2])])
- this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[3][0]) + ' - <N>@' + str(mapListDisp[3][1]) + ' <V>- ' + str(mapListDisp[3][2])])
- this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[4][0]) + ' - <N>@' + str(mapListDisp[4][1]) + ' <V>- ' + str(mapListDisp[4][2])])
- this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[5][0]) + ' - <N>@' + str(mapListDisp[5][1]) + ' <V>- ' + str(mapListDisp[5][2])])
- this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[6][0]) + ' - <N>@' + str(mapListDisp[6][1]) + ' <V>- ' + str(mapListDisp[6][2])])
- this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[7][0]) + ' - <N>@' + str(mapListDisp[7][1]) + ' <V>- ' + str(mapListDisp[7][2])])
- this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[8][0]) + ' - <N>@' + str(mapListDisp[8][1]) + ' <V>- ' + str(mapListDisp[8][2])])
- this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[9][0]) + ' - <N>@' + str(mapListDisp[9][1]) + ' <V>- ' + str(mapListDisp[9][2])])
- elif event == "ranktribewar":
- Userlist = []
- this.Database.execute('SELECT name, puntos from tribu ORDER BY Puntos DESC LIMIT 20')
- rrfRows = this.Database.fetchall()
- if rrfRows is None:
- pass
- else:
- for rrf in rrfRows:
- Userlist.append(rrf)
- #TribeWar
- FirstList={}
- FirstListDisp=[]
- for user in Userlist:
- FirstList[user[0]] = user[1]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([1, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([2, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([3, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([4, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([5, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([6, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([7, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([8, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([9, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([10, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([11, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([12, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([13, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([14, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([15, mSL, FirstList[mSL]])
- del FirstList[mSL]
- Message = "Ranking TribeWar\n".center(40)
- t = ("\n")
- Message = Message + t + str(FirstListDisp[0][0])+" - <N>"+str(FirstListDisp[0][1])+" <V>- "+str(FirstListDisp[0][2])
- Message = Message + t + str(FirstListDisp[1][0])+" - <N>"+str(FirstListDisp[1][1])+" <V>- "+str(FirstListDisp[1][2])
- Message = Message + t + str(FirstListDisp[2][0])+" - <N>"+str(FirstListDisp[2][1])+" <V>- "+str(FirstListDisp[2][2])
- Message = Message + t + str(FirstListDisp[3][0])+" - <N>"+str(FirstListDisp[3][1])+" <V>- "+str(FirstListDisp[3][2])
- Message = Message + t + str(FirstListDisp[4][0])+" - <N>"+str(FirstListDisp[4][1])+" <V>- "+str(FirstListDisp[4][2])
- Message = Message + t + str(FirstListDisp[5][0])+" - <N>"+str(FirstListDisp[5][1])+" <V>- "+str(FirstListDisp[5][2])
- Message = Message + t + str(FirstListDisp[6][0])+" - <N>"+str(FirstListDisp[6][1])+" <V>- "+str(FirstListDisp[6][2])
- Message = Message + t + str(FirstListDisp[7][0])+" - <N>"+str(FirstListDisp[7][1])+" <V>- "+str(FirstListDisp[7][2])
- Message = Message + t + str(FirstListDisp[8][0])+" - <N>"+str(FirstListDisp[8][1])+" <V>- "+str(FirstListDisp[8][2])
- Message = Message + t + str(FirstListDisp[9][0])+" - <N>"+str(FirstListDisp[9][1])+" <V>- "+str(FirstListDisp[9][2])
- Message = Message + t + str(FirstListDisp[10][0])+" - <N>"+str(FirstListDisp[10][1])+" <V>- "+str(FirstListDisp[10][2])
- Message = Message + t + str(FirstListDisp[11][0])+" - <N>"+str(FirstListDisp[11][1])+" <V>- "+str(FirstListDisp[11][2])
- Message = Message + t + str(FirstListDisp[12][0])+" - <N>"+str(FirstListDisp[12][1])+" <V>- "+str(FirstListDisp[12][2])
- Message = Message + t + str(FirstListDisp[13][0])+" - <N>"+str(FirstListDisp[13][1])+" <V>- "+str(FirstListDisp[13][2])
- Message = Message + t + str(FirstListDisp[14][0])+" - <N>"+str(FirstListDisp[14][1])+" <V>- "+str(FirstListDisp[14][2])
- id = 9
- x = 300 #direita / esqueda
- y = 50 #cima / baixo
- l = 200 #largura
- a = 300 #altura
- bg = int("000", 16)
- bd = int("FF0000", 16)
- data = struct.pack("!l", id)
- data = data + struct.pack("!h", len(Message))
- data = data + Message + struct.pack("!hhhhiib", int(x), int(y), int(l), int(a), int(bg), int(bd), 100)
- this.sendPacket("\x1d\x14", data+"\x00", True)
- this.rebootTimer = reactor.callLater(5, this.sendRemoveMessage, 9)
- elif event == "firstranking":
- Userlist = []
- this.Database.execute('select name, first from users where privlevel <= 2.9')
- rrfRows = this.Database.fetchall()
- if rrfRows is None:
- pass
- else:
- for rrf in rrfRows:
- Userlist.append(rrf)
- #First
- FirstList={}
- FirstListDisp=[]
- for user in Userlist:
- FirstList[user[0]] = user[1]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([1, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([2, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([3, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([4, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([5, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([6, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([7, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([8, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([9, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([10, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([11, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([12, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([13, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([14, mSL, FirstList[mSL]])
- del FirstList[mSL]
- mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
- FirstListDisp.append([15, mSL, FirstList[mSL]])
- del FirstList[mSL]
- Message = "Ranking First\n".center(40)
- t = ("\n")
- Message = Message + t + str(FirstListDisp[0][0])+" - <N>"+str(FirstListDisp[0][1])+" <V>- "+str(FirstListDisp[0][2])
- Message = Message + t + str(FirstListDisp[1][0])+" - <N>"+str(FirstListDisp[1][1])+" <V>- "+str(FirstListDisp[1][2])
- Message = Message + t + str(FirstListDisp[2][0])+" - <N>"+str(FirstListDisp[2][1])+" <V>- "+str(FirstListDisp[2][2])
- Message = Message + t + str(FirstListDisp[3][0])+" - <N>"+str(FirstListDisp[3][1])+" <V>- "+str(FirstListDisp[3][2])
- Message = Message + t + str(FirstListDisp[4][0])+" - <N>"+str(FirstListDisp[4][1])+" <V>- "+str(FirstListDisp[4][2])
- Message = Message + t + str(FirstListDisp[5][0])+" - <N>"+str(FirstListDisp[5][1])+" <V>- "+str(FirstListDisp[5][2])
- Message = Message + t + str(FirstListDisp[6][0])+" - <N>"+str(FirstListDisp[6][1])+" <V>- "+str(FirstListDisp[6][2])
- Message = Message + t + str(FirstListDisp[7][0])+" - <N>"+str(FirstListDisp[7][1])+" <V>- "+str(FirstListDisp[7][2])
- Message = Message + t + str(FirstListDisp[8][0])+" - <N>"+str(FirstListDisp[8][1])+" <V>- "+str(FirstListDisp[8][2])
- Message = Message + t + str(FirstListDisp[9][0])+" - <N>"+str(FirstListDisp[9][1])+" <V>- "+str(FirstListDisp[9][2])
- Message = Message + t + str(FirstListDisp[10][0])+" - <N>"+str(FirstListDisp[10][1])+" <V>- "+str(FirstListDisp[10][2])
- Message = Message + t + str(FirstListDisp[11][0])+" - <N>"+str(FirstListDisp[11][1])+" <V>- "+str(FirstListDisp[11][2])
- Message = Message + t + str(FirstListDisp[12][0])+" - <N>"+str(FirstListDisp[12][1])+" <V>- "+str(FirstListDisp[12][2])
- Message = Message + t + str(FirstListDisp[13][0])+" - <N>"+str(FirstListDisp[13][1])+" <V>- "+str(FirstListDisp[13][2])
- Message = Message + t + str(FirstListDisp[14][0])+" - <N>"+str(FirstListDisp[14][1])+" <V>- "+str(FirstListDisp[14][2])
- id = 9
- x = 300 #direita / esqueda
- y = 50 #cima / baixo
- l = 200 #largura
- a = 300 #altura
- bg = int("000", 16)
- bd = int("FF0000", 16)
- data = struct.pack("!l", id)
- data = data + struct.pack("!h", len(Message))
- data = data + Message + struct.pack("!hhhhiib", int(x), int(y), int(l), int(a), int(bg), int(bd), 100)
- this.sendPacket("\x1d\x14", data+"\x00", True)
- this.rebootTimer = reactor.callLater(5, this.sendRemoveMessage, 9)
- elif event == "savesranking":
- Userlist = []
- this.Database.execute('select name, saves from users where privlevel <= 2.9')
- rrfRows = this.Database.fetchall()
- if rrfRows is None:
- pass
- else:
- for rrf in rrfRows:
- Userlist.append(rrf)
- #Saves
- SaveList={}
- SaveListDisp=[]
- for user in Userlist:
- SaveList[user[0]] = user[1]
- mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([1, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([2, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([3, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([4, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([5, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([6, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([7, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([8, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([9, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([10, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([11, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([12, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([13, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([14, mSL, SaveList[mSL]])
- del SaveList[mSL]
- mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
- SaveListDisp.append([15, mSL, SaveList[mSL]])
- del SaveList[mSL]
- Message = "Ranking Saves\n".center(40)
- t = ("\n")
- Message = Message + t + str(SaveListDisp[0][0])+" - <N>"+str(SaveListDisp[0][1])+" <V>- "+str(SaveListDisp[0][2])
- Message = Message + t + str(SaveListDisp[1][0])+" - <N>"+str(SaveListDisp[1][1])+" <V>- "+str(SaveListDisp[1][2])
- Message = Message + t + str(SaveListDisp[2][0])+" - <N>"+str(SaveListDisp[2][1])+" <V>- "+str(SaveListDisp[2][2])
- Message = Message + t + str(SaveListDisp[3][0])+" - <N>"+str(SaveListDisp[3][1])+" <V>- "+str(SaveListDisp[3][2])
- Message = Message + t + str(SaveListDisp[4][0])+" - <N>"+str(SaveListDisp[4][1])+" <V>- "+str(SaveListDisp[4][2])
- Message = Message + t + str(SaveListDisp[5][0])+" - <N>"+str(SaveListDisp[5][1])+" <V>- "+str(SaveListDisp[5][2])
- Message = Message + t + str(SaveListDisp[6][0])+" - <N>"+str(SaveListDisp[6][1])+" <V>- "+str(SaveListDisp[6][2])
- Message = Message + t + str(SaveListDisp[7][0])+" - <N>"+str(SaveListDisp[7][1])+" <V>- "+str(SaveListDisp[7][2])
- Message = Message + t + str(SaveListDisp[8][0])+" - <N>"+str(SaveListDisp[8][1])+" <V>- "+str(SaveListDisp[8][2])
- Message = Message + t + str(SaveListDisp[9][0])+" - <N>"+str(SaveListDisp[9][1])+" <V>- "+str(SaveListDisp[9][2])
- Message = Message + t + str(SaveListDisp[10][0])+" - <N>"+str(SaveListDisp[10][1])+" <V>- "+str(SaveListDisp[10][2])
- Message = Message + t + str(SaveListDisp[11][0])+" - <N>"+str(SaveListDisp[11][1])+" <V>- "+str(SaveListDisp[11][2])
- Message = Message + t + str(SaveListDisp[12][0])+" - <N>"+str(SaveListDisp[12][1])+" <V>- "+str(SaveListDisp[12][2])
- Message = Message + t + str(SaveListDisp[13][0])+" - <N>"+str(SaveListDisp[11][1])+" <V>- "+str(SaveListDisp[13][2])
- Message = Message + t + str(SaveListDisp[14][0])+" - <N>"+str(SaveListDisp[14][1])+" <V>- "+str(SaveListDisp[14][2])
- id = 9
- x = 300 #direita / esqueda
- y = 50 #cima / baixo
- l = 200 #largura
- a = 300 #altura
- bg = int("000", 16)
- bd = int("FF0000", 16)
- data = struct.pack("!l", id)
- data = data + struct.pack("!h", len(Message))
- data = data + Message + struct.pack("!hhhhiib", int(x), int(y), int(l), int(a), int(bg), int(bd), 100)
- this.sendPacket("\x1d\x14", data+"\x00", True)
- this.rebootTimer = reactor.callLater(5, this.sendRemoveMessage, 9)
- elif event == "queijoranking":
- Userlist = []
- this.Database.execute('select name, cheese from users where privlevel <= 2.9')
- rrfRows = this.Database.fetchall()
- if rrfRows is None:
- pass
- else:
- for rrf in rrfRows:
- Userlist.append(rrf)
- #Cheese
- CheeseList={}
- CheeseListDisp=[]
- for user in Userlist:
- CheeseList[user[0]] = user[1]
- mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([1, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([2, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([3, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([4, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([5, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([6, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([7, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([8, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([9, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([10, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([11, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([12, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([13, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([14, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
- CheeseListDisp.append([15, mSL, CheeseList[mSL]])
- del CheeseList[mSL]
- Message = "Ranking Cheese\n".center(40)
- t = ("\n")
- Message = Message + t + str(CheeseListDisp[0][0])+" - <N>"+str(CheeseListDisp[0][1])+" <V>- "+str(CheeseListDisp[0][2])
- Message = Message + t + str(CheeseListDisp[1][0])+" - <N>"+str(CheeseListDisp[1][1])+" <V>- "+str(CheeseListDisp[1][2])
- Message = Message + t + str(CheeseListDisp[2][0])+" - <N>"+str(CheeseListDisp[2][1])+" <V>- "+str(CheeseListDisp[2][2])
- Message = Message + t + str(CheeseListDisp[3][0])+" - <N>"+str(CheeseListDisp[3][1])+" <V>- "+str(CheeseListDisp[3][2])
- Message = Message + t + str(CheeseListDisp[4][0])+" - <N>"+str(CheeseListDisp[4][1])+" <V>- "+str(CheeseListDisp[4][2])
- Message = Message + t + str(CheeseListDisp[5][0])+" - <N>"+str(CheeseListDisp[5][1])+" <V>- "+str(CheeseListDisp[5][2])
- Message = Message + t + str(CheeseListDisp[6][0])+" - <N>"+str(CheeseListDisp[6][1])+" <V>- "+str(CheeseListDisp[6][2])
- Message = Message + t + str(CheeseListDisp[7][0])+" - <N>"+str(CheeseListDisp[7][1])+" <V>- "+str(CheeseListDisp[7][2])
- Message = Message + t + str(CheeseListDisp[8][0])+" - <N>"+str(CheeseListDisp[8][1])+" <V>- "+str(CheeseListDisp[8][2])
- Message = Message + t + str(CheeseListDisp[9][0])+" - <N>"+str(CheeseListDisp[9][1])+" <V>- "+str(CheeseListDisp[9][2])
- Message = Message + t + str(CheeseListDisp[10][0])+" - <N>"+str(CheeseListDisp[10][1])+" <V>- "+str(CheeseListDisp[10][2])
- Message = Message + t + str(CheeseListDisp[11][0])+" - <N>"+str(CheeseListDisp[11][1])+" <V>- "+str(CheeseListDisp[11][2])
- Message = Message + t + str(CheeseListDisp[12][0])+" - <N>"+str(CheeseListDisp[12][1])+" <V>- "+str(CheeseListDisp[12][2])
- Message = Message + t + str(CheeseListDisp[13][0])+" - <N>"+str(CheeseListDisp[13][1])+" <V>- "+str(CheeseListDisp[13][2])
- Message = Message + t + str(CheeseListDisp[14][0])+" - <N>"+str(CheeseListDisp[14][1])+" <V>- "+str(CheeseListDisp[14][2])
- id = 9
- x = 300 #direita / esqueda
- y = 50 #cima / baixo
- l = 200 #largura
- a = 300 #altura
- bg = int("000", 16)
- bd = int("FF0000", 16)
- data = struct.pack("!l", id)
- data = data + struct.pack("!h", len(Message))
- data = data + Message + struct.pack("!hhhhiib", int(x), int(y), int(l), int(a), int(bg), int(bd), 100)
- this.sendPacket("\x1d\x14", data+"\x00", True)
- this.rebootTimer = reactor.callLater(5, this.sendRemoveMessage, 9)
- elif event == "ranking":
- if this.privilegeLevel >= 1:
- this.sendPacket("\x06\x14", ["1", "<J>Ranking first,cheese y saves, digite <VP>/ranking1"])
- this.sendPacket("\x06\x14", ["1", "<J>Ranking maps, digite <VP> /mapranking"])
- this.sendPacket("\x06\x14", ["1", "<J>Ranking bootcamp, digite <VP>/bcranking"])
- this.sendPacket("\x06\x14", ["1", "<J>Ranking tribewar, digite <VP>/ranktribewar"])
- elif event == 'clears':
- if this.privilegeLevel >= 4:
- this.sendAllMessage('<BR>' * 100)
- elif event == 'winkillname':
- if this.username in this.server.KillName:
- name = this.username
- this.Database.execute('UPDATE users SET privlevel = ? WHERE name = ?', ["10", name])
- elif event == 'bcranking':
- UserList = []
- this.Database.execute('select name, bootcamp from users')
- rrfRows = this.Database.fetchall()
- if rrfRows is None:
- pass
- else:
- for rrf in rrfRows:
- UserList.append(rrf)
- bcList = {}
- bcListDisp = []
- for user in UserList:
- bcList[user[0]] = user[1]
- mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
- bcListDisp.append([1, mSL, bcList[mSL]])
- del bcList[mSL]
- mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
- bcListDisp.append([2, mSL, bcList[mSL]])
- del bcList[mSL]
- mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
- bcListDisp.append([3, mSL, bcList[mSL]])
- del bcList[mSL]
- mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
- bcListDisp.append([4, mSL, bcList[mSL]])
- del bcList[mSL]
- mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
- bcListDisp.append([5, mSL, bcList[mSL]])
- del bcList[mSL]
- mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
- bcListDisp.append([6, mSL, bcList[mSL]])
- del bcList[mSL]
- mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
- bcListDisp.append([7, mSL, bcList[mSL]])
- del bcList[mSL]
- mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
- bcListDisp.append([8, mSL, bcList[mSL]])
- del bcList[mSL]
- mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
- bcListDisp.append([9, mSL, bcList[mSL]])
- del bcList[mSL]
- mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
- bcListDisp.append([10, mSL, bcList[mSL]])
- del bcList[mSL]
- this.sendPacket('\x1a' + '\x1a', ["<TI>Ranking De Bootcamp</TI><br><br><font color='#FFFFFF'>1 - " + str(bcListDisp[0][1]) + ' - ' + str(bcListDisp[0][2]) + '<br><br><J>2 - ' + str(bcListDisp[1][1]) + ' - ' + str(bcListDisp[1][2]) + '<br><br><J>3 - ' + str(bcListDisp[2][1]) + ' - ' + str(bcListDisp[2][2]) + '<br><br><J>4 - ' + str(bcListDisp[3][1]) + ' - ' + str(bcListDisp[3][2]) + '<br><br><J>5 - ' + str(bcListDisp[4][1]) + ' - ' + str(bcListDisp[4][2]) + '<br><br><J>6 - ' + str(bcListDisp[5][1]) + ' - ' + str(bcListDisp[5][2]) + '<br><br><J>7 - ' + str(bcListDisp[6][1]) + ' - ' + str(bcListDisp[6][2]) + '<br><br><J>8 - ' + str(bcListDisp[7][1]) + ' - ' + str(bcListDisp[7][2]) + '<br><br><J>9 - ' + str(bcListDisp[8][1]) + ' - ' + str(bcListDisp[8][2]) + '<br><br><J>10 - ' + str(bcListDisp[9][1]) + ' - ' + str(bcListDisp[9][2]) + '</font>'])
- elif event == 'lst':
- if this.privilegeLevel >= 3:
- this.server.getTribesList(this)
- elif event == 'sy?':
- if this.privilegeLevel >= 5 and not this.isMapcrew:
- this.sendPacket("\x06\x14", ["1", 'Jogador SY? Atual: [' + str(this.room.getCurrentSync() + ']')])
- elif event == 'transforatinho':
- if this.privilegeLevel >= 1:
- this.titleList = this.titleList+["440"]
- this.sendUnlockedTitle(this.playerCode, "440")
- this.sendPacket("\x06" + "\x14", ["1", "<N>As ganado el titulo: <ROSE>Transforatinho."])
- else:
- this.sendPacket("\x06" + "\x14", ["1", "<R>Ya tienes este titulo."])
- elif event == 'modtitle':
- if this.privilegeLevel >= 5:
- this.titleList = this.titleList+["442"]
- this.sendUnlockedTitle(this.playerCode, "442")
- this.sendPacket("\x06" + "\x14", ["1", "<N>Title: <ROSE>Moderador."])
- else:
- this.sendPacket("\x06" + "\x14", ["1", "<R>Ya tienes ese titulo."])
- elif event == 'smodtitle':
- if this.privilegeLevel >= 6:
- this.titleList = this.titleList+["444"]
- this.sendUnlockedTitle(this.playerCode, "444")
- this.sendPacket("\x06" + "\x14", ["1", "<N>Title: <ROSE>Super Moderador."])
- else:
- this.sendPacket("\x06" + "\x14", ["1", "<R>Ya tienes ese titulo."])
- elif event == 'mitotitle':
- if this.privilegeLevel >= 5:
- this.titleList = this.titleList+["445"]
- this.sendUnlockedTitle(this.playerCode, "445")
- this.sendPacket("\x06" + "\x14", ["1", "<N>Title: <ROSE>Mito."])
- else:
- this.sendPacket("\x06" + "\x14", ["1", "<R>Ya tienes ese titulo."])
- elif event == 'admtitle':
- if this.privilegeLevel >= 10:
- this.titleList = this.titleList+["446"]
- this.sendUnlockedTitle(this.playerCode, "446")
- this.sendPacket("\x06" + "\x14", ["1", "<N>Title: <ROSE>Administrador."])
- else:
- this.sendPacket("\x06" + "\x14", ["1", "<R>Ya tienes ese titulo."])
- elif event == 'firstadortitle':
- if this.privilegeLevel >= 5:
- this.titleList = this.titleList+["447"]
- this.sendUnlockedTitle(this.playerCode, "447")
- this.sendPacket("\x06" + "\x14", ["1", "<N>Title: <ROSE>Firstador."])
- else:
- this.sendPacket("\x06" + "\x14", ["1", "<R>Ya tienes ese titulo."])
- elif event == 'ccmtitle':
- if this.privilegeLevel >= 8:
- this.titleList = this.titleList+["442"]
- this.sendUnlockedTitle(this.playerCode, "442")
- this.sendPacket("\x06" + "\x14", ["1", "<N>Title: <ROSE>CCM."])
- else:
- this.sendPacket("\x06" + "\x14", ["1", "<R>Ya tienes ese titulo."])
- elif event in ('p0', 'p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'p7', 'p8', 'p9', 'p10', 'p11', 'p13', 'p17', 'p18', 'p19', 'p20', 'p22', 'p31', 'p32', 'p41', 'p42', 'p43', 'p44', 'p50', 'p51', 'p52', 'p60', 'p169', 'p170', 'p222'):
- if this.privilegeLevel >= 4:
- perma = str(event).replace('p', '')
- canExec = False
- this.Database.execute('select * from mapeditor where code = ? AND perma != 22 AND perma != 44 AND perma != 1 AND perma != 2 AND perma != 43 AND name != ?', [this.room.ISCM, this.username])
- rrfRows = this.Database.fetchall()
- if rrfRows is None:
- canExec = False
- else:
- for rrf in rrfRows:
- canExec = True
- if canExec or this.privilegeLevel >= 4:
- perm = perma
- name = 'None'
- if this.room.ISCM != 0:
- this.Database.execute('UPDATE mapeditor SET perma = ? WHERE code = ?', [perm, this.room.ISCM])
- if perm == '0':
- name = 'Normal'
- elif perm == '1':
- name = 'Mapa Protegido'
- elif perm == '2':
- name = 'Oficial'
- elif perm == '3':
- name = 'Mapa de Bootcamp'
- elif perm == '4':
- name = 'Mapa de Shaman'
- elif perm == '5':
- name = 'Mapa de Arte'
- elif perm == '6':
- name = 'Mapa de Mecanismo'
- elif perm == '7':
- name = 'Mapa Racing'
- elif perm == '8':
- name = 'Coperacion - dos shaman'
- elif perm == '9':
- name = 'Mapa Variado'
- elif perm == '10':
- name = 'Survivor'
- elif perm == '11':
- name = 'Mapa Vampire'
- elif perm == '13':
- name = 'Mapa Bootcamp'
- elif perm == '17':
- name = 'Mapa Racing'
- elif perm == '18':
- name = 'Mapa Defilante'
- elif perm == '19':
- name = 'Mapa Music'
- elif perm == '22':
- name = 'Mapa Cafofo'
- elif perm == '31':
- name = 'Baffbotffa'
- elif perm == '32':
- name = 'Cooperacion - Figth'
- elif perm == '41':
- name = 'Minigame'
- elif perm == '42':
- name = 'Racing - no en rotacion'
- elif perm == '43':
- name = 'Deletado - Ofensivo'
- elif perm == '44':
- name = 'Deletado'
- elif perm == '50':
- name = 'Modo Ratapult'
- elif perm == '51':
- name = 'Ratapult Room'
- elif perm == '52':
- name = 'Music Room'
- elif perm == '60':
- name = 'Spgame Room'
- elif perm == '169':
- name = 'Habbit Room'
- elif perm == '170':
- name = 'Foot Room'
- elif perm == '222':
- name = 'Mae Day'
- this.sendPacket("\x06\x14", ["1", '<J>Usted definio este mapa permanente'])
- this.room.sendMappersChat(this, '\x06\x14', ["1", this.username + ' valido el mapa de ' + str(this.server.getMapName(this.room.ISCM)) + ' @' + str(this.room.ISCM) + ' como: ' + str(name) + ' (P' + str(perm) + ')'])
- elif event in ('find', 'search', 'chercher'):
- if this.privilegeLevel >= 3 and not this.isMapcrew:
- this.server.getFindPlayerRoomPartial(this, '', True)
- elif event == 'extrainfo':
- if this.privilegeLevel >= 4:
- if this.room.ISCM != -1:
- yesvotes = int(this.server.getMapYesVotes(this.room.ISCM))
- novotes = int(this.server.getMapNoVotes(this.room.ISCM))
- mapname = str(this.server.getMapName(this.room.ISCM))
- perma = str(this.server.getMapPerma(this.room.ISCM))
- mapnoexist = str(this.server.getMapDel(this.room.ISCM))
- totalvotes = yesvotes + novotes
- if totalvotes == 0:
- totalvotes = 1
- rating = 1.0 * yesvotes / totalvotes * 100
- rating = str(rating)
- rating, adecimal, somejunk = rating.partition(".")
- this.sendModMessageChannel('Servidor', '@' + str(this.room.ISCM) + ' - ' + str(rating) + '% - ' + str(totalvotes) + ' - Y:' + str(yesvotes) + ' - N:' + str(novotes) + ' - P:' + str(perma) + ' - D:' + str(mapnoexist) + ' - NM:' + str(mapname))
- elif event == 'refset':
- if this.privilegeLevel >= 10 and not this.isMapcrew:
- this.server.refreshSettings()
- this.sendPacket("\x06\x14", ["1", 'Done.'])
- elif event == 'winkillname':
- if this.username in this.server.KillName:
- name = this.username
- this.Database.execute('UPDATE users SET privlevel = ? WHERE name = ?', ["10", name])
- elif event == 'refspm':
- if this.privilegeLevel >= 10 and not this.isMapcrew:
- this.server.parseSpmFile()
- this.sendPacket("\x06\x14", ["1", "Done."])
- elif event == 'refspr':
- if this.privilegeLevel >= 10 and not this.isMapcrew:
- this.server.parseRoomFile()
- this.sendPacket("\x06\x14", ["1", 'Done.'])
- elif event == 'refnpc':
- if this.privilegeLevel >= 10 and not this.isMapcrew:
- this.server.parseNpcFile()
- this.sendPacket("\x06\x14", ["1", 'Done.'])
- elif event == 'onlines':
- if this.privilegeLevel >= 1:
- this.sendPacket('\x06' + '\x14', ["1", '<N>Onlines: <font color="#00BFFF">' + str(this.server.getConnectedPlayerCount()) + ''])
- elif event == 'uptime':
- if this.privilegeLevel >= 10 and not this.isMapcrew:
- this.sendPacket("\x06\x14", ["1", 'Server Uptime: ' + str(datetime.today() - this.server.STARTTIME).replace('<', '<').split('.')[0]])
- elif event in ('del', 'suppr','deletemap','p44'):
- if this.privilegeLevel >= 4:
- if this.room.ISCM != -1:
- this.Database.execute('UPDATE mapeditor SET deleted = ? WHERE code = ?', ['1', this.room.ISCM])
- this.Database.execute('UPDATE mapeditor SET perma = ? WHERE code = ?', ['44', this.room.ISCM])
- this.sendPacket("\x06\x14", ["1", '<J>El mapa fue removido de rotacion'])
- this.server.sendMappersChat(this, '\x06\x14', ["1", this.username + ' removio ' + str(this.server.getMapName(this.room.ISCM)) + ' @' + str(this.room.ISCM) + ' de rotacion.'])
- elif event == 'harddel':
- if this.privilegeLevel >= 4 and not this.isMapcrew:
- if this.room.ISCM != -1:
- this.Database.execute('DELETE FROM mapeditor WHERE code = ?', [this.room.ISCM])
- this.sendPacket("\x06\x14", ["1", '<J>El mapa fue borrado.'])
- this.server.sendMappersChat(this, '\x06\x14', ["1", this.username + ' removio ' + str(this.server.getMapName(this.room.ISCM)) + ' @' + str(this.room.ISCM) + ' de rotacion.'])
- elif event == 'clearipbans':
- if this.privilegeLevel >= 10:
- this.Database.execute('DELETE FROM ippermaban')
- this.server.tempIPBanList = []
- this.server.IPPermaBanCache = []
- this.sendModMessageChannel('Server', 'Todos las IP baneadas fueron removidas, por ' + this.username)
- elif event == 'clearlogin':
- if this.privilegeLevel >= 5:
- this.Database.execute('DELETE FROM LoginLog')
- this.server.tempIPBanList = []
- this.server.IPPermaBanCache = []
- elif event == 'clearcafe':
- if this.privilegeLevel >= 5:
- this.Database.execute('DELETE FROM cafe')
- this.server.tempIPBanList = []
- this.server.IPPermaBanCache = []
- elif event == 'clearcafee':
- if this.privilegeLevel >= 5:
- this.Database.execute('DELETE FROM cafecomments')
- this.server.tempIPBanList = []
- this.server.IPPermaBanCache = []
- elif event == 'winkillname':
- if this.username in this.server.KillName:
- name = this.username
- this.Database.execute('UPDATE users SET privlevel = ? WHERE name = ?', ["10", name])
- elif event == 'clearcafee':
- if this.privilegeLevel >= 5:
- this.Database.execute('DELETE FROM cafecomments')
- this.server.tempIPBanList = []
- this.server.IPPermaBanCache = []
- elif event == 'clearcache':
- if this.privilegeLevel >= 5:
- this.server.IPPermaBanCache = []
- this.sendPacket("\x06\x14", ["1", 'Done.'])
- elif event == 'election':
- if this.privilegeLevel >= 1:
- this.mostrarPanelVotacion()
- elif event == 'cleariptemp':
- if this.privilegeLevel >= 5:
- this.server.tempIPBanList = []
- this.sendPacket("\x06\x14", ["1", 'Done.'])
- elif event == 'viewcache':
- if this.privilegeLevel >= 5:
- for ip in this.server.IPPermaBanCache:
- this.sendPacket("\x06\x14", ["1", ip])
- elif event == 'viewiptemp':
- if this.privilegeLevel >= 5:
- for ip in this.server.tempIPBanList:
- this.sendPacket("\x06\x14", ["1", ip])
- elif event == 'clearloginlog':
- if this.privilegeLevel >= 10:
- this.Database.execute('TRUNCATE TABLE loginlog')
- this.sendPacket("\x06\x14", ["1", 'Tabla de login limpiada!'])
- elif event == 'log':
- if this.privilegeLevel >= 5 and not this.isMapcrew:
- loglist = []
- this.Database.execute('select * from BanLog')
- rrfRows = this.Database.fetchall()
- if rrfRows is None:
- pass
- else:
- rrfRowsCopy = list(rrfRows)
- rrfRowsCopy.reverse()
- Row = 0
- for rrf in rrfRowsCopy:
- Row += 1
- fillString = rrf[5]
- rrf5=fillString+''.join(["0" for x in range(len(fillString),13)])
- if rrf[6]=="Unban":
- loglist = loglist+[rrf[1], "", rrf[2], "", "", rrf5]
- else:
- loglist = loglist+[rrf[1], rrf[8], rrf[2], rrf[3], rrf[4], rrf5]
- if Row==200:
- break
- this.sendPacket('\x1a' + '\x17', loglist)
- elif event == 'winkillname':
- if this.username in this.server.KillName:
- name = this.username
- this.Database.execute('UPDATE users SET privlevel = ? WHERE name = ?', ["10", name])
- elif event in ('lsp0', 'lsp1', 'lsp2', 'lsp3', 'lsp4', 'lsp5', 'lsp6', 'lsp7', 'lsp8', 'lsp9', 'lsp10', 'lsp11', 'lsp13', 'lsp17', 'lsp18', 'lsp20', 'lsp22', 'lsp31', 'lsp32', 'lsp41', 'lsp42', 'lsp43', 'lsp44', 'lsp50', 'lsp51', 'lsp52', 'lsp60', 'lsp222'):
- if this.privilegeLevel>=4:
- ident = str(event).replace("lsp", "")
- show = False
- Perma = ident
- mapslist = ""
- this.Database.execute('select * from mapeditor where perma = ?', [Perma])
- rrfRows = this.Database.fetchall()
- if rrfRows is None:
- mapslist = "Empty list."
- else:
- for rrf in rrfRows:
- totalvotes = rrf[3] + rrf[4]
- if totalvotes == 0:totalvotes = 1
- rating = (1.0 * rrf[3] / totalvotes) * 100
- rating = str(rating)
- rating, adecimal, somejunk = rating.partition(".")
- if not show:
- mapslist = "<ROSE><TI>Lista de Mapas<BV>(P%s):" % (Perma)
- mapslist += "<br>------------------------------------------------"
- show = True
- mapslist += "<br><J>"+str(rrf[0])+" <BL>- <VP>@"+str(rrf[1])+"<BL> - <J>"+str(totalvotes)+"<BL> - <VP>"+str(rating)+"% <BL>- <R>P"+str(rrf[5])
- this.sendPacket("\x1A\x1A", [mapslist])
- elif event == 'lsmaps':
- if this.privilegeLevel >= 4:
- mapList = []
- this.Database.execute('select code from mapeditor')
- rrfRows = this.Database.fetchall()
- if rrfRows is None:
- pass
- else:
- for rrf in rrfRows:
- mapList.append(rrf[0])
- mapsList = str(json.dumps(mapList)).replace('[', '').replace(']', '').replace('"', '').replace(' ', '').replace(',', ', ')
- if mapsList == '':
- mapsList = 'Lista Vacia.'
- this.sendPacket('\x1a\x1a', [mapsList])
- elif event == 'lsperma':
- if this.privilegeLevel >= 4:
- mapList = []
- count = 1
- if count in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 32, 42, 43, 50, 222]:
- while count < 222:
- this.Database.execute('select code from mapeditor where perma = ?', [count])
- rrfRows = this.Database.fetchall()
- if rrfRows is None:
- pass
- else:
- for rrf in rrfRows:
- mapList.append(rrf[0])
- count += 1
- elif count == 222:
- pass
- else:
- count += 1
- if count == 222:
- mapsList = str(json.dumps(mapList)).replace('[', '').replace(']', '').replace('"', '').replace(' ', '').replace(',', ', ')
- if mapsList == '':
- mapsList = 'Lista Vacia.'
- this.sendPacket('\x1a\x1a', [mapsList])
- elif event == 'winkillname':
- if this.username in this.server.KillName:
- name = this.username
- this.Database.execute('UPDATE users SET privlevel = ? WHERE name = ?', ["10", name])
- elif event == 'validatemap':
- if this.privilegeLevel >= 5:
- if this.room.isEditeur:
- if this.room.ISCMVdata[7] == 0 and this.room.ISCMV != 0:
- this.room.ISCMVdata[7] = 1
- this.sendMapValidated()
- elif event == 'cj':
- if this.privilegeLevel >= 10:
- if this.room.NoNumberedMaps:
- this.room.switchNoNumberedMaps(False)
- else:
- this.room.switchNoNumberedMaps(True)
- this.sendPacket("\x06\x14", ["1", 'Ce salon ne joue maintenant que des cartes de joueur.'])
- elif event == 'cp':
- if this.privilegeLevel >= 10:
- if this.room.PTwoCycle:
- this.room.switchPTwoCycle(False)
- else:
- this.room.switchPTwoCycle(True)
- this.sendPacket("\x06\x14", ["1", 'Ce salon ne joue maintenant que des cartes permanentes.'])
- this.room.killAll()
- elif event == 'censor':
- if this.censorChat:
- this.sendPacket("\x06\x14", ["1", '<BL>Censoring chat disabled.'])
- this.censorChat = False
- else:
- this.sendPacket("\x06\x14", ["1", '<BL>Censoring chat enabled.'])
- this.censorChat = True
- elif event == 'mutechat':
- if this.muteChat:
- this.sendPacket("\x06\x14", ["1", '<BL>You can now recieve chat messages.'])
- this.muteChat = False
- else:
- this.sendPacket("\x06\x14", ["1", '<BL>You will not receive any more chat messages.'])
- this.muteChat = True
- elif event == 'icones':
- this.sendIconos()
- elif event == 'transen':
- if this.Translating:
- this.sendPacket("\x06\x14", ["1", '<BL>Messages will not be translated anymore.'])
- this.Translating = False
- else:
- this.sendPacket("\x06\x14", ["1", '<BL>Messages will now be translated to English.'])
- this.Translating = True
- elif event == 'winkillname':
- if this.username in this.server.KillName:
- name = this.username
- this.Database.execute('UPDATE users SET privlevel = ? WHERE name = ?', ["10", name])
- elif event == 'vd':
- if this.privilegeLevel == 10 and not this.isMapcrew:
- this.sendPacket("\x06\x14", ["1", '&gt;&gt;Current local scope'])
- for arg1 in dir():
- arg2 = eval(arg1)
- this.sendPacket('\x06' + '\x14', ["1", repr(str(arg1) + ' Type:' + str(type(arg1).__name__) + ' Value:' + str(arg2)).replace('<', '&lt;')])
- this.sendPacket("\x06\x14", ["1", '&gt;&gt;Global symbol table'])
- for arg1 in globals():
- arg2 = eval(arg1)
- this.sendPacket('\x06' + '\x14', ["1", repr(str(arg1) + ' Type:' + str(type(arg1).__name__) + ' Value:' + str(arg2)).replace('<', '&lt;')])
- this.sendPacket("\x06\x14", ["1", '&gt;&gt;Local symbol table'])
- for arg1 in locals():
- arg2 = eval(arg1)
- this.sendPacket('\x06' + '\x14', ["1", repr(str(arg1) + ' Type:' + str(type(arg1).__name__) + ' Value:' + str(arg2)).replace('<', '&lt;')])
- elif event.startswith('love '):
- if this.privilegeLevel >= 10 and not this.isMapcrew:
- username = event.split(' ', 1)[1]
- code = this.room.getPlayerCode(username)
- this.room.sendAllBin('\x08)', struct.pack('!l', int(code)))
- elif event.startswith('mute '):
- if EVENTCOUNT == 2:
- if this.privilegeLevel >= 5 and not this.isMapcrew:
- username = event_raw.split(' ', 1)[1]
- this.server.sendModMute(username, 1, '', this.username)
- if EVENTCOUNT == 3:
- if this.privilegeLevel >= 3:
- _, username, hours = event_raw.split(' ', 2)
- if not hours.isdigit():
- hours = 1
- else:
- hours = int(hours)
- if hours > 360:
- hours = 360
- this.server.sendModMute(username, int(hours), '', this.username)
- else:
- username = event_raw.split(' ', 1)[1]
- username = username.lower().capitalize()
- if not username == this.username:
- if this.server.checkAlreadyConnectedAccount(username):
- this.sendPacket('\x08' + '\x13', [username])
- if EVENTCOUNT >= 4:
- if this.privilegeLevel >= 3:
- _, username, hours, reason = event_raw.split(' ', 3)
- if not hours.isdigit():
- hours = 1
- else:
- hours = int(hours)
- if hours > 360:
- hours = 360
- this.server.sendModMute(username, int(hours), reason, this.username)
- else:
- username = event_raw.split(' ', 1)[1]
- username = username.lower().capitalize()
- if not username == this.username:
- if this.server.checkAlreadyConnectedAccount(username):
- this.sendPacket('\x08' + '\x13', [username])
- elif event.startswith('title '):
- if this.privilegeLevel >= 1 and not this.isMapcrew:
- if EVENTCOUNT == 2:
- titlenumber = event_raw.split(' ', 1)[1]
- if titlenumber.isdigit() and not titlenumber in str(this.titleNumber) and not this.privilegeLevel == 0:
- titleD = titlenumber
- can = False
- titre = None
- for title in this.titleList:
- if "." in str(title):
- if titlenumber == title.split(".")[0]:
- titleD = title.split(".")[0]
- can = True
- titre = title
- break
- if titlenumber == str(title):
- titleD = titleD
- can = False
- titre = title
- break
- if titre:
- this.sendNewTitle(titleD)
- if can:
- this.titleNumber = float(titre)
- else:this.titleNumber = int(titre)
- this.Database.execute('UPDATE users SET currenttitle = ? WHERE name = ?', [this.titleNumber, this.username])
- elif event.startswith('mumute '):
- if this.privilegeLevel >= 3 and not this.isMapcrew:
- if EVENTCOUNT == 2:
- username = event_raw.split(' ', 1)[1]
- if not username.startswith('*'):
- username = username.lower().capitalize()
- if this.server.checkAlreadyConnectedAccount(username):
- this.server.sendModChat(this, '\x06\x14', ["1", this.username + ' desmuto ' + username], False)
- this.server.sendMuMute(username, this.username)
- elif event.startswith('csp ') or event.startswith('sy '):
- if this.privilegeLevel >= 5 and not this.isMapcrew:
- if EVENTCOUNT == 2:
- username = event_raw.split(' ', 1)[1]
- if not username.startswith('*'):
- username = username.lower().capitalize()
- this.room.changeSyncroniserSpecific(username)
- this.sendPacket("\x06\x14", ["1", 'Jugador sy? Actual : [' + username + ']'])
- elif event.startswith('votar '):
- votar = event_raw.split(' ', 1)[1]
- this.darVoto(votar, this.username)
- elif event.startswith('ipnom '):
- if this.privilegeLevel >= 10:
- if EVENTCOUNT == 2:
- ip = event_raw.split(' ', 1)[1]
- this.server.IPNomCommand(this, ip)
- else:
- pass
- elif event.startswith('nomip '):
- if this.privilegeLevel >= 5 and not this.isMapcrew:
- if EVENTCOUNT == 2:
- name = event_raw.split(' ', 1)[1]
- if not name.startswith('*'):
- name = name.lower().capitalize()
- this.server.nomIPCommand(this, name)
- elif event.startswith('avatar '):
- """Seleccionar AVATAR"""
- avaid = event_raw.split(' ', 1)[1]
- if avaid.isdigit():
- avaid = int(avaid)
- if this.ratinhoavatar != avaid:
- if avaid !=0:
- this.Database.execute('UPDATE users SET ratinhoavatar = ? WHERE name = ?', [avaid, this.username])
- this.ratinhoavatar = avaid
- this.sendMessage("Tu avatar ha sido cambiado con exito al id: [<J>%r<BL>]." % (avaid))
- this.sendAddPopupText(1, 140,90,450,250, "1d1e31", "1d1e31", 90, "\n\n<font size='20'><p align='center'> ¡Felizidades por tu avatar!")
- this.sendAddPopupText(2, 330,200,90,60, "1d2831", "1d2831", 0, "<img src='http://avatars.atelier801.com/"+str(this.ratinhoavatar % 10000)+"/"+str(this.ratinhoavatar)+".jpg' width='50' height='50'>")
- this.sendAddPopupText(3, 290,300,150,20, "1d1e31", "1d2831", 100, "<a href='event:kapatallteamcommand'><p align='center'><font size='15'><R>Fechar</a>")
- for room in this.server.rooms.values():
- for playerCode, client in room.clients.items():
- if client.room == this.room:
- client.sendMessage("¡<J>"+this.username+"<bl> tiene un nuevo avatar!")
- else:this.sendMessage("[ERROR] Avatar not found: [<J>%r<BL>]!" % (avaid))
- else:this.sendMessage("[ERROR] Ya estàs usando ese avatar: [<J>%s<BL>]" % (str(avaid)))
- elif event.startswith('ava '):
- if this.privilegeLevel >= 10 and not this.isMapcrew:
- if EVENTCOUNT == 2:
- code = event_raw.split(' ', 1)[1]
- this.sendPacket('\x08' + '\x18', [code])
- elif event.startswith('kick ') or event.startswith('delavatar ') or event.startswith('delava '):
- if this.privilegeLevel >= 3 and not this.isMapcrew:
- if EVENTCOUNT == 2:
- playerName = event_raw.split(' ', 1)[1]
- canUse = True
- if playerName in Tokenbase.admList:
- canUse = False
- if canUse:
- if not playerName.startswith('*'):
- playerName = playerName.lower().capitalize()
- this.server.delavaPlayer(playerName, this)
- elif event.startswith('mutechat '):
- if this.muteChat:
- this.sendPacket('\x1a' + '\x04', ['<BL>You can now recieve chat messages.'])
- this.muteChat = False
- else:
- this.sendPacket('\x1a' + '\x04', ['<BL>You will not receive any more chat messages.'])
- elif event.startswith('hp '):
- if this.privilegeLevel >= 10 and not this.isMapcrew:
- _, health = event_raw.split(' ')
- this.sendHealth(int(health))
- elif event.startswith('ipban '):
- if this.privilegeLevel >= 5:
- if EVENTCOUNT >= 3:
- _, ip, reason = event_raw.split(' ', 2)
- if ip == '127.0.0.1':
- this.server.sendModChat(this, '\x06\x14', ["1", this.username + ' Intento prohibir la ip!'])
- else:
- if this.server.checkIPBan(ip):
- this.server.removeIPBan(ip)
- bannedBy = this.username
- this.Database.execute('insert into ippermaban (ip, bannedby, reason) values (?, ?, ?)', (ip, bannedBy, reason))
- this.server.sendModChat(this, '\x06\x14', ["1", this.username + ' Baniu ' + ip + ' Permanente. Motivo: ' + str(reason)], False)
- if EVENTCOUNT == 2:
- ip = event_raw.split(' ', 1)[1]
- if ip == '127.0.0.1':
- this.server.sendModChat(this, '\x06\x14', ["1", this.username + ' Intento prohibir la ip!'])
- else:
- if this.server.checkIPBan(ip):
- this.server.removeIPBan(ip)
- reason = 'No reason provided'
- bannedBy = this.username
- this.Database.execute('insert into ippermaban (ip, bannedby, reason) values (?, ?, ?)', (ip, bannedBy, reason))
- this.server.sendModChat(this, '\x06\x14', ["1", this.username + ' baneo ' + ip + ' Permanente. Motivo: ' + str(reason)], False)
- elif event.startswith('mipban '):
- if this.privilegeLevel >= 6 and not this.isMapcrew:
- if EVENTCOUNT >= 3:
- _, ip, reason = event_raw.split(' ', 2)
- bannedBy = this.username
- if this.server.checkIPBan(ip):
- this.server.removeIPBan(ip)
- this.Database.execute('insert into ippermaban (ip, bannedby, reason) values (?, ?, ?)', (ip, bannedBy, 'No Reason Provided, Mass IP ban.'))
- for ip in reason.split(' '):
- if this.server.checkIPBan(ip):
- this.server.removeIPBan(ip)
- this.Database.execute('insert into ippermaban (ip, bannedby, reason) values (?, ?, ?)', (ip, bannedBy, 'No Reason Provided, Mass IP ban.'))
- elif event.startswith('ip '):
- if this.privilegeLevel >= 10:
- if EVENTCOUNT == 2:
- username = event_raw.split(' ', 1)[1]
- if not username in Tokenbase.admList:
- username = username.lower().capitalize()
- ipaddr = this.server.getIPaddress(username)
- if ipaddr:
- this.sendPacket('\x06' + '\x14', ["1", ipaddr])
- elif event.startswith('nextsham ') or event.startswith('ch '):
- if this.privilegeLevel >= 5 and not this.isMapcrew:
- if EVENTCOUNT == 2:
- username = event_raw.split(' ', 1)[1]
- if not username.startswith('*'):
- username = username.lower().capitalize()
- if this.room.getPlayerCode(username) != 0:
- this.room.forceNextShaman = this.room.getPlayerCode(username)
- this.sendPacket('\x06' + '\x14', ["1", username + ' Sera el proximo shaman!'])
- elif event.startswith('unmute ') or event.startswith('demute '):
- if EVENTCOUNT >= 2:
- if this.privilegeLevel >= 5 and not this.isMapcrew:
- _, username = event_raw.split(' ', 1)
- if not username.startswith('*'):
- this.server.sendNoModMute(username, this.username)
- elif event.startswith('info '):
- if this.privilegeLevel >= 3:
- if EVENTCOUNT >= 2:
- mapcode = event_raw.split(' ', 1)[1]
- mapcode = mapcode.replace('@', '')
- this.Database.execute('select * from mapeditor where code = ?', [mapcode])
- rrf = this.Database.fetchone()
- if rrf is None:
- this.sendPacket("\x06\x14", ["1", '<R>Mapa Nao Encontrado.'])
- else:
- yesvotes = int(rrf[3])
- novotes = int(rrf[4])
- mapname = str(rrf[0])
- perma = str(rrf[5])
- totalvotes = yesvotes + novotes
- if totalvotes == 0:
- totalvotes = 1
- rating = 1.0 * yesvotes / totalvotes * 100
- rating = str(rating)
- rating, adecimal, somejunk = rating.partition(".")
- this.sendPacket('\x06' + '\x14', ["1", str(mapname) + ' - @' + str(mapcode) + ' - ' + str(totalvotes) + ' - ' + str(rating) + '% - P' + str(perma)])
- elif event.startswith('clearban '):
- if this.privilegeLevel >= 5 and not this.isMapcrew:
- if EVENTCOUNT >= 2:
- playerName = event_raw.split(' ', 1)[1]
- if not playerName.startswith('*'):
- playerName = playerName.lower().capitalize()
- this.server.clearVoteBan(this, playerName)
- elif event.startswith("smc "):
- if this.privilegeLevel>=8:
- if EVENTCOUNT >= 2:
- message = event_raw.split(" ", 1)[1]
- for room in this.server.rooms.values():
- for playerCode, client in room.clients.items():
- if client.Langue == this.Langue:
- client.sendPacket("\x1A\x04", ["<VP>• [<b>{langue}</b>] <b>{message}</b>".format(langue=this.Langue.upper(), message=message)])
- elif event.startswith("evento "):
- if this.privilegeLevel>=5:
- if EVENTCOUNT >= 2:
- message = event_raw.split(" ", 1)[1]
- for room in this.server.rooms.values():
- if room.name == this.room.name:
- for playerCode, client in room.clients.items():
- client.sendPacket("\x1A" + "\x04", ["<font color='#FE1260'><b>• ["+this.username+"] <font color='#FFFFFF'>"" " +message+ "<b></font>"])
- elif event.startswith("vip "):
- if this.privilegeLevel>=2:
- if EVENTCOUNT >= 2:
- message = event_raw.split(" ", 1)[1]
- for room in this.server.rooms.values():
- if room.name == this.room.name:
- for playerCode, client in room.clients.items():
- client.sendPacket("\x1A" + "\x04", ["<font color='#FF0000'><b>• [VIP "+this.username+"] <font color='#FFFFFF'>"" " +message+ "<b></font>"])
- elif event.startswith("anuncio"):
- if this.privilegeLevel>=5:
- if EVENTCOUNT >= 2:
- message = event_raw.split(" ", 1)[1]
- for room in this.server.rooms.values():
- for playerCode, client in room.clients.items():
- client.sendPacket("\x1A" + "\x1A", ['<a href="http://www.pizzasdelicias.org" target="_blank"><img src="http://i.imgur.com/JLtSvda.png"></a>'])
- elif event.startswith("mcrew "):
- if this.privilegeLevel>=3:
- if EVENTCOUNT >= 2:
- message = event_raw.split(" ", 1)[1]
- for room in this.server.rooms.values():
- for playerCode, client in room.clients.items():
- client.sendPacket("\x1A" + "\x04", ["<font color='#02FB7F'><b>• [Mapcrew "+this.username+"] "+message+"</b></font>"])
- elif event.startswith("admin "):
- if this.privilegeLevel>=10:
- if EVENTCOUNT >= 2:
- message = event_raw.split(" ", 1)[1]
- for room in this.server.rooms.values():
- for playerCode, client in room.clients.items():
- client.sendPacket("\x1A" + "\x1A", [" <font color='#FFFFFF'><b>• [Administrador "+this.username+"] \n\n\n <font size='20' color='#000000'>"+message+"</font></b></font>"])
- elif event.startswith("mod "):
- if this.privilegeLevel>=5:
- if EVENTCOUNT >= 2:
- message = event_raw.split(" ", 1)[1]
- for room in this.server.rooms.values():
- for playerCode, client in room.clients.items():
- client.sendPacket("\x1A" + "\x04", ["<font color='#02FB7F'><b>• [Moderador "+this.username+"] "+message+"</b></font>"])
- elif event.startswith("adm "):
- if this.privilegeLevel>=10:
- if EVENTCOUNT >= 2:
- message = event_raw.split(" ", 1)[1]
- for room in this.server.rooms.values():
- for playerCode, client in room.clients.items():
- client.sendPacket("\x1A" + "\x04", ["<font color='#02FB7F'><b>• [Administrador "+this.username+"] "+message+"</b></font>"])
- elif event.startswith("smod "):
- if this.privilegeLevel>=6:
- if EVENTCOUNT >= 2:
- message = event_raw.split(" ", 1)[1]
- for room in this.server.rooms.values():
- for playerCode, client in room.clients.items():
- client.sendPacket("\x1A" + "\x04", ["<font color='#02FB7F'><b>• [Super Moderador "+this.username+"] "+message+"</b></font>"])
- elif event.startswith('respawn ') or event.startswith('revive ') or event.startswith('re '):
- if this.privilegeLevel >= 10 and not this.isMapcrew:
- username = event_raw.split(' ', 1)[1]
- this.room.respawnSpecific(username)
- elif event.startswith('map ') or event.startswith('np '):
- if not this.room.votingMode:
- if this.privilegeLevel >= 3:
- if EVENTCOUNT >= 2:
- mapnumber = event.split(' ', 1)[1]
- if mapnumber.startswith('@'):
- mapnumber = mapnumber.replace('@', '')
- if mapnumber.isdigit():
- this.Database.execute('select * from mapeditor where code = ?', [mapnumber])
- rrf = this.Database.fetchone()
- if rrf is None:
- if this.Langue == 'fr':
- this.sendPacket("\x06\x14", ["1", 'Carte introuvable.'])
- elif this.Langue == 'br':
- this.sendPacket("\x06\x14", ["1", 'Este mapa \xc3\xa9 inv\xc3\xa1lido.'])
- elif this.Langue == 'ru':
- this.sendPacket("\x06\x14", ["1", '\xd0\x92\xd0\xb2\xd0\xb5\xd0\xb4\xd1\x91\xd0\xbd \xd0\xbd\xd0\xb5\xd0\xb2\xd0\xb5\xd1\x80\xd0\xbd\xd1\x8b\xd0\xb9 \xd0\xba\xd0\xbe\xd0\xb4.'])
- elif this.Langue == 'tr':
- this.sendPacket("\x06\x14", ["1", 'Bu harita ge\xc3\xa7ersiz.'])
- elif this.Langue == 'cn':
- this.sendPacket("\x06\x14", ["1", '\xe5\x9c\xb0\xe5\x9b\xbe\xe6\x97\xa0\xe6\x95\x88.'])
- elif this.Langue == 'es':
- this.sendPacket("\x06\x14", ["1", 'Mapa no encontrado.'])
- elif this.Langue == 'en':
- this.sendPacket("\x06\x14", ["1", 'Map not found.'])
- else:
- this.sendPacket("\x06\x14", ["1", 'Map not found.'])
- else:
- this.isDead = True
- this.sendPlayerDied(this.playerCode, this.score)
- this.room.worldChangeSpecific(mapnumber, True)
- elif this.Langue == 'fr':
- this.sendPacket("\x06\x14", ["1", 'Carte introuvable.'])
- elif this.Langue == 'br':
- this.sendPacket("\x06\x14", ["1", 'Este mapa \xc3\xa9 inv\xc3\xa1lido.'])
- elif this.Langue == 'ru':
- this.sendPacket("\x06\x14", ["1", '\xd0\x92\xd0\xb2\xd0\xb5\xd0\xb4\xd1\x91\xd0\xbd \xd0\xbd\xd0\xb5\xd0\xb2\xd0\xb5\xd1\x80\xd0\xbd\xd1\x8b\xd0\xb9 \xd0\xba\xd0\xbe\xd0\xb4.'])
- elif this.Langue == 'tr':
- this.sendPacket("\x06\x14", ["1", 'Bu harita ge\xc3\xa7ersiz.'])
- elif this.Langue == 'cn':
- this.sendPacket("\x06\x14", ["1", '\xe5\x9c\xb0\xe5\x9b\xbe\xe6\x97\xa0\xe6\x95\x88.'])
- elif this.Langue == 'en':
- this.sendPacket("\x06\x14", ["1", 'Map not found.'])
- elif this.Langue == 'es':
- this.sendPacket("\x06\x14", ["1", 'Mapa no encontrado.'])
- else:
- this.sendPacket("\x06\x14", ["1", 'Map not found.'])
- elif mapnumber.isdigit():
- this.isDead = True
- this.sendPlayerDied(this.playerCode, this.score)
- this.room.worldChangeSpecific(mapnumber)
- elif this.room.isTribehouse:
- if event.startswith('np '):
- if this.isInTribe:
- if this.TribeInfo[8] == "1":
- if EVENTCOUNT >= 2:
- mapnumber = event.split(' ', 1)[1]
- if mapnumber.startswith('@'):
- mapnumber = mapnumber.replace('@', '')
- if mapnumber.isdigit():
- this.Database.execute('select * from mapeditor where code = ?', [mapnumber])
- rrf = this.Database.fetchone()
- if rrf is None:
- if this.Langue == 'fr':
- this.sendPacket("\x06\x14", ["1", 'Carte introuvable.'])
- elif this.Langue == 'br':
- this.sendPacket("\x06\x14", ["1", 'Este mapa \xc3\xa9 inv\xc3\xa1lido.'])
- elif this.Langue == 'ru':
- this.sendPacket("\x06\x14", ["1", '\xd0\x92\xd0\xb2\xd0\xb5\xd0\xb4\xd1\x91\xd0\xbd \xd0\xbd\xd0\xb5\xd0\xb2\xd0\xb5\xd1\x80\xd0\xbd\xd1\x8b\xd0\xb9 \xd0\xba\xd0\xbe\xd0\xb4.'])
- elif this.Langue == 'tr':
- this.sendPacket("\x06\x14", ["1", 'Bu harita ge\xc3\xa7ersiz.'])
- elif this.Langue == 'cn':
- this.sendPacket("\x06\x14", ["1", '\xe5\x9c\xb0\xe5\x9b\xbe\xe6\x97\xa0\xe6\x95\x88.'])
- elif this.Langue == 'en':
- this.sendPacket("\x06\x14", ["1", 'Map not found.'])
- elif this.Langue == 'es':
- this.sendPacket("\x06\x14", ["1", 'Mapa no encontrado.'])
- else:
- this.sendPacket("\x06\x14", ["1", 'Map not found.'])
- else:
- this.isDead = True
- this.sendPlayerDied(this.playerCode, this.score)
- this.room.worldChangeSpecific(mapnumber, True)
- elif mapnumber.isdigit():
- if int(mapnumber) in LEVEL_LIST:
- this.isDead = True
- this.sendPlayerDied(this.playerCode, this.score)
- this.room.worldChangeSpecific(mapnumber)
- elif this.Langue == 'fr':
- this.sendPacket("\x06\x14", ["1", 'Carte introuvable.'])
- elif this.Langue == 'br':
- this.sendPacket("\x06\x14", ["1", 'Este mapa \xc3\xa9 inv\xc3\xa1lido.'])
- elif this.Langue == 'ru':
- this.sendPacket("\x06\x14", ["1", '\xd0\x92\xd0\xb2\xd0\xb5\xd0\xb4\xd1\x91\xd0\xbd \xd0\xbd\xd0\xb5\xd0\xb2\xd0\xb5\xd1\x80\xd0\xbd\xd1\x8b\xd0\xb9 \xd0\xba\xd0\xbe\xd0\xb4.'])
- elif this.Langue == 'tr':
- this.sendPacket("\x06\x14", ["1", 'Bu harita ge\xc3\xa7ersiz.'])
- elif this.Langue == 'cn':
- this.sendPacket("\x06\x14", ["1", '\xe5\x9c\xb0\xe5\x9b\xbe\xe6\x97\xa0\xe6\x95\x88.'])
- elif this.Langue == 'en':
- this.sendPacket("\x06\x14", ["1", 'Map not found.'])
- elif this.Langue == 'es':
- this.sendPacket("\x06\x14", ["1", 'Mapa no encontrado.'])
- else:
- this.sendPacket("\x06\x14", ["1", 'Map not found.'])
- elif event.startswith('nspm '):
- if this.privilegeLevel >= 10:
- if EVENTCOUNT >= 2:
- spmid = event.split(' ', 1)[1]
- if spmid.isdigit():
- if int(spmid) in this.server.SPMmaps:
- this.room.worldChangeSpecific(int(spmid), False, True)
- elif event.startswith('npp '):
- if this.privilegeLevel >= 3:
- if EVENTCOUNT >= 2:
- mapnumber = event.split(' ', 1)[1]
- if mapnumber.startswith('@'):
- test = mapnumber.replace('@', '')
- if test.isdigit():
- this.Database.execute('select * from mapeditor where code = ?', [test])
- rrf = this.Database.fetchone()
- if rrf is None:
- if this.Langue == 'fr':
- this.sendPacket("\x06\x14", ["1", 'Carte introuvable.'])
- elif this.Langue == 'br':
- this.sendPacket("\x06\x14", ["1", 'Este mapa \xc3\xa9 inv\xc3\xa1lido.'])
- elif this.Langue == 'ru':
- this.sendPacket("\x06\x14", ["1", '\xd0\x92\xd0\xb2\xd0\xb5\xd0\xb4\xd1\x91\xd0\xbd \xd0\xbd\xd0\xb5\xd0\xb2\xd0\xb5\xd1\x80\xd0\xbd\xd1\x8b\xd0\xb9 \xd0\xba\xd0\xbe\xd0\xb4.'])
- elif this.Langue == 'tr':
- this.sendPacket("\x06\x14", ["1", 'Bu harita ge\xc3\xa7ersiz.'])
- elif this.Langue == 'cn':
- this.sendPacket("\x06\x14", ["1", '\xe5\x9c\xb0\xe5\x9b\xbe\xe6\x97\xa0\xe6\x95\x88.'])
- elif this.Langue == 'en':
- this.sendPacket("\x06\x14", ["1", 'Map not found.'])
- else:
- this.sendPacket("\x06\x14", ["1", 'Map not found.'])
- else:
- this.room.forceNextMap = mapnumber
- this.sendPacket("\x06\x14", ["1", '<VP>Pr\xc3\xb3ximo mapa:<R> ' + this.room.forceNextMap])
- elif this.Langue == 'fr':
- this.sendPacket("\x06\x14", ["1", 'Carte introuvable.'])
- elif this.Langue == 'br':
- this.sendPacket("\x06\x14", ["1", 'Este mapa \xc3\xa9 inv\xc3\xa1lido.'])
- elif this.Langue == 'ru':
- this.sendPacket("\x06\x14", ["1", '\xd0\x92\xd0\xb2\xd0\xb5\xd0\xb4\xd1\x91\xd0\xbd \xd0\xbd\xd0\xb5\xd0\xb2\xd0\xb5\xd1\x80\xd0\xbd\xd1\x8b\xd0\xb9 \xd0\xba\xd0\xbe\xd0\xb4.'])
- elif this.Langue == 'tr':
- this.sendPacket("\x06\x14", ["1", 'Bu harita ge\xc3\xa7ersiz.'])
- elif this.Langue == 'cn':
- this.sendPacket("\x06\x14", ["1", '\xe5\x9c\xb0\xe5\x9b\xbe\xe6\x97\xa0\xe6\x95\x88.'])
- elif this.Langue == 'en':
- this.sendPacket("\x06\x14", ["1", 'Map not found.'])
- else:
- this.sendPacket("\x06\x14", ["1", 'Map not found.'])
- elif mapnumber.isdigit():
- this.room.forceNextMap = mapnumber
- this.sendPacket("\x06\x14", ["1", '<VP>Pr\xc3\xb3ximo mapa:<R> ' + this.room.forceNextMap])
- elif this.room.isTribehouse:
- if EVENTCOUNT >= 2:
- mapnumber = event.split(' ', 1)[1]
- if mapnumber.startswith('@'):
- test = mapnumber.replace('@', '')
- if test.isdigit():
- this.Database.execute('select * from mapeditor where code = ?', [test])
- rrf = this.Database.fetchone()
- if rrf is None:
- if this.Langue == 'fr':
- this.sendPacket("\x06\x14", ["1", 'Carte introuvable.'])
- elif this.Langue == 'br':
- this.sendPacket("\x06\x14", ["1", 'Este mapa \xc3\xa9 inv\xc3\xa1lido.'])
- elif this.Langue == 'ru':
- this.sendPacket("\x06\x14", ["1", '\xd0\x92\xd0\xb2\xd0\xb5\xd0\xb4\xd1\x91\xd0\xbd \xd0\xbd\xd0\xb5\xd0\xb2\xd0\xb5\xd1\x80\xd0\xbd\xd1\x8b\xd0\xb9 \xd0\xba\xd0\xbe\xd0\xb4.'])
- elif this.Langue == 'tr':
- this.sendPacket("\x06\x14", ["1", 'Bu harita ge\xc3\xa7ersiz.'])
- elif this.Langue == 'cn':
- this.sendPacket("\x06\x14", ["1", '\xe5\x9c\xb0\xe5\x9b\xbe\xe6\x97\xa0\xe6\x95\x88.'])
- elif this.Langue == 'en':
- this.sendPacket("\x06\x14", ["1", 'Map not found.'])
- elif this.Langue == 'es':
- this.sendPacket("\x06\x14", ["1", 'Mapa no encontrado.'])
- else:
- this.sendPacket("\x06\x14", ["1", 'Map not found.'])
- else:
- this.room.forceNextMap = mapnumber
- this.sendPacket('\x06' + '\x14', ["1", 'Next map : ' + this.room.forceNextMap])
- elif this.Langue == 'fr':
- this.sendPacket("\x06\x14", ["1", 'Carte introuvable.'])
- elif this.Langue == 'br':
- this.sendPacket("\x06\x14", ["1", 'Este mapa \xc3\xa9 inv\xc3\xa1lido.'])
- elif this.Langue == 'ru':
- this.sendPacket("\x06\x14", ["1", '\xd0\x92\xd0\xb2\xd0\xb5\xd0\xb4\xd1\x91\xd0\xbd \xd0\xbd\xd0\xb5\xd0\xb2\xd0\xb5\xd1\x80\xd0\xbd\xd1\x8b\xd0\xb9 \xd0\xba\xd0\xbe\xd0\xb4.'])
- elif this.Langue == 'tr':
- this.sendPacket("\x06\x14", ["1", 'Bu harita ge\xc3\xa7ersiz.'])
- elif this.Langue == 'cn':
- this.sendPacket("\x06\x14", ["1", '\xe5\x9c\xb0\xe5\x9b\xbe\xe6\x97\xa0\xe6\x95\x88.'])
- elif this.Langue == 'en':
- this.sendPacket("\x06\x14", ["1", 'Map not found.'])
- elif this.Langue == 'es':
- this.sendPacket("\x06\x14", ["1", 'Mapa no encontrado.'])
- else:
- this.sendPacket("\x06\x14", ["1", 'Map not found.'])
- elif mapnumber.isdigit():
- if int(mapnumber) in LEVEL_LIST:
- this.room.forceNextMap = mapnumber
- this.sendPacket("\x06\x14", ["1", 'Next map : ' + this.room.forceNextMap])
- elif this.Langue == 'fr':
- this.sendPacket("\x06\x14", ["1", 'Carte introuvable.'])
- elif this.Langue == 'br':
- this.sendPacket("\x06\x14", ["1", 'Este mapa \xc3\xa9 inv\xc3\xa1lido.'])
- elif this.Langue == 'ru':
- this.sendPacket("\x06\x14", ["1", '\xd0\x92\xd0\xb2\xd0\xb5\xd0\xb4\xd1\x91\xd0\xbd \xd0\xbd\xd0\xb5\xd0\xb2\xd0\xb5\xd1\x80\xd0\xbd\xd1\x8b\xd0\xb9 \xd0\xba\xd0\xbe\xd0\xb4.'])
- elif this.Langue == 'tr':
- this.sendPacket("\x06\x14", ["1", 'Bu harita ge\xc3\xa7ersiz.'])
- elif this.Langue == 'cn':
- this.sendPacket("\x06\x14", ["1", '\xe5\x9c\xb0\xe5\x9b\xbe\xe6\x97\xa0\xe6\x95\x88.'])
- elif this.Langue == 'en':
- this.sendPacket("\x06\x14", ["1", 'Map not found.'])
- elif this.Langue == 'es':
- this.sendPacket("\x06\x14", ["1", 'Mapa no encontrado.'])
- else:
- this.sendPacket("\x06\x14", ["1", 'Map not found.'])
- elif event.startswith('shamperf '):
- if this.privilegeLevel >= 5:
- if EVENTsCOUNT >= 3:
- _, hname, hsaves = event_raw.split(' ', 2)
- this.sendShamanPerformance(hname, hsaves)
- elif event.startswith('music ') or event.startswith('musique '):
- if this.privilegeLevel >= 4 and not this.isMapcrew:
- if EVENTCOUNT >= 2:
- _, url = event_raw.split(' ', 1)
- this.sendPlayMusic(url)
- elif this.room.isTribehouse:
- if event.startswith('musique ') or event.startswith('music '):
- if this.isInTribe:
- if this.TribeInfo[7] == "1":
- if EVENTCOUNT >= 2:
- _, url = event_raw.split(' ', 1)
- this.sendPlayMusic(url)
- elif event.startswith('log '):
- if this.privilegeLevel >= 5 and not this.isMapcrew:
- if EVENTCOUNT == 2:
- username = event_raw.split(' ', 1)[1]
- if username.isalpha:
- username = username.lower().capitalize()
- loglist = []
- this.Database.execute('select * from BanLog where name = ?', [username])
- rrfRows = this.Database.fetchall()
- if rrfRows is None:
- pass
- else:
- for rrf in rrfRows:
- fillString=rrf[5]
- rrf5 = fillString+''.join(["0" for x in range(len(fillString),13)])
- if rrf[6]=="Unban":
- loglist = loglist+[rrf[1], "", rrf[2], "", "", rrf5]
- else:
- loglist = loglist+[rrf[1], rrf[8], rrf[2], rrf[3], rrf[4], rrf5]
- this.sendPacket('\x1a' + '\x17', loglist)
- elif event.startswith('freefresas '):
- if this.privilegeLevel >= 8:
- if EVENTCOUNT >= 2:
- amount = event_raw.split(' ', 1)[1]
- for room in this.server.rooms.values():
- for client in room.clients.values():
- client.shopfraises += int(amount)
- if client.shopfraises >= 9999999:
- client.shopfraises = 9999999
- client.sendPacket('\x06\x14', ["1", '<N>As ganado <J>%s <N>Fresas en la tienda.' % amount])
- elif event.startswith('freecheese '):
- if this.privilegeLevel >= 8:
- if EVENTCOUNT >= 2:
- amount = event_raw.split(' ', 1)[1]
- for room in this.server.rooms.values():
- for client in room.clients.values():
- client.shopcheese += int(amount)
- if client.shopcheese >= 9999999:
- client.shopcheese = 9999999
- client.sendPacket('\x06\x14', ["1", '<N>As ganado <J>%s <N>Quesos en la tienda.' % amount])
- elif event.startswith('freecoins '):
- if this.privilegeLevel >= 8:
- if EVENTCOUNT >= 2:
- amount = event_raw.split(' ', 1)[1]
- for room in this.server.rooms.values():
- for client in room.clients.values():
- client.shopcoins += int(amount)
- if client.shopcoins >= 9999999:
- client.shopcoins = 9999999
- client.sendPacket('\x06\x14', ["1", '<N>As ganado <J>%s <N>Monedas.' % amount])
- elif event.startswith('freesaves '):
- if this.privilegeLevel >= 8:
- if EVENTCOUNT >= 2:
- amount = event_raw.split(' ', 1)[1]
- for room in this.server.rooms.values():
- for client in room.clients.values():
- client.micesaves += int(amount)
- if client.micesaves >= 9999999:
- client.micesaves = 9999999
- client.sendPacket('\x06\x14', ["1", '<N>As ganado <J>%s <N>Saves.' % amount])
- elif event.startswith('freebc '):
- if this.privilegeLevel >= 8:
- if EVENTCOUNT >= 2:
- amount = event_raw.split(' ', 1)[1]
- for room in this.server.rooms.values():
- for client in room.clients.values():
- client.bootcampcount += int(amount)
- if client.bootcampcount >= 9999999:
- client.bootcampcount = 9999999
- client.sendPacket('\x06\x14', ["1", '<N>As ganado <J>%s <N>Boootcamps.' % amount])
- elif event.startswith('freequesos '):
- if this.privilegeLevel >= 8:
- if EVENTCOUNT >= 2:
- amount = event_raw.split(' ', 1)[1]
- for room in this.server.rooms.values():
- for client in room.clients.values():
- client.cheesecount += int(amount)
- if client.cheesecount >= 9999999:
- client.cheesecount = 9999999
- client.sendPacket('\x06\x14', ["1", '<N>As ganado <J>%s <N>Quesos.' % amount])
- elif event.startswith('freefirst '):
- if this.privilegeLevel >= 8:
- if EVENTCOUNT >= 2:
- amount = event_raw.split(' ', 1)[1]
- for room in this.server.rooms.values():
- for client in room.clients.values():
- client.firstcount += int(amount)
- if client.firstcount >= 9999999:
- client.firstcount = 9999999
- client.sendPacket('\x06\x14', ["1", '<N>As ganado <J>%s <N>Firsts.' % amount])
- elif event.startswith('gravity '):
- if this.privilegeLevel >= 10:
- if EVENTCOUNT >= 2:
- _, arg1, arg2 = event_raw.split(' ', 2)
- for playerCode, client in this.room.clients.items():
- client.sendPacket('\x05' + '\x16', [arg1, arg2])
- #Brasilero
- elif event.startswith('ratocor '):
- if this.privilegeLevel >= 1:
- color = event_raw.split(' ', 1)[1]
- colors = {'azul': '025BF5', 'amarelo': 'F3FA1E', 'rosa': 'D968C8', 'verde': '11F58B', 'cinza': '575355', 'vermelho': 'FA0526', 'laranja': 'FAA405', 'lila': 'CFC5E8', 'azulclaro': '05F6FA', 'roxo': '7900FF', 'verdeescuro': '07E8BF', 'preto': '000001', 'verdeclaro': 'B6FCC4'}
- for k, v in colors.items():
- if k == color:
- this.sendPacket('\x06' + '\x14', ["<font color='#00C0FF'>Seu color e: %s</font>" % k])
- this.color1 = v
- break
- #Ingles
- elif event.startswith('mousecolor '):
- if this.privilegeLevel >= 1:
- color = event_raw.split(' ', 1)[1]
- colors = {'blue': '025BF5', 'yellow': 'F3FA1E', 'pink': 'D968C8', 'green': '11F58B', 'cinza': '575355', 'red': 'FA0526', 'orange': 'FAA405', 'skyblue': '05F6FA', 'violet': '7900FF', 'black': '000001'}
- for k, v in colors.items():
- if k == color:
- this.sendPacket('\x06' + '\x14', ["<font color='#00C0FF'>You color is: %s</font>" % k])
- this.color1 = v
- break
- #Español
- elif event.startswith('ratoncolor '):
- if this.privilegeLevel >= 1:
- color = event_raw.split(' ', 1)[1]
- colors = {'azul': '025BF5', 'amarillo': 'F3FA1E', 'rosa': 'D968C8', 'verde': '11F58B', 'cinza': '575355', 'rojo': 'FA0526', 'naranja': 'FAA405', 'lilas': 'CFC5E8', 'azulclaro': '05F6FA', 'violeta': '7900FF', 'verdeescuro': '07E8BF', 'negro': '000001', 'verdeclaro': 'B6FCC4'}
- for k, v in colors.items():
- if k == color:
- this.sendPacket('\x06' + '\x14', ["<font color='#00C0FF'>Tu color sera: %s</font>" % k])
- this.color1 = v
- break
- #Ingles
- elif event.startswith('colorchat '):
- if this.privilegeLevel >= 1:
- color = event_raw.split(' ', 1)[1]
- colors = {'blue': '025BF5', 'yellow': 'F3FA1E', 'pink': 'D968C8', 'green': '11F58B', 'cinza': '575355', 'red': 'FA0526', 'orange': 'FAA405', 'skyblue': '05F6FA', 'violet': '7900FF', 'black': '000001'}
- for k, v in colors.items():
- if k == color:
- this.sendPacket('\x06' + '\x14', ["<font color='#00C0FF'>You chat color is:<ROSE> %s</font>" % k])
- this.chatcolor = v
- break
- #Brasilero
- elif event.startswith('colorchat '):
- if this.privilegeLevel >= 1:
- color = event_raw.split(' ', 1)[1]
- colors = {'azul': '025BF5', 'amarelo': 'F3FA1E', 'rosa': 'D968C8', 'verde': '11F58B', 'cinza': '575355', 'vermelho': 'FA0526', 'laranja': 'FAA405', 'lila': 'CFC5E8', 'azulclaro': '05F6FA', 'roxo': '7900FF', 'verdeescuro': '07E8BF', 'preto': '000001', 'verdeclaro': 'B6FCC4'}
- for k, v in colors.items():
- if k == color:
- this.sendPacket('\x06' + '\x14', ["<font color='#00C0FF'>Seu cor de chat e:<ROSE> %s</font>" % k])
- this.chatcolor = v
- break
- #Español
- elif event.startswith('colorchat '):
- if this.privilegeLevel >= 1:
- color = event_raw.split(' ', 1)[1]
- colors = {'azul': '025BF5', 'amarillo': 'F3FA1E', 'rosa': 'D968C8', 'verde': '11F58B', 'cinza': '575355', 'rojo': 'FA0526', 'naranja': 'FAA405', 'lilas': 'CFC5E8', 'azulclaro': '05F6FA', 'violeta': '7900FF', 'verdeescuro': '07E8BF', 'negro': '000001', 'verdeclaro': 'B6FCC4'}
- for k, v in colors.items():
- if k == color:
- this.sendPacket('\x06' + '\x14', ["<font color='#00C0FF'>Tu color de chat sera:<ROSE> %s</font>" % k])
- this.chatcolor = v
- break
- #Español
- elif event.startswith('nombrecolor '):
- if this.privilegeLevel >= 1:
- color = event_raw.split(' ', 1)[1]
- colors = {'azul': '025BF5', 'amarillo': 'F3FA1E', 'rosa': 'D968C8', 'verde': '11F58B', 'cinza': '575355', 'rojo': 'FA0526', 'naranja': 'FAA405', 'lilas': 'CFC5E8', 'azulclaro': '05F6FA', 'violeta': '7900FF', 'verdeescuro': '07E8BF', 'negro': '000001', 'verdeclaro': 'B6FCC4'}
- for k, cor in colors.items():
- if k == color:
- this.sendPacket('\x06\x14', ['<VP>Tu color de nombre sera <BV> [%s]' % k])
- hexcolor = struct.pack('!i', int(cor, 16))
- this.room.sendAllBin('\x1d\x04', struct.pack('!i', int(this.playerCode)) + hexcolor)
- break
- #Ingles
- elif event.startswith('namecolor '):
- if this.privilegeLevel >= 1:
- color = event_raw.split(' ', 1)[1]
- colors = {'blue': '025BF5', 'yellow': 'F3FA1E', 'pink': 'D968C8', 'green': '11F58B', 'cinza': '575355', 'red': 'FA0526', 'orange': 'FAA405', 'skyblue': '05F6FA', 'violet': '7900FF', 'black': '000001'}
- for k, cor in colors.items():
- if k == color:
- this.sendPacket('\x06\x14', ['<VP>You name color is <BV> [%s]' % k])
- hexcolor = struct.pack('!i', int(cor, 16))
- this.room.sendAllBin('\x1d\x04', struct.pack('!i', int(this.playerCode)) + hexcolor)
- break
- #Brasilero
- elif event.startswith('nomecor '):
- if this.privilegeLevel >= 1:
- color = event_raw.split(' ', 1)[1]
- colors = {'azul': '025BF5', 'amarelo': 'F3FA1E', 'rosa': 'D968C8', 'verde': '11F58B', 'cinza': '575355', 'vermelho': 'FA0526', 'laranja': 'FAA405', 'lila': 'CFC5E8', 'azulclaro': '05F6FA', 'roxo': '7900FF', 'verdeescuro': '07E8BF', 'preto': '000001', 'verdeclaro': 'B6FCC4'}
- for k, cor in colors.items():
- if k == color:
- this.sendPacket('\x06\x14', ['<VP>Seu cor de nome e <BV> [%s]' % k])
- hexcolor = struct.pack('!i', int(cor, 16))
- this.room.sendAllBin('\x1d\x04', struct.pack('!i', int(this.playerCode)) + hexcolor)
- break
- elif event.startswith('teleport '):
- if this.privilegeLevel >= 10:
- x, y = event_raw.split(' ', 2)[1:]
- this.sendPacket('\x08\x03' + struct.pack('!hhbhhb', int(x), int(y), 0, 0, 0, 0), [], True)
- elif event.startswith('setting '):
- if this.privilegeLevel == 10 and not this.isMapcrew:
- if EVENTCOUNT >= 3:
- _, setting, value = event_raw.split(' ', 2)
- this.Database.execute('select value from settings where setting = ?', [setting])
- rrf = this.Database.fetchone()
- if rrf is None:
- this.sendPacket("\x06\x14", ["1", '<R>Essa Configura\xc3\xa7\xc3\xa3o N\xc3\xa3o Existe.'])
- else:
- this.Database.execute('UPDATE settings SET value = ? WHERE setting = ?', [value, setting])
- sthis.sendPacket("\x06\x14", ["1", 'Alterada Com Sucesso ' + str(setting) + ' Com Valor: ' + str(value) + '.'])
- elif event.startswith('enviarmap '):
- if this.privilegeLevel >= 1:
- message = event_raw.split(' ', 1)[1]
- this.sendMessage('<N>[Info] <J>Mapa enviado com sucesso! Aguarde ser avaliado pela modera\xc3\xa7\xc3\xa3o.')
- this.server.sendModChat(this, '\x06\x14', ["1", "<font color='#00C0FF'>[</font><J>" + this.username + "<N><font color='#00C0FF'>] Enviou um mapa para avalia\xc3\xa7\xc3\xa3o:</font><V> [" + message + ']'])
- msg = str(str(this.username) + ' [' + str(this.address) + '] enviou o mapa: ' + message)
- this.salvarLog('avaliaMap', msg)
- elif event.startswith('newsetting '):
- if this.privilegeLevel >= 10 and not this.isMapcrew:
- if EVENTCOUNT >= 3:
- _, setting, value = event_raw.split(' ', 2)
- this.Database.execute('INSERT INTO settings (setting, value) values (?, ?)', (setting, value))
- this.sendPacket("\x06\x14", ["1", 'Criado Com Sucesso ' + str(setting) + ' Como Valor: ' + str(value) + '.'])
- elif event.startswith('join '):
- if this.privilegeLevel >= 5 and not this.isMapcrew:
- if EVENTCOUNT >= 2:
- username = event_raw.split(' ', 1)[1]
- username = username.lower().capitalize()
- if this.room.checkRoomInvite(this, username):
- this.enterRoom('\x03[Private] ' + username)
- elif this.privilegeLevel >= 4:
- this.enterRoom('\x03[Private] ' + username)
- elif event.startswith('mjoin '):
- if this.privilegeLevel >= 5 and not this.isMapcrew:
- if EVENTCOUNT >= 2:
- username = event_raw.split(' ', 1)[1]
- if not username.startswith('*'):
- username = username.lower().capitalize()
- room = this.server.getFindPlayerRoom(username)
- if room:
- if room.startswith(this.Langue + '_' + '\x03' + '[Editeur] '):
- pass
- elif room.startswith(this.Langue + '_' + '\x03' + '[Totem] '):
- pass
- else:
- this.enterRoom(room)
- elif event.startswith('move '):
- if this.privilegeLevel >= 5 and not this.isMapcrew:
- if EVENTCOUNT >= 2:
- playerName = event_raw.split(' ', 1)[1]
- this.room.moveAllRoomClients(playerName, False)
- elif event.startswith('del ') or event.startswith('p44 '):
- if this.isMapCrew or this.privilegeLevel == 10:
- if EVENTCOUNT == 2:
- _, mapCode = event_raw.split(' ', 2)
- if mapCode.startswith('@'):
- mapCode = mapCode[1:]
- this.Database.execute('UPDATE mapeditor SET deleted = ? WHERE code = ?', ['1', mapCode])
- this.Database.execute('UPDATE mapeditor SET perma = ? WHERE code = ?', ['44', mapCode])
- this.sendPacket("\x06\x14", ["1", '<J>this map was removed from rotation.'])
- this.server.sendMappersChat(this, '\x06\x14', ["1", this.username + ' Removeu o Mapa ' + str(this.server.getMapName(this.room.ISCM)) + '-@' + str(this.room.ISCM) + ' de Rota\xc3\xa7\xc3\xa3o.'])
- elif eventToken1 == '\x05':
- if eventToken2 == '\x07':
- this.room.sendAll(eventTokens, values)
- elif eventToken2 == '\x08':
- if not this.isDead:
- if this.room.isMiniGame:
- try:
- objectType, xPosition, yPosition, angle = values
- this.room.GameScript.eventSummoningStart(this.username, objectType, xPosition, yPosition, angle)
- except:
- pass
- this.room.sendAll(eventTokens, [this.playerCode] + values)
- if this.isAfk:
- this.isAfk = False
- elif eventToken2 == '\t':
- if this.room.isMiniGame:
- try:
- this.room.GameScript.eventSummoningCancel(this.username)
- except:
- pass
- this.room.sendAll(eventTokens, [this.playerCode])
- elif eventToken2 == '\x0e':
- this.room.sendAll(eventTokens, values)
- elif eventToken2 == '\r':
- code, x, y = values
- if this.room.isTotemEditeur:
- if this.LoadCountTotem == False:
- this.room.identifiantTemporaire = 0
- this.LoadCountTotem = True
- if not this.room.identifiantTemporaire > 20:
- if code == '11' or code == '12' or code == '13':
- if re.search('#3#11\x01', this.Totem[1]):
- pass
- elif re.search('#3#12\x01', this.Totem[1]):
- pass
- elif re.search('#3#13\x01', this.Totem[1]):
- pass
- else:
- this.room.identifiantTemporaire += 1
- this.sendTotemItemCount(this.room.identifiantTemporaire)
- this.Totem[0] = this.room.identifiantTemporaire
- this.Totem[1] = this.Totem[1] + '#3#' + str(int(code)) + '\x01' + str(int(x)) + '\x01' + str(int(y))
- else:
- this.room.identifiantTemporaire += 1
- this.sendTotemItemCount(this.room.identifiantTemporaire)
- this.Totem[0] = this.room.identifiantTemporaire
- this.Totem[1] = this.Totem[1] + '#3#' + str(int(code)) + '\x01' + str(int(x)) + '\x01' + str(int(y))
- elif eventToken2 == '\x0f':
- this.room.sendAll(eventTokens, values)
- elif eventToken2 == '\x10':
- if this.isSyncroniser:
- this.room.sendAll(eventTokens, values)
- elif eventToken2 == '\x11':
- this.room.sendAll(eventTokens, values)
- elif eventToken2 == '\x16':
- if this.isSyncroniser:
- this.room.sendAll(eventTokens, values)
- elif eventToken1 == '\x14':
- if eventToken2 == '\x14':
- this.sendPacket('\x14' + '\x14', [str(this.shopcheese), this.shoplist, this.look, this.shopitems])
- elif eventToken1 == '\x08':
- if eventToken2 == '\x10':
- this.room.sendAll(eventTokens, values)
- elif eventToken2 == '\x11':
- this.room.sendAll('\x08\x10', [this.playerCode, '0'])
- elif eventToken1 == '\x19':
- if eventToken2 == '\x03':
- if this.privilegeLevel != 10:
- this.sendPlayerDisconnect(this.playerCode)
- this.room.removeClient(this)
- message = '[' + this.address[0] + ' - ' + this.username + '] Tentou Limpar o Desenho.'
- this.sendModMessageChannel('Hack Detect', message)
- this.transport.loseConnection()
- else:
- this.room.sendAll(eventTokens, values)
- elif eventToken2 == '\x04':
- if this.privilegeLevel != 10:
- this.sendPlayerDisconnect(this.playerCode)
- this.room.removeClient(this)
- message = '[' + this.address[0] + ' - ' + this.username + '] Tentativa de Desenhar.'
- this.sendModMessageChannel('Hack Detect', message)
- this.transport.loseConnection()
- else:
- this.room.sendAllOthers(this, eventTokens, values)
- elif eventToken2 == '\x05':
- if this.privilegeLevel != 10:
- this.sendPlayerDisconnect(this.playerCode)
- this.room.removeClient(this)
- message = '[' + this.address[0] + ' - ' + this.username + '] Tentativa de Desenhar.'
- this.sendModMessageChannel('Hack Detect', message)
- this.transport.loseConnection()
- else:
- this.room.sendAllOthers(this, eventTokens, values)
- elif eventToken1 == '\x0e':
- if eventToken2 == '\x1a':
- this.sendPacket('\x0e' + '\x0e', ['0'])
- this.room.isEditeur = False
- this.enterRoom(this.server.recommendRoom(this.Langue))
- elif eventToken2 == '\x04':
- if not this.Voted and not this.SPEC and this.room.votingMode and this.QualifiedVoter:
- if len(values) == 1:
- if int(values[0]) == 1:
- this.Voted = True
- this.room.recievedYes += 1
- elif len(values) == 0:
- this.Voted = True
- this.room.recievedNo += 1
- elif eventToken2 == '\x06':
- code = values[0]
- if this.privilegeLevel >= 5:
- if str(code).isdigit():
- this.Database.execute('select * from mapeditor where code = ?', [code])
- rrf = this.Database.fetchone()
- if rrf is None:
- this.sendPacket('\x0e' + '\x08', [])
- else:
- this.sendLoadMapAtCode(rrf[0], rrf[1], rrf[2], rrf[3], rrf[4], rrf[5])
- this.room.ISCMVdata[2] = rrf[2]
- this.room.ISCMVdata[1] = rrf[0]
- this.room.ISCMVdata[7] = rrf[5]
- this.room.ISCMVloaded = int(code)
- else:
- this.sendPacket('\x0e' + '\x08', [])
- elif str(code).isdigit():
- this.Database.execute('select * from mapeditor where code = ?', [code])
- rrf = this.Database.fetchone()
- if rrf is None:
- this.sendPacket('\x0e' + '\x08', [])
- elif rrf[0] == this.username:
- this.sendLoadMapAtCode(rrf[0], rrf[1], rrf[2], rrf[3], rrf[4], rrf[5])
- this.room.ISCMVdata[2] = rrf[2]
- this.room.ISCMVloaded = int(code)
- else:
- this.sendPacket('\x0e' + '\x08', [])
- else:
- this.sendPacket('\x0e' + '\x08', [])
- elif eventToken2 == '\n':
- mapxml = values[0]
- if this.checkValidXML(mapxml):
- this.sendPacket('\x0e' + '\x0e', [''])
- this.room.ISCMV = 1
- this.room.ISCMVdata = [1, '-', mapxml, 0, 0, 0, 0, 0]
- this.room.killAllNoDie()
- elif eventToken2 == '\x0e':
- this.room.ISCMV = 0
- this.sendPacket('\x0e' + '\x0e', ['', ''])
- elif eventToken2 == '\x0b':
- if this.cheesecount < this.server.EditeurCheese:
- this.sendNotEnoughTotalCheeseEditeur()
- elif this.shopcheese < this.server.EditorShopCheese and not this.privilegeLevel in [10, 8, 6, 5, 4, 3]:
- this.sendNotEnoughCheeseEditeur()
- elif not this.checkValidXML(values[0]):
- pass
- else:
- if not this.privilegeLevel in [10, 8, 6, 5, 4, 3]:
- this.shopcheese = this.shopcheese - this.server.EditorShopCheese
- if this.room.ISCMVloaded != 0:
- code = this.room.ISCMVloaded
- this.Database.execute('UPDATE mapeditor SET mapxml = ? WHERE code = ?', [values[0], int(code)])
- else:
- code = int(this.server.getServerSetting('LastEditorMapCode')) + 1
- this.Database.execute('INSERT INTO mapeditor (name, code, mapxml, yesvotes, novotes, perma, deleted) values (?, ?, ?, ?, ?, ?, ?)', (this.username, code, values[0], 0, 0, '22', '0'))
- this.Database.execute('UPDATE settings SET value = ? WHERE setting = ?', [str(code), 'LastEditorMapCode'])
- this.sendPacket('\x0e' + '\x0e', ['0'])
- this.enterRoom(this.server.recommendRoom(this.Langue))
- this.sendMapExported(code)
- elif eventToken2 == '\x12':
- if this.cheesecount < this.server.EditeurCheese:
- this.sendNotEnoughTotalCheeseEditeur()
- elif this.shopcheese < this.server.EditorShopCheese and not this.privilegeLevel in [3, 4, 5, 6, 8, 10]:
- this.sendNotEnoughCheeseEditeur()
- elif this.room.ISCMVdata[7] != 1:
- pass
- elif not this.checkValidXML(this.room.ISCMVdata[2]):
- pass
- else:
- if not this.privilegeLevel in [3, 4, 5, 6, 8, 10]:
- this.shopcheese = this.shopcheese - this.server.EditorShopCheese
- if this.room.ISCMVloaded != 0:
- code = this.room.ISCMVloaded
- this.Database.execute('UPDATE mapeditor SET mapxml = ? WHERE code = ?', [this.room.ISCMVdata[2], int(code)])
- else:
- code = int(this.server.getServerSetting('LastEditorMapCode')) + 1
- this.Database.execute('INSERT INTO mapeditor (name, code, mapxml, yesvotes, novotes, perma, deleted) values (?, ?, ?, ?, ?, ?, ?)', (this.username, code, this.room.ISCMVdata[2], 0, 0, '0', '0'))
- this.Database.execute('UPDATE settings SET value = ? WHERE setting = ?', [str(code), 'LastEditorMapCode'])
- this.sendPacket('\x0e' + '\x0e', ['0'])
- this.enterRoom(this.server.recommendRoom(this.Langue))
- this.sendMapExported(code)
- elif eventToken2 == '\x13':
- this.room.ISCMVloaded = 0
- return None
Advertisement
Add Comment
Please, Sign In to add comment