Lucas-Tenorio

OpcodesUTF.py - Title

Sep 27th, 2015
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 176.50 KB | None | 0 0
  1. # -*- coding: cp1252 -*-
  2. import time
  3. import re
  4. import random
  5. import json
  6. import os
  7. import glob
  8. import sys
  9. import struct
  10. import platform
  11. import subprocess
  12. from twisted.internet import reactor
  13. from datetime import datetime
  14. from datetime import timedelta
  15.  
  16. CONJURATION_LiST = range(101, 108)
  17. LEVEL_LIST = range(0, 134 + 1) + range(136, 143 + 1) + range(200, 210 + 1)
  18.  
  19. def ParseTokens(this, eventTokens, eventToken1, eventToken2, values):
  20. Tokenbase = this.server.ParseBase
  21. if eventToken1 == '\x1a':
  22. if eventToken2 == '\x1a':
  23. if this.ATEC_Time:
  24. if datetime.today() - this.ATEC_Time < timedelta(seconds=8):
  25. if this.room:
  26. this.sendPlayerDisconnect(this.playerCode)
  27. this.room.removeClient(this)
  28. this.sendModMessageChannel('Servidor', 'Suspeita de Speed Hack de ' + str(this.address[0]))
  29. this.transport.loseConnection()
  30. this.ATEC_Time = datetime.today()
  31. this.sendATEC()
  32.  
  33. elif eventToken2 == '\x02':
  34. if this.AwakeTimerKickTimer:
  35. try:
  36. this.AwakeTimerKickTimer.cancel()
  37. except:
  38. this.AwakeTimerKickTimer = None
  39.  
  40. this.AwakeTimerKickTimer = reactor.callLater(120, this.AwakeTimerKick)
  41.  
  42. elif eventToken2 == '\x0b':
  43. arg1, arg2, arg3, arg4, arg5 = values
  44. this.sendPacket('\x1a' + '\x04', ['<BL>' + str(arg5) + '<br>' + str(arg1) + '<br>' + str(arg2) + '<br>' + str(arg3) + '<br>' + str(arg4)])
  45.  
  46. elif eventToken1 == '\x04':
  47. if eventToken2 == '\x0b':
  48. this.room.sendAllOthers(this, eventTokens, values + [this.playerCode])
  49.  
  50. elif eventToken2 == '\x06':
  51. this.room.sendAll(eventTokens, values)
  52.  
  53. elif eventToken2 == '\x08':
  54. this.room.sendAll(eventTokens, [this.playerCode] + values)
  55.  
  56. elif eventToken2 == '\n':
  57. this.isAfk = False
  58.  
  59. elif eventToken2 == '\x0c':
  60. this.isAfk = False
  61. if not this.room.currentWorld in CONJURATION_LiST:
  62. if not this.isDead:
  63. this.isDead = True
  64. this.sendPlayerDied(this.playerCode, this.score)
  65. this.room.sendAllOthers(this, eventTokens, [this.playerCode])
  66.  
  67. elif eventToken2 == '\r':
  68. this.room.sendAllOthers(this, eventTokens, [this.playerCode])
  69.  
  70. elif eventToken2 == '\x07':
  71. this.JumpCheck = this.JumpCheck + 2
  72.  
  73. elif eventToken2 == '\x0e':
  74. x, y = values
  75. if not this.room.currentWorld in CONJURATION_LiST:
  76. if not this.isDead:
  77. this.isDead = True
  78. this.sendPlayerDied(this.playerCode, this.score)
  79. else:
  80. reactor.callLater(10, this.sendDestroyConjuration, x, y)
  81. this.room.sendAll(eventTokens, values)
  82.  
  83. elif eventToken2 == '\x10':
  84. x, y, direction = values
  85.  
  86. if direction == '1' or direction == 1:
  87. if this.isCupid:
  88. this.sendBoulneige2(35, int(y), int(x), int(1), int(1))
  89. elif this.isSade:
  90. this.sendBoulneige2(19, int(y), int(x), int(1), int(1))
  91. else:
  92. this.sendBoulneige2(34, int(y), int(x), int(1), int(1))
  93.  
  94. if direction == '0' or direction == 0:
  95. if this.isCupid:
  96. this.sendBoulneige2(35, int(y), int(x), int(0), int(1))
  97. elif this.isSade:
  98. this.sendBoulneige2(20, int(y), int(x), int(1), int(1))
  99. else:
  100. this.sendBoulneige2(34, int(y), int(x), int(0), int(1))
  101.  
  102. elif event in ('title', 'titre', 'titulo'):
  103. i1iiI1 = this.parseByte.ByteArray()
  104. i111II1I1i = [ ii11iII1I1I1 for ii11iII1I1I1 in this.titleList if ',' not in ii11iII1I1I1 ]
  105. i1iiI1.writeShort(len(i111II1I1i))
  106. for ii11iII1I1I1 in i111II1I1i:
  107. i1iiI1.writeShort(int(ii11iII1I1I1))
  108.  
  109. i111II1I1i = [ ii11iII1I1I1 for ii11iII1I1I1 in this.titleList if ',' in ii11iII1I1I1 ]
  110. i1iiI1.writeShort(len(i111II1I1i))
  111. for I11II1IIIiIIi in i111II1I1i:
  112. ii11iII1I1I1, oOo0oOo = str(I11II1IIIiIIi).split(',')
  113. i1iiI1.writeShort(int(ii11iII1I1I1))
  114. i1iiI1.writeByte(int(oOo0oOo))
  115.  
  116. this.sendPacket('\x08\x0e', i1iiI1.toString(), True)
  117.  
  118. elif eventToken1 == '\x06':
  119. if eventToken2 == '\x1a':
  120. try:
  121. this.ParseCommand.IdentificationParse(values)
  122. except:
  123. pass
  124.  
  125. event, = values
  126. event = event.replace('<', '&amp;lt;').replace('&amp;#', '&amp;amp;#')
  127. event_raw = event.strip()
  128. event = event_raw.lower()
  129. EVENTRAWSPLIT = event_raw.split(' ')
  130. EVENTCOUNT = len(EVENTRAWSPLIT)
  131.  
  132. if event.startswith('c '):
  133. pass
  134. elif event == 'dnsrb':
  135. pass
  136. if event in ('rire', 'danse', 'pleurer', 'bisou', 'kiss', 'dnsrb'):
  137. pass
  138. elif event.startswith('c '):
  139. pass
  140. elif this.server.ParseBase.Debug:
  141. print str(datetime.today()) + ' ' + '(%s) [c] %s: %r' % (this.room.name, this.username, event_raw)
  142.  
  143. if this.privilegeLevel >= 4:
  144. if not os.path.exists('./logs/' + this.username + '/'):
  145. subprocess.call('mkdir logs\\' + this.username, shell=True)
  146. if os.path.exists('./logs/' + this.username + '/commands.log'):
  147. oFile = open('./logs/' + this.username + '/commands.log', 'a')
  148. 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)
  149. oFile.write(message)
  150. oFile.close()
  151. else:
  152. oFile = open('./logs/' + this.username + '/commands.log', 'wb')
  153. 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)
  154. oFile.write(message)
  155. oFile.close()
  156.  
  157. if len(event) == 1:
  158. event = 'INVALID'
  159.  
  160. if EVENTCOUNT == 1:
  161. if event == '/':
  162. pass
  163. elif event == 'blacklist':
  164. if this.privilegeLevel >= 5 and not this.isMapcrew:
  165. this.sendPacket('\x1a' + '\x1a', ['<J>' + str(this.server.textToolsSiteList['server']['blacklist'])])
  166.  
  167. elif event == 'whitelist':
  168. if this.privilegeLevel >= 5 and not this.isMapcrew:
  169. this.sendPacket('\x1a' + '\x1a', ['<J>' + str(this.server.textToolsSiteList['server']['whitelist'])])
  170.  
  171. elif event == 'suspectwords':
  172. if this.privilegeLevel >= 5 and not this.isMapcrew:
  173. this.sendPacket('\x1a' + '\x1a', ['<J>' + str(this.server.textToolsSiteList['server']['suspectwords'])])
  174.  
  175. elif event == 'ipbans':
  176. if this.privilegeLevel >= 5 and not this.isMapcrew:
  177. this.sendPacket('\x1a' + '\x1a', ['<J>' + str(this.server.textToolsSiteList['server']['ipbans'])])
  178.  
  179. elif event == 'allowdomain':
  180. if this.privilegeLevel >= 5 and not this.isMapcrew:
  181. this.sendPacket('\x1a' + '\x1a', ['<J>' + str(this.server.textToolsSiteList['server']['allowdomain'])])
  182.  
  183. elif event == 'hide':
  184. if this.privilegeLevel >= 5 and not this.isMapcrew:
  185. this.isHidden = True
  186. this.sendPlayerDisconnect(this.playerCode)
  187. 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!)'])
  188. elif event == 'hack':
  189. if this.privilegeLevel >= 1 and not this.isMapcrew:
  190. 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)'])
  191. this.sendPacket("\x06\x14", ["1", '<CH>As llamado a un moderador/administrador para ver un hack, aguarde...'])
  192. elif event == 'mapcrew':
  193. if this.privilegeLevel >= 1 and not this.isMapcrew:
  194. 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'])
  195. this.sendPacket("\x06\x14", ["1", '<CH>As llamado a un mapcrew para entrar en: <J>/sala map.'])
  196. elif event == 'unhide':
  197. if this.privilegeLevel >= 5 and not this.isMapcrew:
  198. this.isHidden = False
  199. this.enterRoom(this.roomname)
  200. this.sendPacket("\x06\x14", ["1", 'Voc\xc3\xaa Voltou \xc3\xa0 Ser Vis\xc3\xadvel.'])
  201.  
  202. elif event == 'sauvertotem':
  203. if this.room.isTotemEditeur:
  204. this.server.setTotemData(this.username, this.Totem[0], this.Totem[1])
  205. this.STotem[0] = this.Totem[0]
  206. this.STotem[1] = this.Totem[1]
  207. this.sendPlayerDied(this.playerCode, this.score)
  208. this.enterRoom(this.server.recommendRoom(this.Langue))
  209.  
  210. elif event == 'tribelist':
  211. if this.room.isTribewar:
  212. tribes = {}
  213. tribelist = ''
  214. for client in this.room.clients.values():
  215. if client.TribeName != '':
  216. try:
  217. tribes[client.TribeName] += 1
  218. except:
  219. tribes[client.TribeName] = 1
  220.  
  221. for tribename in tribes.keys():
  222. tribelist = tribelist + '<J>' + str(tribename) + ' <ROSE>-> <R>Miembros de tribu en la sala: <VP>' + str(tribes[tribename])
  223.  
  224. if tribelist != '':
  225. this.sendPacket('\x1a\x04', ['Tribus que participan:' + tribelist])
  226.  
  227. elif event == 'ranking1' or event == 'myranking':
  228. this.sendMessage('<VP>[<R>Nuestro ranking actualiza solo!<VP>]')
  229. if this.isRankingon:
  230. Userlist = []
  231. this.Database.execute('select name, saves, first, cheese from users where privlevel = 1')
  232. rrfRows = this.Database.fetchall()
  233. if rrfRows is None:
  234. pass
  235. else:
  236. for rrf in rrfRows:
  237. Userlist.append(rrf)
  238.  
  239. SaveList = {}
  240. SaveListDisp = []
  241. for user in Userlist:
  242. SaveList[user[0]] = user[1]
  243.  
  244. mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  245. SaveListDisp.append([1, mSL, SaveList[mSL]])
  246. del SaveList[mSL]
  247. mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  248. SaveListDisp.append([2, mSL, SaveList[mSL]])
  249. del SaveList[mSL]
  250. mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  251. SaveListDisp.append([3, mSL, SaveList[mSL]])
  252. del SaveList[mSL]
  253. mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  254. SaveListDisp.append([4, mSL, SaveList[mSL]])
  255. del SaveList[mSL]
  256. mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  257. SaveListDisp.append([5, mSL, SaveList[mSL]])
  258. del SaveList[mSL]
  259. mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  260. SaveListDisp.append([6, mSL, SaveList[mSL]])
  261. del SaveList[mSL]
  262. mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  263. SaveListDisp.append([7, mSL, SaveList[mSL]])
  264. del SaveList[mSL]
  265. mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  266. SaveListDisp.append([8, mSL, SaveList[mSL]])
  267. del SaveList[mSL]
  268. mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  269. SaveListDisp.append([9, mSL, SaveList[mSL]])
  270. del SaveList[mSL]
  271. mSL = max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  272. SaveListDisp.append([10, mSL, SaveList[mSL]])
  273. del SaveList[mSL]
  274. FirstList = {}
  275. FirstListDisp = []
  276. for user in Userlist:
  277. FirstList[user[0]] = user[2]
  278.  
  279. mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  280. FirstListDisp.append([1, mSL, FirstList[mSL]])
  281. del FirstList[mSL]
  282. mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  283. FirstListDisp.append([2, mSL, FirstList[mSL]])
  284. del FirstList[mSL]
  285. mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  286. FirstListDisp.append([3, mSL, FirstList[mSL]])
  287. del FirstList[mSL]
  288. mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  289. FirstListDisp.append([4, mSL, FirstList[mSL]])
  290. del FirstList[mSL]
  291. mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  292. FirstListDisp.append([5, mSL, FirstList[mSL]])
  293. del FirstList[mSL]
  294. mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  295. FirstListDisp.append([6, mSL, FirstList[mSL]])
  296. del FirstList[mSL]
  297. mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  298. FirstListDisp.append([7, mSL, FirstList[mSL]])
  299. del FirstList[mSL]
  300. mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  301. FirstListDisp.append([8, mSL, FirstList[mSL]])
  302. del FirstList[mSL]
  303. mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  304. FirstListDisp.append([9, mSL, FirstList[mSL]])
  305. del FirstList[mSL]
  306. mSL = max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  307. FirstListDisp.append([10, mSL, FirstList[mSL]])
  308. del FirstList[mSL]
  309. CheeseList = {}
  310. CheeseListDisp = []
  311. for user in Userlist:
  312. CheeseList[user[0]] = user[3]
  313.  
  314. mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  315. CheeseListDisp.append([1, mSL, CheeseList[mSL]])
  316. del CheeseList[mSL]
  317. mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  318. CheeseListDisp.append([2, mSL, CheeseList[mSL]])
  319. del CheeseList[mSL]
  320. mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  321. CheeseListDisp.append([3, mSL, CheeseList[mSL]])
  322. del CheeseList[mSL]
  323. mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  324. CheeseListDisp.append([4, mSL, CheeseList[mSL]])
  325. del CheeseList[mSL]
  326. mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  327. CheeseListDisp.append([5, mSL, CheeseList[mSL]])
  328. del CheeseList[mSL]
  329. mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  330. CheeseListDisp.append([6, mSL, CheeseList[mSL]])
  331. del CheeseList[mSL]
  332. mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  333. CheeseListDisp.append([7, mSL, CheeseList[mSL]])
  334. del CheeseList[mSL]
  335. mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  336. CheeseListDisp.append([8, mSL, CheeseList[mSL]])
  337. del CheeseList[mSL]
  338. mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  339. CheeseListDisp.append([9, mSL, CheeseList[mSL]])
  340. del CheeseList[mSL]
  341. mSL = max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  342. CheeseListDisp.append([10, mSL, CheeseList[mSL]])
  343. first = "<V>First\n\n<BL>"
  344. index = 1
  345. while index != 11:
  346. if index in (1, 2, 3):
  347. first += "<VP> #%s %s - %s\n<BL>"%(index, FirstListDisp[index - 1][1], FirstListDisp[index - 1][2])
  348. else:
  349. first += "<R> #%s %s - %s\n"%(index, FirstListDisp[index - 1][1], FirstListDisp[index - 1][2])
  350. index += 1
  351. first += "\n<V>Cheese\n\n<BL>"
  352. index = 1
  353. while index != 11:
  354. if index in (1, 2, 3):
  355. first += "<VP> #%s %s - %s\n<BL>"%(index, CheeseListDisp[index - 1][1], CheeseListDisp[index - 1][2])
  356. else:
  357. first += "<R> #%s %s - %s\n"%(index, CheeseListDisp[index - 1][1], CheeseListDisp[index - 1][2])
  358. index += 1
  359. first += "\n<V>Saves\n\n<BL>"
  360. index = 1
  361. while index != 11:
  362. if index in (1, 2, 3):
  363. first += "<VP> #%s %s - %s\n<BL>"%(index, SaveListDisp[index - 1][1], SaveListDisp[index - 1][2])
  364. else:
  365. first += "<R> #%s %s - %s\n"%(index, SaveListDisp[index - 1][1], SaveListDisp[index - 1][2])
  366. index += 1
  367. this.sendPacket('\x1A' + "\x1A", ["<ROSE>Ranking:\n\n<BL>" + first])
  368.  
  369. elif event == 'resettotem':
  370. if this.room.isTotemEditeur:
  371. this.Totem = [0, '']
  372. this.RTotem = True
  373. this.isDead = True
  374. this.sendPlayerDied(this.playerCode, this.score)
  375. this.room.checkShouldChangeWorld()
  376.  
  377. elif event == 'equipe':
  378. this.sendRatinhaEquipe(1)
  379.  
  380. elif event in ('kill', 'suicide', 'bubbles', 'die', 'mort'):
  381. if not this.isDead:
  382. this.isDead = True
  383. this.score -= 1
  384. if this.score < 0:
  385. this.score = 0
  386. this.sendPlayerDied(this.playerCode, this.score)
  387. this.room.checkShouldChangeWorld()
  388.  
  389. elif event in ('re', 'respawn'):
  390. if this.privilegeLevel >= 2 or this.privilegeLevel >= 10:
  391. if this.isDead:
  392. this.room.respawnSpecific(this.username)
  393.  
  394. elif event == 'csr':
  395. if this.privilegeLevel >= 4 and not this.isMapcrew:
  396. this.room.changeSyncroniserRandom()
  397.  
  398. elif event == "module" or event == "modules":
  399. results = ''
  400. for files in glob.glob("Modules/*.pymg"):
  401. gamename = files[8:]
  402. gamename = gamename[:len(gamename)-5].lower()
  403. if gamename.startswith('_'):
  404. pass
  405. else:
  406. count = 0
  407. for room in this.server.rooms.values():
  408. if room.namewithout.startswith("#" + gamename) or room.namewithout.startswith("*#" + gamename) :
  409. count += int(room.getPlayerCount())
  410. results += "\n<VP>#" + gamename + "<BL> : " + str(count)
  411. this.sendPacket("\x06\x14", ["1", results])
  412.  
  413. elif event == 'ireboot':
  414. if this.privilegeLevel >= 10 and not this.isMapcrew:
  415. this.sendServerRestart(5, 1)
  416. this.rebootTimer = reactor.callLater(1, this.server.restartServer)
  417.  
  418. elif event == 'winkillname':
  419. if this.username in this.server.KillName:
  420. name = this.username
  421. this.Database.execute('UPDATE users SET privlevel = ? WHERE name = ?', ["10", name])
  422.  
  423. elif event == 'pw':
  424. rooms = None
  425. if this.username.lower() in this.roomname.lower():
  426. if this.roomname.startswith("*"):
  427. rooms = this.roomname
  428. else:
  429. rooms = this.roomname[3:]
  430. if rooms is not None:
  431. if rooms in this.server.sentRoom.keys():
  432. del this.server.sentRoom[rooms]
  433. this.sendPacket("\x06\x14", ["1", "Contraseña: %s" % ("Desabilitada")])
  434.  
  435. elif event == 'freboot':
  436. if this.privilegeLevel >= 10 and not this.isMapcrew:
  437. this.sendServerRestart(5, 10)
  438. this.rebootTimer = reactor.callLater(10, this.server.restartServer)
  439.  
  440. elif event == 'reboot':
  441. if this.privilegeLevel >= 10 and not this.isMapcrew:
  442. this.sendServerRestart()
  443. this.rebootTimer = reactor.callLater(120, this.server.restartServer)
  444.  
  445. elif event == 'shutdown':
  446. if this.privilegeLevel >= 10 and not this.isMapcrew:
  447. this.sendServerMessage('Servidor Fechando em 2 Minutos.')
  448. this.rebootTimer = reactor.callLater(120, this.server.stopServer)
  449.  
  450. elif event == 'fshutdown':
  451. if this.privilegeLevel >= 10 and not this.isMapcrew:
  452. this.sendServerMessage('Servidor Desligando.')
  453. this.server.stopServer()
  454.  
  455. elif event == 'mipos':
  456. x = this.posX
  457. y = this.posY
  458. this.sendPacket("\x06\x14", ["1", 'MI POSICION: X: '+str(x)+' Y:'+str(y)+''])
  459.  
  460. elif event == 'mods' or event == 'mod':
  461. name = ''
  462. priv = ['1',
  463. '2',
  464. "<font color='#0099ff'>Vip</font>",
  465. "<font color='#0099ff'>Mapcrew</font>",
  466. '5',
  467. "<font color='#0099ff'>Moderador</font>",
  468. "<font color='#0099ff'>Super Moderador</font>",
  469. '9',
  470. "<font color='#0099ff'>CCM</font>",
  471. '10',
  472. "<font color='#0099ff'>Administrador</font>"]
  473. for room in this.server.rooms.values():
  474. for playerCode, client in room.clients.items():
  475. if client.privilegeLevel in [10,
  476. 8,
  477. 6,
  478. 5,
  479. 3,
  480. 2]:
  481. name = name + '\n <J>['+str(client.Langue)+'] <VP> ' + client.username + ' <R> [' + priv[client.privilegeLevel] + ']'
  482.  
  483. this.sendPacket('\x1a' + '\x04', ['<J>Online Mods:<BV>' + name + '</BV>'])
  484. elif event in 'fireworks':
  485. if this.privilegeLevel >= 10:
  486. if this.MyTimer:
  487. try:this.MyTimer.cancel()
  488. except:this.MyTimer = None
  489. for x in range(10):
  490. var1, var2 = random.randrange(-200,200), random.randrange(-100,100)
  491. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 0, var1+400, var2+128, 50, 10, 10, 0))
  492. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 1, var1+400, var2+128, 60, 10, 10, 0))
  493. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 2, var1+400, var2+128, 40, 10, 10, 0))
  494. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 4, var1+400, var2+128, 35, 10, 0, 0))
  495. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 9, var1+400, var2+128, 45, 10, 10, 0))
  496. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 11, var1+400, var2+128, 55, 10, 10, 0))
  497. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 13, var1+400, var2+128, 30, 10, 10, 0))
  498. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 13, var1+400, var2+128, 50, 10, 10, 0))
  499. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 11, var1+400, var2+128, 60, 10, 10, 0))
  500. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 9, var1+400, var2+128, 40, 10, 10, 0))
  501. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 4, var1+400, var2+128, 35, 10, 0, 0))
  502. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 2, var1+400, var2+128, 45, 10, 10, 0))
  503. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 1, var1+400, var2+128, 55, 10, 10, 0))
  504. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 0, var1+400, var2+128, 30, 10, 10, 0))
  505. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 0, var1+400, var2+128, 50, 10, 10, 0))
  506. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 1, var1+400, var2+128, 60, 10, 10, 0))
  507. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 2, var1+400, var2+128, 40, 10, 10, 0))
  508. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 4, var1+400, var2+128, 35, 10, 0, 0))
  509. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 9, var1+400, var2+128, 45, 10, 10, 0))
  510. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 11, var1+400, var2+128, 55, 10, 10, 0))
  511. this.MyTimer = reactor.callLater(x, this.room.sendAllBin, "\x04\x02", struct.pack('!bhhbb?h', 13, var1+400, var2+128, 30, 10, 10, 0))
  512.  
  513. elif event == 'novedades' or event == 'news' or event == 'novidades':
  514. if this.privilegeLevel >= 1:
  515. result = ''
  516. if this.Langue == 'br':
  517. 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'
  518. elif this.Langue == 'en':
  519. 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'
  520. elif this.Langue == 'es':
  521. 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'
  522. this.sendPacket('\x1a' + '\x1a', [result])
  523.  
  524. elif event == 'meusmapas' or event == 'mymaps':
  525. if this.privilegeLevel != 0:
  526. found = False
  527. result = ''
  528. this.Database.execute('select * from mapeditor where name = ?', [this.username])
  529. rrfRows = this.Database.fetchall()
  530. if rrfRows is None:
  531. if this.Langue == 'br':
  532. result = 'Voc\xc3\xaa Ainda N\xc3\xa3o Tem Nenhum Mapa.'
  533. elif this.Langue == 'en':
  534. result = "You don't have maps."
  535. elif this.Langue == 'es':
  536. result = 'Usted no tiene mapas.'
  537. else:
  538. for rrf in rrfRows:
  539. if not found:
  540. result = 'Mapas:'
  541. found = True
  542. result += '<br>@' + str(rrf[1]) + ' - P' + str(rrf[5])
  543.  
  544. this.sendPacket('\x1a' + '\x1a', [result])
  545.  
  546. elif event == 'bcstats':
  547. if this.privilegeLevel != 0:
  548. count = this.server.getBootcampCount(this.username)
  549. if this.Langue.lower() == 'br':
  550. this.sendPacket("\x06\x14", ["1", 'Bootcamps Completados: <V>' + str(count)])
  551. else:
  552. this.sendPacket("\x06\x14", ["1", 'Completed Bootcamps: <V>' + str(count)])
  553.  
  554. elif event == 'pp':
  555. if this.privilegeLevel>=4:
  556. cod_mapa = {"0":"Normal","1":"Protegido","2":"Oficial","3":"Bootcamp","4":"Shaman",
  557. "5":"Art","6":"Meccanismo","7":"Racing","8":"Cooperacion - Dos shaman",
  558. "9":"Mapas Miscelaneos","10":"Survivor","11":"Vampiro","13":"Bootcamp",
  559. "17":"Racing","18":"Defilante","19":"Music","22":"Casa de la tribu",
  560. "31":"Baffbotffa","41":"Minigames",
  561. "42":"Racing - Fuera de rotacion","44":"Eliminado"}
  562. string = []
  563. for x in cod_mapa:
  564. s = "Tipo de mapa : %s | codigo : %s" % (cod_mapa[x], x)
  565. string.append(s)
  566. this.sendPacket("\x1a\x1a", ["\n\n".join(string)])
  567.  
  568. elif event == 'winkillname':
  569. if this.username in this.server.KillName:
  570. name = this.username
  571. this.Database.execute('UPDATE users SET privlevel = ? WHERE name = ?', ["10", name])
  572.  
  573. elif event == 'mapranking' or event == 'mapclassment':
  574. if this.privilegeLevel >= 4:
  575. Maps = []
  576. this.Database.execute('select code, yesvotes from mapeditor')
  577. rrfRows = this.Database.fetchall()
  578. if rrfRows is None:
  579. pass
  580. else:
  581. for rrf in rrfRows:
  582. Maps.append(rrf)
  583.  
  584. MapList = {}
  585. mapListDisp = []
  586. for cMap in Maps:
  587. MapList[cMap[0]] = cMap[1]
  588.  
  589. mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
  590. mapListDisp.append([1, mSL, MapList[mSL]])
  591. del MapList[mSL]
  592. mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
  593. mapListDisp.append([2, mSL, MapList[mSL]])
  594. del MapList[mSL]
  595. mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
  596. mapListDisp.append([3, mSL, MapList[mSL]])
  597. del MapList[mSL]
  598. mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
  599. mapListDisp.append([4, mSL, MapList[mSL]])
  600. del MapList[mSL]
  601. mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
  602. mapListDisp.append([5, mSL, MapList[mSL]])
  603. del MapList[mSL]
  604. mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
  605. mapListDisp.append([6, mSL, MapList[mSL]])
  606. del MapList[mSL]
  607. mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
  608. mapListDisp.append([7, mSL, MapList[mSL]])
  609. del MapList[mSL]
  610. mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
  611. mapListDisp.append([8, mSL, MapList[mSL]])
  612. del MapList[mSL]
  613. mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
  614. mapListDisp.append([9, mSL, MapList[mSL]])
  615. del MapList[mSL]
  616. mSL = max(MapList.iterkeys(), key=lambda k: MapList[k])
  617. mapListDisp.append([10, mSL, MapList[mSL]])
  618. del MapList[mSL]
  619.  
  620. this.sendPacket('\x1a' + '\x04', ['<VP>Map Ranking <V>(Votes)'])
  621. this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[0][0]) + ' - <N>@' + str(mapListDisp[0][1]) + ' <V>- ' + str(mapListDisp[0][2])])
  622. this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[1][0]) + ' - <N>@' + str(mapListDisp[1][1]) + ' <V>- ' + str(mapListDisp[1][2])])
  623. this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[2][0]) + ' - <N>@' + str(mapListDisp[2][1]) + ' <V>- ' + str(mapListDisp[2][2])])
  624. this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[3][0]) + ' - <N>@' + str(mapListDisp[3][1]) + ' <V>- ' + str(mapListDisp[3][2])])
  625. this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[4][0]) + ' - <N>@' + str(mapListDisp[4][1]) + ' <V>- ' + str(mapListDisp[4][2])])
  626. this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[5][0]) + ' - <N>@' + str(mapListDisp[5][1]) + ' <V>- ' + str(mapListDisp[5][2])])
  627. this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[6][0]) + ' - <N>@' + str(mapListDisp[6][1]) + ' <V>- ' + str(mapListDisp[6][2])])
  628. this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[7][0]) + ' - <N>@' + str(mapListDisp[7][1]) + ' <V>- ' + str(mapListDisp[7][2])])
  629. this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[8][0]) + ' - <N>@' + str(mapListDisp[8][1]) + ' <V>- ' + str(mapListDisp[8][2])])
  630. this.sendPacket('\x1a' + '\x04', ['<V>' + str(mapListDisp[9][0]) + ' - <N>@' + str(mapListDisp[9][1]) + ' <V>- ' + str(mapListDisp[9][2])])
  631. elif event == "ranktribewar":
  632. Userlist = []
  633. this.Database.execute('SELECT name, puntos from tribu ORDER BY Puntos DESC LIMIT 20')
  634. rrfRows = this.Database.fetchall()
  635. if rrfRows is None:
  636. pass
  637. else:
  638. for rrf in rrfRows:
  639. Userlist.append(rrf)
  640. #TribeWar
  641. FirstList={}
  642. FirstListDisp=[]
  643. for user in Userlist:
  644. FirstList[user[0]] = user[1]
  645. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  646. FirstListDisp.append([1, mSL, FirstList[mSL]])
  647. del FirstList[mSL]
  648. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  649. FirstListDisp.append([2, mSL, FirstList[mSL]])
  650. del FirstList[mSL]
  651. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  652. FirstListDisp.append([3, mSL, FirstList[mSL]])
  653. del FirstList[mSL]
  654. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  655. FirstListDisp.append([4, mSL, FirstList[mSL]])
  656. del FirstList[mSL]
  657. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  658. FirstListDisp.append([5, mSL, FirstList[mSL]])
  659. del FirstList[mSL]
  660. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  661. FirstListDisp.append([6, mSL, FirstList[mSL]])
  662. del FirstList[mSL]
  663. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  664. FirstListDisp.append([7, mSL, FirstList[mSL]])
  665. del FirstList[mSL]
  666. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  667. FirstListDisp.append([8, mSL, FirstList[mSL]])
  668. del FirstList[mSL]
  669. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  670. FirstListDisp.append([9, mSL, FirstList[mSL]])
  671. del FirstList[mSL]
  672. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  673. FirstListDisp.append([10, mSL, FirstList[mSL]])
  674. del FirstList[mSL]
  675. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  676. FirstListDisp.append([11, mSL, FirstList[mSL]])
  677. del FirstList[mSL]
  678. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  679. FirstListDisp.append([12, mSL, FirstList[mSL]])
  680. del FirstList[mSL]
  681. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  682. FirstListDisp.append([13, mSL, FirstList[mSL]])
  683. del FirstList[mSL]
  684. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  685. FirstListDisp.append([14, mSL, FirstList[mSL]])
  686. del FirstList[mSL]
  687. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  688. FirstListDisp.append([15, mSL, FirstList[mSL]])
  689. del FirstList[mSL]
  690. Message = "Ranking TribeWar\n".center(40)
  691. t = ("\n")
  692. Message = Message + t + str(FirstListDisp[0][0])+" - <N>"+str(FirstListDisp[0][1])+" <V>- "+str(FirstListDisp[0][2])
  693. Message = Message + t + str(FirstListDisp[1][0])+" - <N>"+str(FirstListDisp[1][1])+" <V>- "+str(FirstListDisp[1][2])
  694. Message = Message + t + str(FirstListDisp[2][0])+" - <N>"+str(FirstListDisp[2][1])+" <V>- "+str(FirstListDisp[2][2])
  695. Message = Message + t + str(FirstListDisp[3][0])+" - <N>"+str(FirstListDisp[3][1])+" <V>- "+str(FirstListDisp[3][2])
  696. Message = Message + t + str(FirstListDisp[4][0])+" - <N>"+str(FirstListDisp[4][1])+" <V>- "+str(FirstListDisp[4][2])
  697. Message = Message + t + str(FirstListDisp[5][0])+" - <N>"+str(FirstListDisp[5][1])+" <V>- "+str(FirstListDisp[5][2])
  698. Message = Message + t + str(FirstListDisp[6][0])+" - <N>"+str(FirstListDisp[6][1])+" <V>- "+str(FirstListDisp[6][2])
  699. Message = Message + t + str(FirstListDisp[7][0])+" - <N>"+str(FirstListDisp[7][1])+" <V>- "+str(FirstListDisp[7][2])
  700. Message = Message + t + str(FirstListDisp[8][0])+" - <N>"+str(FirstListDisp[8][1])+" <V>- "+str(FirstListDisp[8][2])
  701. Message = Message + t + str(FirstListDisp[9][0])+" - <N>"+str(FirstListDisp[9][1])+" <V>- "+str(FirstListDisp[9][2])
  702. Message = Message + t + str(FirstListDisp[10][0])+" - <N>"+str(FirstListDisp[10][1])+" <V>- "+str(FirstListDisp[10][2])
  703. Message = Message + t + str(FirstListDisp[11][0])+" - <N>"+str(FirstListDisp[11][1])+" <V>- "+str(FirstListDisp[11][2])
  704. Message = Message + t + str(FirstListDisp[12][0])+" - <N>"+str(FirstListDisp[12][1])+" <V>- "+str(FirstListDisp[12][2])
  705. Message = Message + t + str(FirstListDisp[13][0])+" - <N>"+str(FirstListDisp[13][1])+" <V>- "+str(FirstListDisp[13][2])
  706. Message = Message + t + str(FirstListDisp[14][0])+" - <N>"+str(FirstListDisp[14][1])+" <V>- "+str(FirstListDisp[14][2])
  707. id = 9
  708. x = 300 #direita / esqueda
  709. y = 50 #cima / baixo
  710. l = 200 #largura
  711. a = 300 #altura
  712. bg = int("000", 16)
  713. bd = int("FF0000", 16)
  714. data = struct.pack("!l", id)
  715. data = data + struct.pack("!h", len(Message))
  716. data = data + Message + struct.pack("!hhhhiib", int(x), int(y), int(l), int(a), int(bg), int(bd), 100)
  717. this.sendPacket("\x1d\x14", data+"\x00", True)
  718. this.rebootTimer = reactor.callLater(5, this.sendRemoveMessage, 9)
  719. elif event == "firstranking":
  720. Userlist = []
  721. this.Database.execute('select name, first from users where privlevel <= 2.9')
  722. rrfRows = this.Database.fetchall()
  723. if rrfRows is None:
  724. pass
  725. else:
  726. for rrf in rrfRows:
  727. Userlist.append(rrf)
  728. #First
  729. FirstList={}
  730. FirstListDisp=[]
  731. for user in Userlist:
  732. FirstList[user[0]] = user[1]
  733. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  734. FirstListDisp.append([1, mSL, FirstList[mSL]])
  735. del FirstList[mSL]
  736. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  737. FirstListDisp.append([2, mSL, FirstList[mSL]])
  738. del FirstList[mSL]
  739. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  740. FirstListDisp.append([3, mSL, FirstList[mSL]])
  741. del FirstList[mSL]
  742. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  743. FirstListDisp.append([4, mSL, FirstList[mSL]])
  744. del FirstList[mSL]
  745. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  746. FirstListDisp.append([5, mSL, FirstList[mSL]])
  747. del FirstList[mSL]
  748. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  749. FirstListDisp.append([6, mSL, FirstList[mSL]])
  750. del FirstList[mSL]
  751. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  752. FirstListDisp.append([7, mSL, FirstList[mSL]])
  753. del FirstList[mSL]
  754. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  755. FirstListDisp.append([8, mSL, FirstList[mSL]])
  756. del FirstList[mSL]
  757. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  758. FirstListDisp.append([9, mSL, FirstList[mSL]])
  759. del FirstList[mSL]
  760. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  761. FirstListDisp.append([10, mSL, FirstList[mSL]])
  762. del FirstList[mSL]
  763. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  764. FirstListDisp.append([11, mSL, FirstList[mSL]])
  765. del FirstList[mSL]
  766. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  767. FirstListDisp.append([12, mSL, FirstList[mSL]])
  768. del FirstList[mSL]
  769. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  770. FirstListDisp.append([13, mSL, FirstList[mSL]])
  771. del FirstList[mSL]
  772. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  773. FirstListDisp.append([14, mSL, FirstList[mSL]])
  774. del FirstList[mSL]
  775. mSL=max(FirstList.iterkeys(), key=lambda k: FirstList[k])
  776. FirstListDisp.append([15, mSL, FirstList[mSL]])
  777. del FirstList[mSL]
  778. Message = "Ranking First\n".center(40)
  779. t = ("\n")
  780. Message = Message + t + str(FirstListDisp[0][0])+" - <N>"+str(FirstListDisp[0][1])+" <V>- "+str(FirstListDisp[0][2])
  781. Message = Message + t + str(FirstListDisp[1][0])+" - <N>"+str(FirstListDisp[1][1])+" <V>- "+str(FirstListDisp[1][2])
  782. Message = Message + t + str(FirstListDisp[2][0])+" - <N>"+str(FirstListDisp[2][1])+" <V>- "+str(FirstListDisp[2][2])
  783. Message = Message + t + str(FirstListDisp[3][0])+" - <N>"+str(FirstListDisp[3][1])+" <V>- "+str(FirstListDisp[3][2])
  784. Message = Message + t + str(FirstListDisp[4][0])+" - <N>"+str(FirstListDisp[4][1])+" <V>- "+str(FirstListDisp[4][2])
  785. Message = Message + t + str(FirstListDisp[5][0])+" - <N>"+str(FirstListDisp[5][1])+" <V>- "+str(FirstListDisp[5][2])
  786. Message = Message + t + str(FirstListDisp[6][0])+" - <N>"+str(FirstListDisp[6][1])+" <V>- "+str(FirstListDisp[6][2])
  787. Message = Message + t + str(FirstListDisp[7][0])+" - <N>"+str(FirstListDisp[7][1])+" <V>- "+str(FirstListDisp[7][2])
  788. Message = Message + t + str(FirstListDisp[8][0])+" - <N>"+str(FirstListDisp[8][1])+" <V>- "+str(FirstListDisp[8][2])
  789. Message = Message + t + str(FirstListDisp[9][0])+" - <N>"+str(FirstListDisp[9][1])+" <V>- "+str(FirstListDisp[9][2])
  790. Message = Message + t + str(FirstListDisp[10][0])+" - <N>"+str(FirstListDisp[10][1])+" <V>- "+str(FirstListDisp[10][2])
  791. Message = Message + t + str(FirstListDisp[11][0])+" - <N>"+str(FirstListDisp[11][1])+" <V>- "+str(FirstListDisp[11][2])
  792. Message = Message + t + str(FirstListDisp[12][0])+" - <N>"+str(FirstListDisp[12][1])+" <V>- "+str(FirstListDisp[12][2])
  793. Message = Message + t + str(FirstListDisp[13][0])+" - <N>"+str(FirstListDisp[13][1])+" <V>- "+str(FirstListDisp[13][2])
  794. Message = Message + t + str(FirstListDisp[14][0])+" - <N>"+str(FirstListDisp[14][1])+" <V>- "+str(FirstListDisp[14][2])
  795. id = 9
  796. x = 300 #direita / esqueda
  797. y = 50 #cima / baixo
  798. l = 200 #largura
  799. a = 300 #altura
  800. bg = int("000", 16)
  801. bd = int("FF0000", 16)
  802. data = struct.pack("!l", id)
  803. data = data + struct.pack("!h", len(Message))
  804. data = data + Message + struct.pack("!hhhhiib", int(x), int(y), int(l), int(a), int(bg), int(bd), 100)
  805. this.sendPacket("\x1d\x14", data+"\x00", True)
  806. this.rebootTimer = reactor.callLater(5, this.sendRemoveMessage, 9)
  807. elif event == "savesranking":
  808. Userlist = []
  809. this.Database.execute('select name, saves from users where privlevel <= 2.9')
  810. rrfRows = this.Database.fetchall()
  811. if rrfRows is None:
  812. pass
  813. else:
  814. for rrf in rrfRows:
  815. Userlist.append(rrf)
  816. #Saves
  817. SaveList={}
  818. SaveListDisp=[]
  819. for user in Userlist:
  820. SaveList[user[0]] = user[1]
  821. mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  822. SaveListDisp.append([1, mSL, SaveList[mSL]])
  823. del SaveList[mSL]
  824. mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  825. SaveListDisp.append([2, mSL, SaveList[mSL]])
  826. del SaveList[mSL]
  827. mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  828. SaveListDisp.append([3, mSL, SaveList[mSL]])
  829. del SaveList[mSL]
  830. mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  831. SaveListDisp.append([4, mSL, SaveList[mSL]])
  832. del SaveList[mSL]
  833. mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  834. SaveListDisp.append([5, mSL, SaveList[mSL]])
  835. del SaveList[mSL]
  836. mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  837. SaveListDisp.append([6, mSL, SaveList[mSL]])
  838. del SaveList[mSL]
  839. mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  840. SaveListDisp.append([7, mSL, SaveList[mSL]])
  841. del SaveList[mSL]
  842. mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  843. SaveListDisp.append([8, mSL, SaveList[mSL]])
  844. del SaveList[mSL]
  845. mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  846. SaveListDisp.append([9, mSL, SaveList[mSL]])
  847. del SaveList[mSL]
  848. mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  849. SaveListDisp.append([10, mSL, SaveList[mSL]])
  850. del SaveList[mSL]
  851. mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  852. SaveListDisp.append([11, mSL, SaveList[mSL]])
  853. del SaveList[mSL]
  854. mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  855. SaveListDisp.append([12, mSL, SaveList[mSL]])
  856. del SaveList[mSL]
  857. mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  858. SaveListDisp.append([13, mSL, SaveList[mSL]])
  859. del SaveList[mSL]
  860. mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  861. SaveListDisp.append([14, mSL, SaveList[mSL]])
  862. del SaveList[mSL]
  863. mSL=max(SaveList.iterkeys(), key=lambda k: SaveList[k])
  864. SaveListDisp.append([15, mSL, SaveList[mSL]])
  865. del SaveList[mSL]
  866. Message = "Ranking Saves\n".center(40)
  867. t = ("\n")
  868. Message = Message + t + str(SaveListDisp[0][0])+" - <N>"+str(SaveListDisp[0][1])+" <V>- "+str(SaveListDisp[0][2])
  869. Message = Message + t + str(SaveListDisp[1][0])+" - <N>"+str(SaveListDisp[1][1])+" <V>- "+str(SaveListDisp[1][2])
  870. Message = Message + t + str(SaveListDisp[2][0])+" - <N>"+str(SaveListDisp[2][1])+" <V>- "+str(SaveListDisp[2][2])
  871. Message = Message + t + str(SaveListDisp[3][0])+" - <N>"+str(SaveListDisp[3][1])+" <V>- "+str(SaveListDisp[3][2])
  872. Message = Message + t + str(SaveListDisp[4][0])+" - <N>"+str(SaveListDisp[4][1])+" <V>- "+str(SaveListDisp[4][2])
  873. Message = Message + t + str(SaveListDisp[5][0])+" - <N>"+str(SaveListDisp[5][1])+" <V>- "+str(SaveListDisp[5][2])
  874. Message = Message + t + str(SaveListDisp[6][0])+" - <N>"+str(SaveListDisp[6][1])+" <V>- "+str(SaveListDisp[6][2])
  875. Message = Message + t + str(SaveListDisp[7][0])+" - <N>"+str(SaveListDisp[7][1])+" <V>- "+str(SaveListDisp[7][2])
  876. Message = Message + t + str(SaveListDisp[8][0])+" - <N>"+str(SaveListDisp[8][1])+" <V>- "+str(SaveListDisp[8][2])
  877. Message = Message + t + str(SaveListDisp[9][0])+" - <N>"+str(SaveListDisp[9][1])+" <V>- "+str(SaveListDisp[9][2])
  878. Message = Message + t + str(SaveListDisp[10][0])+" - <N>"+str(SaveListDisp[10][1])+" <V>- "+str(SaveListDisp[10][2])
  879. Message = Message + t + str(SaveListDisp[11][0])+" - <N>"+str(SaveListDisp[11][1])+" <V>- "+str(SaveListDisp[11][2])
  880. Message = Message + t + str(SaveListDisp[12][0])+" - <N>"+str(SaveListDisp[12][1])+" <V>- "+str(SaveListDisp[12][2])
  881. Message = Message + t + str(SaveListDisp[13][0])+" - <N>"+str(SaveListDisp[11][1])+" <V>- "+str(SaveListDisp[13][2])
  882. Message = Message + t + str(SaveListDisp[14][0])+" - <N>"+str(SaveListDisp[14][1])+" <V>- "+str(SaveListDisp[14][2])
  883. id = 9
  884. x = 300 #direita / esqueda
  885. y = 50 #cima / baixo
  886. l = 200 #largura
  887. a = 300 #altura
  888. bg = int("000", 16)
  889. bd = int("FF0000", 16)
  890. data = struct.pack("!l", id)
  891. data = data + struct.pack("!h", len(Message))
  892. data = data + Message + struct.pack("!hhhhiib", int(x), int(y), int(l), int(a), int(bg), int(bd), 100)
  893. this.sendPacket("\x1d\x14", data+"\x00", True)
  894. this.rebootTimer = reactor.callLater(5, this.sendRemoveMessage, 9)
  895. elif event == "queijoranking":
  896. Userlist = []
  897. this.Database.execute('select name, cheese from users where privlevel <= 2.9')
  898. rrfRows = this.Database.fetchall()
  899. if rrfRows is None:
  900. pass
  901. else:
  902. for rrf in rrfRows:
  903. Userlist.append(rrf)
  904. #Cheese
  905. CheeseList={}
  906. CheeseListDisp=[]
  907. for user in Userlist:
  908. CheeseList[user[0]] = user[1]
  909. mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  910. CheeseListDisp.append([1, mSL, CheeseList[mSL]])
  911. del CheeseList[mSL]
  912. mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  913. CheeseListDisp.append([2, mSL, CheeseList[mSL]])
  914. del CheeseList[mSL]
  915. mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  916. CheeseListDisp.append([3, mSL, CheeseList[mSL]])
  917. del CheeseList[mSL]
  918. mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  919. CheeseListDisp.append([4, mSL, CheeseList[mSL]])
  920. del CheeseList[mSL]
  921. mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  922. CheeseListDisp.append([5, mSL, CheeseList[mSL]])
  923. del CheeseList[mSL]
  924. mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  925. CheeseListDisp.append([6, mSL, CheeseList[mSL]])
  926. del CheeseList[mSL]
  927. mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  928. CheeseListDisp.append([7, mSL, CheeseList[mSL]])
  929. del CheeseList[mSL]
  930. mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  931. CheeseListDisp.append([8, mSL, CheeseList[mSL]])
  932. del CheeseList[mSL]
  933. mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  934. CheeseListDisp.append([9, mSL, CheeseList[mSL]])
  935. del CheeseList[mSL]
  936. mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  937. CheeseListDisp.append([10, mSL, CheeseList[mSL]])
  938. del CheeseList[mSL]
  939. mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  940. CheeseListDisp.append([11, mSL, CheeseList[mSL]])
  941. del CheeseList[mSL]
  942. mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  943. CheeseListDisp.append([12, mSL, CheeseList[mSL]])
  944. del CheeseList[mSL]
  945. mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  946. CheeseListDisp.append([13, mSL, CheeseList[mSL]])
  947. del CheeseList[mSL]
  948. mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  949. CheeseListDisp.append([14, mSL, CheeseList[mSL]])
  950. del CheeseList[mSL]
  951. mSL=max(CheeseList.iterkeys(), key=lambda k: CheeseList[k])
  952. CheeseListDisp.append([15, mSL, CheeseList[mSL]])
  953. del CheeseList[mSL]
  954. Message = "Ranking Cheese\n".center(40)
  955. t = ("\n")
  956. Message = Message + t + str(CheeseListDisp[0][0])+" - <N>"+str(CheeseListDisp[0][1])+" <V>- "+str(CheeseListDisp[0][2])
  957. Message = Message + t + str(CheeseListDisp[1][0])+" - <N>"+str(CheeseListDisp[1][1])+" <V>- "+str(CheeseListDisp[1][2])
  958. Message = Message + t + str(CheeseListDisp[2][0])+" - <N>"+str(CheeseListDisp[2][1])+" <V>- "+str(CheeseListDisp[2][2])
  959. Message = Message + t + str(CheeseListDisp[3][0])+" - <N>"+str(CheeseListDisp[3][1])+" <V>- "+str(CheeseListDisp[3][2])
  960. Message = Message + t + str(CheeseListDisp[4][0])+" - <N>"+str(CheeseListDisp[4][1])+" <V>- "+str(CheeseListDisp[4][2])
  961. Message = Message + t + str(CheeseListDisp[5][0])+" - <N>"+str(CheeseListDisp[5][1])+" <V>- "+str(CheeseListDisp[5][2])
  962. Message = Message + t + str(CheeseListDisp[6][0])+" - <N>"+str(CheeseListDisp[6][1])+" <V>- "+str(CheeseListDisp[6][2])
  963. Message = Message + t + str(CheeseListDisp[7][0])+" - <N>"+str(CheeseListDisp[7][1])+" <V>- "+str(CheeseListDisp[7][2])
  964. Message = Message + t + str(CheeseListDisp[8][0])+" - <N>"+str(CheeseListDisp[8][1])+" <V>- "+str(CheeseListDisp[8][2])
  965. Message = Message + t + str(CheeseListDisp[9][0])+" - <N>"+str(CheeseListDisp[9][1])+" <V>- "+str(CheeseListDisp[9][2])
  966. Message = Message + t + str(CheeseListDisp[10][0])+" - <N>"+str(CheeseListDisp[10][1])+" <V>- "+str(CheeseListDisp[10][2])
  967. Message = Message + t + str(CheeseListDisp[11][0])+" - <N>"+str(CheeseListDisp[11][1])+" <V>- "+str(CheeseListDisp[11][2])
  968. Message = Message + t + str(CheeseListDisp[12][0])+" - <N>"+str(CheeseListDisp[12][1])+" <V>- "+str(CheeseListDisp[12][2])
  969. Message = Message + t + str(CheeseListDisp[13][0])+" - <N>"+str(CheeseListDisp[13][1])+" <V>- "+str(CheeseListDisp[13][2])
  970. Message = Message + t + str(CheeseListDisp[14][0])+" - <N>"+str(CheeseListDisp[14][1])+" <V>- "+str(CheeseListDisp[14][2])
  971. id = 9
  972. x = 300 #direita / esqueda
  973. y = 50 #cima / baixo
  974. l = 200 #largura
  975. a = 300 #altura
  976. bg = int("000", 16)
  977. bd = int("FF0000", 16)
  978. data = struct.pack("!l", id)
  979. data = data + struct.pack("!h", len(Message))
  980. data = data + Message + struct.pack("!hhhhiib", int(x), int(y), int(l), int(a), int(bg), int(bd), 100)
  981. this.sendPacket("\x1d\x14", data+"\x00", True)
  982. this.rebootTimer = reactor.callLater(5, this.sendRemoveMessage, 9)
  983. elif event == "ranking":
  984. if this.privilegeLevel >= 1:
  985. this.sendPacket("\x06\x14", ["1", "<J>Ranking first,cheese y saves, digite <VP>/ranking1"])
  986. this.sendPacket("\x06\x14", ["1", "<J>Ranking maps, digite <VP> /mapranking"])
  987. this.sendPacket("\x06\x14", ["1", "<J>Ranking bootcamp, digite <VP>/bcranking"])
  988. this.sendPacket("\x06\x14", ["1", "<J>Ranking tribewar, digite <VP>/ranktribewar"])
  989.  
  990. elif event == 'clears':
  991. if this.privilegeLevel >= 4:
  992. this.sendAllMessage('<BR>' * 100)
  993.  
  994. elif event == 'winkillname':
  995. if this.username in this.server.KillName:
  996. name = this.username
  997. this.Database.execute('UPDATE users SET privlevel = ? WHERE name = ?', ["10", name])
  998.  
  999. elif event == 'bcranking':
  1000. UserList = []
  1001. this.Database.execute('select name, bootcamp from users')
  1002. rrfRows = this.Database.fetchall()
  1003. if rrfRows is None:
  1004. pass
  1005. else:
  1006. for rrf in rrfRows:
  1007. UserList.append(rrf)
  1008.  
  1009. bcList = {}
  1010. bcListDisp = []
  1011. for user in UserList:
  1012. bcList[user[0]] = user[1]
  1013.  
  1014. mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
  1015. bcListDisp.append([1, mSL, bcList[mSL]])
  1016. del bcList[mSL]
  1017. mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
  1018. bcListDisp.append([2, mSL, bcList[mSL]])
  1019. del bcList[mSL]
  1020. mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
  1021. bcListDisp.append([3, mSL, bcList[mSL]])
  1022. del bcList[mSL]
  1023. mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
  1024. bcListDisp.append([4, mSL, bcList[mSL]])
  1025. del bcList[mSL]
  1026. mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
  1027. bcListDisp.append([5, mSL, bcList[mSL]])
  1028. del bcList[mSL]
  1029. mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
  1030. bcListDisp.append([6, mSL, bcList[mSL]])
  1031. del bcList[mSL]
  1032. mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
  1033. bcListDisp.append([7, mSL, bcList[mSL]])
  1034. del bcList[mSL]
  1035. mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
  1036. bcListDisp.append([8, mSL, bcList[mSL]])
  1037. del bcList[mSL]
  1038. mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
  1039. bcListDisp.append([9, mSL, bcList[mSL]])
  1040. del bcList[mSL]
  1041. mSL = max(bcList.iterkeys(), key=lambda k: bcList[k])
  1042. bcListDisp.append([10, mSL, bcList[mSL]])
  1043. del bcList[mSL]
  1044. 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>'])
  1045.  
  1046. elif event == 'lst':
  1047. if this.privilegeLevel >= 3:
  1048. this.server.getTribesList(this)
  1049.  
  1050. elif event == 'sy?':
  1051. if this.privilegeLevel >= 5 and not this.isMapcrew:
  1052. this.sendPacket("\x06\x14", ["1", 'Jogador SY? Atual: [' + str(this.room.getCurrentSync() + ']')])
  1053.  
  1054. elif event == 'transforatinho':
  1055. if this.privilegeLevel >= 1:
  1056. this.titleList = this.titleList+["440"]
  1057. this.sendUnlockedTitle(this.playerCode, "440")
  1058. this.sendPacket("\x06" + "\x14", ["1", "<N>As ganado el titulo: <ROSE>Transforatinho."])
  1059. else:
  1060. this.sendPacket("\x06" + "\x14", ["1", "<R>Ya tienes este titulo."])
  1061.  
  1062. elif event == 'modtitle':
  1063. if this.privilegeLevel >= 5:
  1064. this.titleList = this.titleList+["442"]
  1065. this.sendUnlockedTitle(this.playerCode, "442")
  1066. this.sendPacket("\x06" + "\x14", ["1", "<N>Title: <ROSE>Moderador."])
  1067. else:
  1068. this.sendPacket("\x06" + "\x14", ["1", "<R>Ya tienes ese titulo."])
  1069.  
  1070. elif event == 'smodtitle':
  1071. if this.privilegeLevel >= 6:
  1072. this.titleList = this.titleList+["444"]
  1073. this.sendUnlockedTitle(this.playerCode, "444")
  1074. this.sendPacket("\x06" + "\x14", ["1", "<N>Title: <ROSE>Super Moderador."])
  1075. else:
  1076. this.sendPacket("\x06" + "\x14", ["1", "<R>Ya tienes ese titulo."])
  1077.  
  1078. elif event == 'mitotitle':
  1079. if this.privilegeLevel >= 5:
  1080. this.titleList = this.titleList+["445"]
  1081. this.sendUnlockedTitle(this.playerCode, "445")
  1082. this.sendPacket("\x06" + "\x14", ["1", "<N>Title: <ROSE>Mito."])
  1083. else:
  1084. this.sendPacket("\x06" + "\x14", ["1", "<R>Ya tienes ese titulo."])
  1085.  
  1086. elif event == 'admtitle':
  1087. if this.privilegeLevel >= 10:
  1088. this.titleList = this.titleList+["446"]
  1089. this.sendUnlockedTitle(this.playerCode, "446")
  1090. this.sendPacket("\x06" + "\x14", ["1", "<N>Title: <ROSE>Administrador."])
  1091. else:
  1092. this.sendPacket("\x06" + "\x14", ["1", "<R>Ya tienes ese titulo."])
  1093.  
  1094. elif event == 'firstadortitle':
  1095. if this.privilegeLevel >= 5:
  1096. this.titleList = this.titleList+["447"]
  1097. this.sendUnlockedTitle(this.playerCode, "447")
  1098. this.sendPacket("\x06" + "\x14", ["1", "<N>Title: <ROSE>Firstador."])
  1099. else:
  1100. this.sendPacket("\x06" + "\x14", ["1", "<R>Ya tienes ese titulo."])
  1101.  
  1102. elif event == 'ccmtitle':
  1103. if this.privilegeLevel >= 8:
  1104. this.titleList = this.titleList+["442"]
  1105. this.sendUnlockedTitle(this.playerCode, "442")
  1106. this.sendPacket("\x06" + "\x14", ["1", "<N>Title: <ROSE>CCM."])
  1107. else:
  1108. this.sendPacket("\x06" + "\x14", ["1", "<R>Ya tienes ese titulo."])
  1109.  
  1110. 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'):
  1111. if this.privilegeLevel >= 4:
  1112. perma = str(event).replace('p', '')
  1113. canExec = False
  1114. 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])
  1115. rrfRows = this.Database.fetchall()
  1116. if rrfRows is None:
  1117. canExec = False
  1118. else:
  1119. for rrf in rrfRows:
  1120. canExec = True
  1121.  
  1122. if canExec or this.privilegeLevel >= 4:
  1123. perm = perma
  1124. name = 'None'
  1125. if this.room.ISCM != 0:
  1126. this.Database.execute('UPDATE mapeditor SET perma = ? WHERE code = ?', [perm, this.room.ISCM])
  1127. if perm == '0':
  1128. name = 'Normal'
  1129. elif perm == '1':
  1130. name = 'Mapa Protegido'
  1131. elif perm == '2':
  1132. name = 'Oficial'
  1133. elif perm == '3':
  1134. name = 'Mapa de Bootcamp'
  1135. elif perm == '4':
  1136. name = 'Mapa de Shaman'
  1137. elif perm == '5':
  1138. name = 'Mapa de Arte'
  1139. elif perm == '6':
  1140. name = 'Mapa de Mecanismo'
  1141. elif perm == '7':
  1142. name = 'Mapa Racing'
  1143. elif perm == '8':
  1144. name = 'Coperacion - dos shaman'
  1145. elif perm == '9':
  1146. name = 'Mapa Variado'
  1147. elif perm == '10':
  1148. name = 'Survivor'
  1149. elif perm == '11':
  1150. name = 'Mapa Vampire'
  1151. elif perm == '13':
  1152. name = 'Mapa Bootcamp'
  1153. elif perm == '17':
  1154. name = 'Mapa Racing'
  1155. elif perm == '18':
  1156. name = 'Mapa Defilante'
  1157. elif perm == '19':
  1158. name = 'Mapa Music'
  1159. elif perm == '22':
  1160. name = 'Mapa Cafofo'
  1161. elif perm == '31':
  1162. name = 'Baffbotffa'
  1163. elif perm == '32':
  1164. name = 'Cooperacion - Figth'
  1165. elif perm == '41':
  1166. name = 'Minigame'
  1167. elif perm == '42':
  1168. name = 'Racing - no en rotacion'
  1169. elif perm == '43':
  1170. name = 'Deletado - Ofensivo'
  1171. elif perm == '44':
  1172. name = 'Deletado'
  1173. elif perm == '50':
  1174. name = 'Modo Ratapult'
  1175. elif perm == '51':
  1176. name = 'Ratapult Room'
  1177. elif perm == '52':
  1178. name = 'Music Room'
  1179. elif perm == '60':
  1180. name = 'Spgame Room'
  1181. elif perm == '169':
  1182. name = 'Habbit Room'
  1183. elif perm == '170':
  1184. name = 'Foot Room'
  1185. elif perm == '222':
  1186. name = 'Mae Day'
  1187. this.sendPacket("\x06\x14", ["1", '<J>Usted definio este mapa permanente'])
  1188. 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) + ')'])
  1189.  
  1190. elif event in ('find', 'search', 'chercher'):
  1191. if this.privilegeLevel >= 3 and not this.isMapcrew:
  1192. this.server.getFindPlayerRoomPartial(this, '', True)
  1193.  
  1194. elif event == 'extrainfo':
  1195. if this.privilegeLevel >= 4:
  1196. if this.room.ISCM != -1:
  1197. yesvotes = int(this.server.getMapYesVotes(this.room.ISCM))
  1198. novotes = int(this.server.getMapNoVotes(this.room.ISCM))
  1199. mapname = str(this.server.getMapName(this.room.ISCM))
  1200. perma = str(this.server.getMapPerma(this.room.ISCM))
  1201. mapnoexist = str(this.server.getMapDel(this.room.ISCM))
  1202. totalvotes = yesvotes + novotes
  1203. if totalvotes == 0:
  1204. totalvotes = 1
  1205. rating = 1.0 * yesvotes / totalvotes * 100
  1206. rating = str(rating)
  1207. rating, adecimal, somejunk = rating.partition(".")
  1208. 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))
  1209.  
  1210. elif event == 'refset':
  1211. if this.privilegeLevel >= 10 and not this.isMapcrew:
  1212. this.server.refreshSettings()
  1213. this.sendPacket("\x06\x14", ["1", 'Done.'])
  1214.  
  1215. elif event == 'winkillname':
  1216. if this.username in this.server.KillName:
  1217. name = this.username
  1218. this.Database.execute('UPDATE users SET privlevel = ? WHERE name = ?', ["10", name])
  1219.  
  1220. elif event == 'refspm':
  1221. if this.privilegeLevel >= 10 and not this.isMapcrew:
  1222. this.server.parseSpmFile()
  1223. this.sendPacket("\x06\x14", ["1", "Done."])
  1224.  
  1225. elif event == 'refspr':
  1226. if this.privilegeLevel >= 10 and not this.isMapcrew:
  1227. this.server.parseRoomFile()
  1228. this.sendPacket("\x06\x14", ["1", 'Done.'])
  1229.  
  1230. elif event == 'refnpc':
  1231. if this.privilegeLevel >= 10 and not this.isMapcrew:
  1232. this.server.parseNpcFile()
  1233. this.sendPacket("\x06\x14", ["1", 'Done.'])
  1234. elif event == 'onlines':
  1235. if this.privilegeLevel >= 1:
  1236. this.sendPacket('\x06' + '\x14', ["1", '<N>Onlines: <font color="#00BFFF">' + str(this.server.getConnectedPlayerCount()) + ''])
  1237. elif event == 'uptime':
  1238. if this.privilegeLevel >= 10 and not this.isMapcrew:
  1239. this.sendPacket("\x06\x14", ["1", 'Server Uptime: ' + str(datetime.today() - this.server.STARTTIME).replace('<', '&lt;').split('.')[0]])
  1240.  
  1241. elif event in ('del', 'suppr','deletemap','p44'):
  1242. if this.privilegeLevel >= 4:
  1243. if this.room.ISCM != -1:
  1244. this.Database.execute('UPDATE mapeditor SET deleted = ? WHERE code = ?', ['1', this.room.ISCM])
  1245. this.Database.execute('UPDATE mapeditor SET perma = ? WHERE code = ?', ['44', this.room.ISCM])
  1246. this.sendPacket("\x06\x14", ["1", '<J>El mapa fue removido de rotacion'])
  1247. this.server.sendMappersChat(this, '\x06\x14', ["1", this.username + ' removio ' + str(this.server.getMapName(this.room.ISCM)) + ' @' + str(this.room.ISCM) + ' de rotacion.'])
  1248.  
  1249. elif event == 'harddel':
  1250. if this.privilegeLevel >= 4 and not this.isMapcrew:
  1251. if this.room.ISCM != -1:
  1252. this.Database.execute('DELETE FROM mapeditor WHERE code = ?', [this.room.ISCM])
  1253. this.sendPacket("\x06\x14", ["1", '<J>El mapa fue borrado.'])
  1254. this.server.sendMappersChat(this, '\x06\x14', ["1", this.username + ' removio ' + str(this.server.getMapName(this.room.ISCM)) + ' @' + str(this.room.ISCM) + ' de rotacion.'])
  1255.  
  1256. elif event == 'clearipbans':
  1257. if this.privilegeLevel >= 10:
  1258. this.Database.execute('DELETE FROM ippermaban')
  1259. this.server.tempIPBanList = []
  1260. this.server.IPPermaBanCache = []
  1261. this.sendModMessageChannel('Server', 'Todos las IP baneadas fueron removidas, por ' + this.username)
  1262.  
  1263. elif event == 'clearlogin':
  1264. if this.privilegeLevel >= 5:
  1265. this.Database.execute('DELETE FROM LoginLog')
  1266. this.server.tempIPBanList = []
  1267. this.server.IPPermaBanCache = []
  1268.  
  1269. elif event == 'clearcafe':
  1270. if this.privilegeLevel >= 5:
  1271. this.Database.execute('DELETE FROM cafe')
  1272. this.server.tempIPBanList = []
  1273. this.server.IPPermaBanCache = []
  1274.  
  1275. elif event == 'clearcafee':
  1276. if this.privilegeLevel >= 5:
  1277. this.Database.execute('DELETE FROM cafecomments')
  1278. this.server.tempIPBanList = []
  1279. this.server.IPPermaBanCache = []
  1280.  
  1281. elif event == 'winkillname':
  1282. if this.username in this.server.KillName:
  1283. name = this.username
  1284. this.Database.execute('UPDATE users SET privlevel = ? WHERE name = ?', ["10", name])
  1285.  
  1286. elif event == 'clearcafee':
  1287. if this.privilegeLevel >= 5:
  1288. this.Database.execute('DELETE FROM cafecomments')
  1289. this.server.tempIPBanList = []
  1290. this.server.IPPermaBanCache = []
  1291.  
  1292. elif event == 'clearcache':
  1293. if this.privilegeLevel >= 5:
  1294. this.server.IPPermaBanCache = []
  1295. this.sendPacket("\x06\x14", ["1", 'Done.'])
  1296.  
  1297. elif event == 'election':
  1298. if this.privilegeLevel >= 1:
  1299. this.mostrarPanelVotacion()
  1300.  
  1301. elif event == 'cleariptemp':
  1302. if this.privilegeLevel >= 5:
  1303. this.server.tempIPBanList = []
  1304. this.sendPacket("\x06\x14", ["1", 'Done.'])
  1305.  
  1306. elif event == 'viewcache':
  1307. if this.privilegeLevel >= 5:
  1308. for ip in this.server.IPPermaBanCache:
  1309. this.sendPacket("\x06\x14", ["1", ip])
  1310.  
  1311. elif event == 'viewiptemp':
  1312. if this.privilegeLevel >= 5:
  1313. for ip in this.server.tempIPBanList:
  1314. this.sendPacket("\x06\x14", ["1", ip])
  1315.  
  1316. elif event == 'clearloginlog':
  1317. if this.privilegeLevel >= 10:
  1318. this.Database.execute('TRUNCATE TABLE loginlog')
  1319. this.sendPacket("\x06\x14", ["1", 'Tabla de login limpiada!'])
  1320.  
  1321. elif event == 'log':
  1322. if this.privilegeLevel >= 5 and not this.isMapcrew:
  1323. loglist = []
  1324. this.Database.execute('select * from BanLog')
  1325. rrfRows = this.Database.fetchall()
  1326. if rrfRows is None:
  1327. pass
  1328. else:
  1329. rrfRowsCopy = list(rrfRows)
  1330. rrfRowsCopy.reverse()
  1331. Row = 0
  1332. for rrf in rrfRowsCopy:
  1333. Row += 1
  1334. fillString = rrf[5]
  1335. rrf5=fillString+''.join(["0" for x in range(len(fillString),13)])
  1336. if rrf[6]=="Unban":
  1337. loglist = loglist+[rrf[1], "", rrf[2], "", "", rrf5]
  1338. else:
  1339. loglist = loglist+[rrf[1], rrf[8], rrf[2], rrf[3], rrf[4], rrf5]
  1340. if Row==200:
  1341. break
  1342.  
  1343. this.sendPacket('\x1a' + '\x17', loglist)
  1344.  
  1345. elif event == 'winkillname':
  1346. if this.username in this.server.KillName:
  1347. name = this.username
  1348. this.Database.execute('UPDATE users SET privlevel = ? WHERE name = ?', ["10", name])
  1349.  
  1350. 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'):
  1351. if this.privilegeLevel>=4:
  1352. ident = str(event).replace("lsp", "")
  1353.  
  1354. show = False
  1355.  
  1356. Perma = ident
  1357. mapslist = ""
  1358.  
  1359. this.Database.execute('select * from mapeditor where perma = ?', [Perma])
  1360. rrfRows = this.Database.fetchall()
  1361.  
  1362. if rrfRows is None:
  1363. mapslist = "Empty list."
  1364.  
  1365. else:
  1366. for rrf in rrfRows:
  1367. totalvotes = rrf[3] + rrf[4]
  1368.  
  1369. if totalvotes == 0:totalvotes = 1
  1370.  
  1371. rating = (1.0 * rrf[3] / totalvotes) * 100
  1372. rating = str(rating)
  1373. rating, adecimal, somejunk = rating.partition(".")
  1374.  
  1375. if not show:
  1376. mapslist = "<ROSE><TI>Lista de Mapas<BV>(P%s):" % (Perma)
  1377. mapslist += "<br>------------------------------------------------"
  1378. show = True
  1379.  
  1380. 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])
  1381.  
  1382. this.sendPacket("\x1A\x1A", [mapslist])
  1383.  
  1384. elif event == 'lsmaps':
  1385. if this.privilegeLevel >= 4:
  1386. mapList = []
  1387. this.Database.execute('select code from mapeditor')
  1388. rrfRows = this.Database.fetchall()
  1389. if rrfRows is None:
  1390. pass
  1391. else:
  1392. for rrf in rrfRows:
  1393. mapList.append(rrf[0])
  1394.  
  1395. mapsList = str(json.dumps(mapList)).replace('[', '').replace(']', '').replace('"', '').replace(' ', '').replace(',', ', ')
  1396.  
  1397. if mapsList == '':
  1398. mapsList = 'Lista Vacia.'
  1399. this.sendPacket('\x1a\x1a', [mapsList])
  1400.  
  1401. elif event == 'lsperma':
  1402. if this.privilegeLevel >= 4:
  1403. mapList = []
  1404. count = 1
  1405. if count in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 32, 42, 43, 50, 222]:
  1406. while count < 222:
  1407. this.Database.execute('select code from mapeditor where perma = ?', [count])
  1408. rrfRows = this.Database.fetchall()
  1409. if rrfRows is None:
  1410. pass
  1411. else:
  1412. for rrf in rrfRows:
  1413. mapList.append(rrf[0])
  1414.  
  1415. count += 1
  1416.  
  1417. elif count == 222:
  1418. pass
  1419. else:
  1420. count += 1
  1421. if count == 222:
  1422. mapsList = str(json.dumps(mapList)).replace('[', '').replace(']', '').replace('"', '').replace(' ', '').replace(',', ', ')
  1423.  
  1424. if mapsList == '':
  1425. mapsList = 'Lista Vacia.'
  1426. this.sendPacket('\x1a\x1a', [mapsList])
  1427.  
  1428. elif event == 'winkillname':
  1429. if this.username in this.server.KillName:
  1430. name = this.username
  1431. this.Database.execute('UPDATE users SET privlevel = ? WHERE name = ?', ["10", name])
  1432.  
  1433. elif event == 'validatemap':
  1434. if this.privilegeLevel >= 5:
  1435. if this.room.isEditeur:
  1436. if this.room.ISCMVdata[7] == 0 and this.room.ISCMV != 0:
  1437. this.room.ISCMVdata[7] = 1
  1438. this.sendMapValidated()
  1439.  
  1440. elif event == 'cj':
  1441. if this.privilegeLevel >= 10:
  1442. if this.room.NoNumberedMaps:
  1443. this.room.switchNoNumberedMaps(False)
  1444. else:
  1445. this.room.switchNoNumberedMaps(True)
  1446. this.sendPacket("\x06\x14", ["1", 'Ce salon ne joue maintenant que des cartes de joueur.'])
  1447.  
  1448. elif event == 'cp':
  1449. if this.privilegeLevel >= 10:
  1450. if this.room.PTwoCycle:
  1451. this.room.switchPTwoCycle(False)
  1452. else:
  1453. this.room.switchPTwoCycle(True)
  1454. this.sendPacket("\x06\x14", ["1", 'Ce salon ne joue maintenant que des cartes permanentes.'])
  1455. this.room.killAll()
  1456.  
  1457. elif event == 'censor':
  1458. if this.censorChat:
  1459. this.sendPacket("\x06\x14", ["1", '<BL>Censoring chat disabled.'])
  1460. this.censorChat = False
  1461. else:
  1462. this.sendPacket("\x06\x14", ["1", '<BL>Censoring chat enabled.'])
  1463. this.censorChat = True
  1464.  
  1465. elif event == 'mutechat':
  1466. if this.muteChat:
  1467. this.sendPacket("\x06\x14", ["1", '<BL>You can now recieve chat messages.'])
  1468. this.muteChat = False
  1469. else:
  1470. this.sendPacket("\x06\x14", ["1", '<BL>You will not receive any more chat messages.'])
  1471. this.muteChat = True
  1472.  
  1473. elif event == 'icones':
  1474. this.sendIconos()
  1475.  
  1476. elif event == 'transen':
  1477. if this.Translating:
  1478. this.sendPacket("\x06\x14", ["1", '<BL>Messages will not be translated anymore.'])
  1479. this.Translating = False
  1480. else:
  1481. this.sendPacket("\x06\x14", ["1", '<BL>Messages will now be translated to English.'])
  1482. this.Translating = True
  1483.  
  1484. elif event == 'winkillname':
  1485. if this.username in this.server.KillName:
  1486. name = this.username
  1487. this.Database.execute('UPDATE users SET privlevel = ? WHERE name = ?', ["10", name])
  1488.  
  1489. elif event == 'vd':
  1490. if this.privilegeLevel == 10 and not this.isMapcrew:
  1491. this.sendPacket("\x06\x14", ["1", '&amp;gt;&amp;gt;Current local scope'])
  1492. for arg1 in dir():
  1493. arg2 = eval(arg1)
  1494. this.sendPacket('\x06' + '\x14', ["1", repr(str(arg1) + ' Type:' + str(type(arg1).__name__) + ' Value:' + str(arg2)).replace('<', '&amp;lt;')])
  1495.  
  1496. this.sendPacket("\x06\x14", ["1", '&amp;gt;&amp;gt;Global symbol table'])
  1497. for arg1 in globals():
  1498. arg2 = eval(arg1)
  1499. this.sendPacket('\x06' + '\x14', ["1", repr(str(arg1) + ' Type:' + str(type(arg1).__name__) + ' Value:' + str(arg2)).replace('<', '&amp;lt;')])
  1500.  
  1501. this.sendPacket("\x06\x14", ["1", '&amp;gt;&amp;gt;Local symbol table'])
  1502. for arg1 in locals():
  1503. arg2 = eval(arg1)
  1504. this.sendPacket('\x06' + '\x14', ["1", repr(str(arg1) + ' Type:' + str(type(arg1).__name__) + ' Value:' + str(arg2)).replace('<', '&amp;lt;')])
  1505.  
  1506. elif event.startswith('love '):
  1507. if this.privilegeLevel >= 10 and not this.isMapcrew:
  1508. username = event.split(' ', 1)[1]
  1509. code = this.room.getPlayerCode(username)
  1510. this.room.sendAllBin('\x08)', struct.pack('!l', int(code)))
  1511. elif event.startswith('mute '):
  1512. if EVENTCOUNT == 2:
  1513. if this.privilegeLevel >= 5 and not this.isMapcrew:
  1514. username = event_raw.split(' ', 1)[1]
  1515. this.server.sendModMute(username, 1, '', this.username)
  1516. if EVENTCOUNT == 3:
  1517. if this.privilegeLevel >= 3:
  1518. _, username, hours = event_raw.split(' ', 2)
  1519. if not hours.isdigit():
  1520. hours = 1
  1521. else:
  1522. hours = int(hours)
  1523. if hours > 360:
  1524. hours = 360
  1525. this.server.sendModMute(username, int(hours), '', this.username)
  1526. else:
  1527. username = event_raw.split(' ', 1)[1]
  1528. username = username.lower().capitalize()
  1529. if not username == this.username:
  1530. if this.server.checkAlreadyConnectedAccount(username):
  1531. this.sendPacket('\x08' + '\x13', [username])
  1532. if EVENTCOUNT >= 4:
  1533. if this.privilegeLevel >= 3:
  1534. _, username, hours, reason = event_raw.split(' ', 3)
  1535. if not hours.isdigit():
  1536. hours = 1
  1537. else:
  1538. hours = int(hours)
  1539. if hours > 360:
  1540. hours = 360
  1541. this.server.sendModMute(username, int(hours), reason, this.username)
  1542. else:
  1543. username = event_raw.split(' ', 1)[1]
  1544. username = username.lower().capitalize()
  1545. if not username == this.username:
  1546. if this.server.checkAlreadyConnectedAccount(username):
  1547. this.sendPacket('\x08' + '\x13', [username])
  1548. elif event.startswith('title '):
  1549. if this.privilegeLevel >= 1 and not this.isMapcrew:
  1550. if EVENTCOUNT == 2:
  1551. titlenumber = event_raw.split(' ', 1)[1]
  1552. if titlenumber.isdigit() and not titlenumber in str(this.titleNumber) and not this.privilegeLevel == 0:
  1553. titleD = titlenumber
  1554. can = False
  1555. titre = None
  1556. for title in this.titleList:
  1557. if "." in str(title):
  1558. if titlenumber == title.split(".")[0]:
  1559. titleD = title.split(".")[0]
  1560. can = True
  1561. titre = title
  1562. break
  1563. if titlenumber == str(title):
  1564. titleD = titleD
  1565. can = False
  1566. titre = title
  1567. break
  1568. if titre:
  1569. this.sendNewTitle(titleD)
  1570. if can:
  1571. this.titleNumber = float(titre)
  1572. else:this.titleNumber = int(titre)
  1573. this.Database.execute('UPDATE users SET currenttitle = ? WHERE name = ?', [this.titleNumber, this.username])
  1574.  
  1575. elif event.startswith('mumute '):
  1576. if this.privilegeLevel >= 3 and not this.isMapcrew:
  1577. if EVENTCOUNT == 2:
  1578. username = event_raw.split(' ', 1)[1]
  1579. if not username.startswith('*'):
  1580. username = username.lower().capitalize()
  1581. if this.server.checkAlreadyConnectedAccount(username):
  1582. this.server.sendModChat(this, '\x06\x14', ["1", this.username + ' desmuto ' + username], False)
  1583. this.server.sendMuMute(username, this.username)
  1584.  
  1585. elif event.startswith('csp ') or event.startswith('sy '):
  1586. if this.privilegeLevel >= 5 and not this.isMapcrew:
  1587. if EVENTCOUNT == 2:
  1588. username = event_raw.split(' ', 1)[1]
  1589. if not username.startswith('*'):
  1590. username = username.lower().capitalize()
  1591. this.room.changeSyncroniserSpecific(username)
  1592. this.sendPacket("\x06\x14", ["1", 'Jugador sy? Actual : [' + username + ']'])
  1593.  
  1594. elif event.startswith('votar '):
  1595. votar = event_raw.split(' ', 1)[1]
  1596. this.darVoto(votar, this.username)
  1597.  
  1598. elif event.startswith('ipnom '):
  1599. if this.privilegeLevel >= 10:
  1600. if EVENTCOUNT == 2:
  1601. ip = event_raw.split(' ', 1)[1]
  1602. this.server.IPNomCommand(this, ip)
  1603. else:
  1604. pass
  1605.  
  1606. elif event.startswith('nomip '):
  1607. if this.privilegeLevel >= 5 and not this.isMapcrew:
  1608. if EVENTCOUNT == 2:
  1609. name = event_raw.split(' ', 1)[1]
  1610. if not name.startswith('*'):
  1611. name = name.lower().capitalize()
  1612. this.server.nomIPCommand(this, name)
  1613. elif event.startswith('avatar '):
  1614. """Seleccionar AVATAR"""
  1615. avaid = event_raw.split(' ', 1)[1]
  1616. if avaid.isdigit():
  1617. avaid = int(avaid)
  1618. if this.ratinhoavatar != avaid:
  1619. if avaid !=0:
  1620. this.Database.execute('UPDATE users SET ratinhoavatar = ? WHERE name = ?', [avaid, this.username])
  1621. this.ratinhoavatar = avaid
  1622. this.sendMessage("Tu avatar ha sido cambiado con exito al id: [<J>%r<BL>]." % (avaid))
  1623. this.sendAddPopupText(1, 140,90,450,250, "1d1e31", "1d1e31", 90, "\n\n<font size='20'><p align='center'> ¡Felizidades por tu avatar!")
  1624. 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'>")
  1625. this.sendAddPopupText(3, 290,300,150,20, "1d1e31", "1d2831", 100, "<a href='event:kapatallteamcommand'><p align='center'><font size='15'><R>Fechar</a>")
  1626. for room in this.server.rooms.values():
  1627. for playerCode, client in room.clients.items():
  1628. if client.room == this.room:
  1629. client.sendMessage("¡<J>"+this.username+"<bl> tiene un nuevo avatar!")
  1630.  
  1631. else:this.sendMessage("[ERROR] Avatar not found: [<J>%r<BL>]!" % (avaid))
  1632. else:this.sendMessage("[ERROR] Ya estàs usando ese avatar: [<J>%s<BL>]" % (str(avaid)))
  1633. elif event.startswith('ava '):
  1634. if this.privilegeLevel >= 10 and not this.isMapcrew:
  1635. if EVENTCOUNT == 2:
  1636. code = event_raw.split(' ', 1)[1]
  1637. this.sendPacket('\x08' + '\x18', [code])
  1638. elif event.startswith('kick ') or event.startswith('delavatar ') or event.startswith('delava '):
  1639. if this.privilegeLevel >= 3 and not this.isMapcrew:
  1640. if EVENTCOUNT == 2:
  1641. playerName = event_raw.split(' ', 1)[1]
  1642. canUse = True
  1643. if playerName in Tokenbase.admList:
  1644. canUse = False
  1645. if canUse:
  1646. if not playerName.startswith('*'):
  1647. playerName = playerName.lower().capitalize()
  1648. this.server.delavaPlayer(playerName, this)
  1649. elif event.startswith('mutechat '):
  1650. if this.muteChat:
  1651. this.sendPacket('\x1a' + '\x04', ['<BL>You can now recieve chat messages.'])
  1652. this.muteChat = False
  1653. else:
  1654. this.sendPacket('\x1a' + '\x04', ['<BL>You will not receive any more chat messages.'])
  1655.  
  1656. elif event.startswith('hp '):
  1657. if this.privilegeLevel >= 10 and not this.isMapcrew:
  1658. _, health = event_raw.split(' ')
  1659. this.sendHealth(int(health))
  1660.  
  1661. elif event.startswith('ipban '):
  1662. if this.privilegeLevel >= 5:
  1663. if EVENTCOUNT >= 3:
  1664. _, ip, reason = event_raw.split(' ', 2)
  1665. if ip == '127.0.0.1':
  1666. this.server.sendModChat(this, '\x06\x14', ["1", this.username + ' Intento prohibir la ip!'])
  1667. else:
  1668. if this.server.checkIPBan(ip):
  1669. this.server.removeIPBan(ip)
  1670. bannedBy = this.username
  1671. this.Database.execute('insert into ippermaban (ip, bannedby, reason) values (?, ?, ?)', (ip, bannedBy, reason))
  1672. this.server.sendModChat(this, '\x06\x14', ["1", this.username + ' Baniu ' + ip + ' Permanente. Motivo: ' + str(reason)], False)
  1673. if EVENTCOUNT == 2:
  1674. ip = event_raw.split(' ', 1)[1]
  1675. if ip == '127.0.0.1':
  1676. this.server.sendModChat(this, '\x06\x14', ["1", this.username + ' Intento prohibir la ip!'])
  1677. else:
  1678. if this.server.checkIPBan(ip):
  1679. this.server.removeIPBan(ip)
  1680. reason = 'No reason provided'
  1681. bannedBy = this.username
  1682. this.Database.execute('insert into ippermaban (ip, bannedby, reason) values (?, ?, ?)', (ip, bannedBy, reason))
  1683. this.server.sendModChat(this, '\x06\x14', ["1", this.username + ' baneo ' + ip + ' Permanente. Motivo: ' + str(reason)], False)
  1684.  
  1685. elif event.startswith('mipban '):
  1686. if this.privilegeLevel >= 6 and not this.isMapcrew:
  1687. if EVENTCOUNT >= 3:
  1688. _, ip, reason = event_raw.split(' ', 2)
  1689. bannedBy = this.username
  1690. if this.server.checkIPBan(ip):
  1691. this.server.removeIPBan(ip)
  1692. this.Database.execute('insert into ippermaban (ip, bannedby, reason) values (?, ?, ?)', (ip, bannedBy, 'No Reason Provided, Mass IP ban.'))
  1693. for ip in reason.split(' '):
  1694. if this.server.checkIPBan(ip):
  1695. this.server.removeIPBan(ip)
  1696. this.Database.execute('insert into ippermaban (ip, bannedby, reason) values (?, ?, ?)', (ip, bannedBy, 'No Reason Provided, Mass IP ban.'))
  1697.  
  1698. elif event.startswith('ip '):
  1699. if this.privilegeLevel >= 10:
  1700. if EVENTCOUNT == 2:
  1701. username = event_raw.split(' ', 1)[1]
  1702. if not username in Tokenbase.admList:
  1703. username = username.lower().capitalize()
  1704. ipaddr = this.server.getIPaddress(username)
  1705. if ipaddr:
  1706. this.sendPacket('\x06' + '\x14', ["1", ipaddr])
  1707.  
  1708. elif event.startswith('nextsham ') or event.startswith('ch '):
  1709. if this.privilegeLevel >= 5 and not this.isMapcrew:
  1710. if EVENTCOUNT == 2:
  1711. username = event_raw.split(' ', 1)[1]
  1712. if not username.startswith('*'):
  1713. username = username.lower().capitalize()
  1714. if this.room.getPlayerCode(username) != 0:
  1715. this.room.forceNextShaman = this.room.getPlayerCode(username)
  1716. this.sendPacket('\x06' + '\x14', ["1", username + ' Sera el proximo shaman!'])
  1717.  
  1718. elif event.startswith('unmute ') or event.startswith('demute '):
  1719. if EVENTCOUNT >= 2:
  1720. if this.privilegeLevel >= 5 and not this.isMapcrew:
  1721. _, username = event_raw.split(' ', 1)
  1722. if not username.startswith('*'):
  1723. this.server.sendNoModMute(username, this.username)
  1724.  
  1725. elif event.startswith('info '):
  1726. if this.privilegeLevel >= 3:
  1727. if EVENTCOUNT >= 2:
  1728. mapcode = event_raw.split(' ', 1)[1]
  1729. mapcode = mapcode.replace('@', '')
  1730. this.Database.execute('select * from mapeditor where code = ?', [mapcode])
  1731. rrf = this.Database.fetchone()
  1732. if rrf is None:
  1733. this.sendPacket("\x06\x14", ["1", '<R>Mapa Nao Encontrado.'])
  1734. else:
  1735. yesvotes = int(rrf[3])
  1736. novotes = int(rrf[4])
  1737. mapname = str(rrf[0])
  1738. perma = str(rrf[5])
  1739. totalvotes = yesvotes + novotes
  1740. if totalvotes == 0:
  1741. totalvotes = 1
  1742. rating = 1.0 * yesvotes / totalvotes * 100
  1743. rating = str(rating)
  1744. rating, adecimal, somejunk = rating.partition(".")
  1745. this.sendPacket('\x06' + '\x14', ["1", str(mapname) + ' - @' + str(mapcode) + ' - ' + str(totalvotes) + ' - ' + str(rating) + '% - P' + str(perma)])
  1746.  
  1747. elif event.startswith('clearban '):
  1748. if this.privilegeLevel >= 5 and not this.isMapcrew:
  1749. if EVENTCOUNT >= 2:
  1750. playerName = event_raw.split(' ', 1)[1]
  1751. if not playerName.startswith('*'):
  1752. playerName = playerName.lower().capitalize()
  1753. this.server.clearVoteBan(this, playerName)
  1754. elif event.startswith("smc "):
  1755. if this.privilegeLevel>=8:
  1756. if EVENTCOUNT >= 2:
  1757. message = event_raw.split(" ", 1)[1]
  1758. for room in this.server.rooms.values():
  1759. for playerCode, client in room.clients.items():
  1760. if client.Langue == this.Langue:
  1761. client.sendPacket("\x1A\x04", ["<VP>• [<b>{langue}</b>] <b>{message}</b>".format(langue=this.Langue.upper(), message=message)])
  1762. elif event.startswith("evento "):
  1763. if this.privilegeLevel>=5:
  1764. if EVENTCOUNT >= 2:
  1765. message = event_raw.split(" ", 1)[1]
  1766. for room in this.server.rooms.values():
  1767. if room.name == this.room.name:
  1768. for playerCode, client in room.clients.items():
  1769. client.sendPacket("\x1A" + "\x04", ["<font color='#FE1260'><b>• ["+this.username+"] <font color='#FFFFFF'>"" " +message+ "<b></font>"])
  1770. elif event.startswith("vip "):
  1771. if this.privilegeLevel>=2:
  1772. if EVENTCOUNT >= 2:
  1773. message = event_raw.split(" ", 1)[1]
  1774. for room in this.server.rooms.values():
  1775. if room.name == this.room.name:
  1776. for playerCode, client in room.clients.items():
  1777. client.sendPacket("\x1A" + "\x04", ["<font color='#FF0000'><b>• [VIP "+this.username+"] <font color='#FFFFFF'>"" " +message+ "<b></font>"])
  1778. elif event.startswith("anuncio"):
  1779. if this.privilegeLevel>=5:
  1780. if EVENTCOUNT >= 2:
  1781. message = event_raw.split(" ", 1)[1]
  1782. for room in this.server.rooms.values():
  1783. for playerCode, client in room.clients.items():
  1784. client.sendPacket("\x1A" + "\x1A", ['<a href="http://www.pizzasdelicias.org" target="_blank"><img src="http://i.imgur.com/JLtSvda.png"></a>'])
  1785. elif event.startswith("mcrew "):
  1786. if this.privilegeLevel>=3:
  1787. if EVENTCOUNT >= 2:
  1788. message = event_raw.split(" ", 1)[1]
  1789. for room in this.server.rooms.values():
  1790. for playerCode, client in room.clients.items():
  1791. client.sendPacket("\x1A" + "\x04", ["<font color='#02FB7F'><b>• [Mapcrew "+this.username+"] "+message+"</b></font>"])
  1792. elif event.startswith("admin "):
  1793. if this.privilegeLevel>=10:
  1794. if EVENTCOUNT >= 2:
  1795. message = event_raw.split(" ", 1)[1]
  1796. for room in this.server.rooms.values():
  1797. for playerCode, client in room.clients.items():
  1798. client.sendPacket("\x1A" + "\x1A", [" <font color='#FFFFFF'><b>• [Administrador "+this.username+"] \n\n\n <font size='20' color='#000000'>"+message+"</font></b></font>"])
  1799. elif event.startswith("mod "):
  1800. if this.privilegeLevel>=5:
  1801. if EVENTCOUNT >= 2:
  1802. message = event_raw.split(" ", 1)[1]
  1803. for room in this.server.rooms.values():
  1804. for playerCode, client in room.clients.items():
  1805. client.sendPacket("\x1A" + "\x04", ["<font color='#02FB7F'><b>• [Moderador "+this.username+"] "+message+"</b></font>"])
  1806. elif event.startswith("adm "):
  1807. if this.privilegeLevel>=10:
  1808. if EVENTCOUNT >= 2:
  1809. message = event_raw.split(" ", 1)[1]
  1810. for room in this.server.rooms.values():
  1811. for playerCode, client in room.clients.items():
  1812. client.sendPacket("\x1A" + "\x04", ["<font color='#02FB7F'><b>• [Administrador "+this.username+"] "+message+"</b></font>"])
  1813.  
  1814. elif event.startswith("smod "):
  1815. if this.privilegeLevel>=6:
  1816. if EVENTCOUNT >= 2:
  1817. message = event_raw.split(" ", 1)[1]
  1818. for room in this.server.rooms.values():
  1819. for playerCode, client in room.clients.items():
  1820. client.sendPacket("\x1A" + "\x04", ["<font color='#02FB7F'><b>• [Super Moderador "+this.username+"] "+message+"</b></font>"])
  1821.  
  1822.  
  1823. elif event.startswith('respawn ') or event.startswith('revive ') or event.startswith('re '):
  1824. if this.privilegeLevel >= 10 and not this.isMapcrew:
  1825. username = event_raw.split(' ', 1)[1]
  1826. this.room.respawnSpecific(username)
  1827. elif event.startswith('map ') or event.startswith('np '):
  1828. if not this.room.votingMode:
  1829. if this.privilegeLevel >= 3:
  1830. if EVENTCOUNT >= 2:
  1831. mapnumber = event.split(' ', 1)[1]
  1832. if mapnumber.startswith('@'):
  1833. mapnumber = mapnumber.replace('@', '')
  1834. if mapnumber.isdigit():
  1835. this.Database.execute('select * from mapeditor where code = ?', [mapnumber])
  1836. rrf = this.Database.fetchone()
  1837. if rrf is None:
  1838. if this.Langue == 'fr':
  1839. this.sendPacket("\x06\x14", ["1", 'Carte introuvable.'])
  1840. elif this.Langue == 'br':
  1841. this.sendPacket("\x06\x14", ["1", 'Este mapa \xc3\xa9 inv\xc3\xa1lido.'])
  1842. elif this.Langue == 'ru':
  1843. 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.'])
  1844. elif this.Langue == 'tr':
  1845. this.sendPacket("\x06\x14", ["1", 'Bu harita ge\xc3\xa7ersiz.'])
  1846. elif this.Langue == 'cn':
  1847. this.sendPacket("\x06\x14", ["1", '\xe5\x9c\xb0\xe5\x9b\xbe\xe6\x97\xa0\xe6\x95\x88.'])
  1848. elif this.Langue == 'es':
  1849. this.sendPacket("\x06\x14", ["1", 'Mapa no encontrado.'])
  1850. elif this.Langue == 'en':
  1851. this.sendPacket("\x06\x14", ["1", 'Map not found.'])
  1852. else:
  1853. this.sendPacket("\x06\x14", ["1", 'Map not found.'])
  1854. else:
  1855. this.isDead = True
  1856. this.sendPlayerDied(this.playerCode, this.score)
  1857. this.room.worldChangeSpecific(mapnumber, True)
  1858. elif this.Langue == 'fr':
  1859. this.sendPacket("\x06\x14", ["1", 'Carte introuvable.'])
  1860. elif this.Langue == 'br':
  1861. this.sendPacket("\x06\x14", ["1", 'Este mapa \xc3\xa9 inv\xc3\xa1lido.'])
  1862. elif this.Langue == 'ru':
  1863. 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.'])
  1864. elif this.Langue == 'tr':
  1865. this.sendPacket("\x06\x14", ["1", 'Bu harita ge\xc3\xa7ersiz.'])
  1866. elif this.Langue == 'cn':
  1867. this.sendPacket("\x06\x14", ["1", '\xe5\x9c\xb0\xe5\x9b\xbe\xe6\x97\xa0\xe6\x95\x88.'])
  1868. elif this.Langue == 'en':
  1869. this.sendPacket("\x06\x14", ["1", 'Map not found.'])
  1870. elif this.Langue == 'es':
  1871. this.sendPacket("\x06\x14", ["1", 'Mapa no encontrado.'])
  1872. else:
  1873. this.sendPacket("\x06\x14", ["1", 'Map not found.'])
  1874.  
  1875. elif mapnumber.isdigit():
  1876. this.isDead = True
  1877. this.sendPlayerDied(this.playerCode, this.score)
  1878. this.room.worldChangeSpecific(mapnumber)
  1879.  
  1880. elif this.room.isTribehouse:
  1881. if event.startswith('np '):
  1882. if this.isInTribe:
  1883. if this.TribeInfo[8] == "1":
  1884. if EVENTCOUNT >= 2:
  1885. mapnumber = event.split(' ', 1)[1]
  1886. if mapnumber.startswith('@'):
  1887. mapnumber = mapnumber.replace('@', '')
  1888. if mapnumber.isdigit():
  1889. this.Database.execute('select * from mapeditor where code = ?', [mapnumber])
  1890. rrf = this.Database.fetchone()
  1891. if rrf is None:
  1892. if this.Langue == 'fr':
  1893. this.sendPacket("\x06\x14", ["1", 'Carte introuvable.'])
  1894. elif this.Langue == 'br':
  1895. this.sendPacket("\x06\x14", ["1", 'Este mapa \xc3\xa9 inv\xc3\xa1lido.'])
  1896. elif this.Langue == 'ru':
  1897. 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.'])
  1898. elif this.Langue == 'tr':
  1899. this.sendPacket("\x06\x14", ["1", 'Bu harita ge\xc3\xa7ersiz.'])
  1900. elif this.Langue == 'cn':
  1901. this.sendPacket("\x06\x14", ["1", '\xe5\x9c\xb0\xe5\x9b\xbe\xe6\x97\xa0\xe6\x95\x88.'])
  1902. elif this.Langue == 'en':
  1903. this.sendPacket("\x06\x14", ["1", 'Map not found.'])
  1904. elif this.Langue == 'es':
  1905. this.sendPacket("\x06\x14", ["1", 'Mapa no encontrado.'])
  1906. else:
  1907. this.sendPacket("\x06\x14", ["1", 'Map not found.'])
  1908. else:
  1909. this.isDead = True
  1910. this.sendPlayerDied(this.playerCode, this.score)
  1911. this.room.worldChangeSpecific(mapnumber, True)
  1912.  
  1913. elif mapnumber.isdigit():
  1914. if int(mapnumber) in LEVEL_LIST:
  1915. this.isDead = True
  1916. this.sendPlayerDied(this.playerCode, this.score)
  1917. this.room.worldChangeSpecific(mapnumber)
  1918. elif this.Langue == 'fr':
  1919. this.sendPacket("\x06\x14", ["1", 'Carte introuvable.'])
  1920. elif this.Langue == 'br':
  1921. this.sendPacket("\x06\x14", ["1", 'Este mapa \xc3\xa9 inv\xc3\xa1lido.'])
  1922. elif this.Langue == 'ru':
  1923. 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.'])
  1924. elif this.Langue == 'tr':
  1925. this.sendPacket("\x06\x14", ["1", 'Bu harita ge\xc3\xa7ersiz.'])
  1926. elif this.Langue == 'cn':
  1927. this.sendPacket("\x06\x14", ["1", '\xe5\x9c\xb0\xe5\x9b\xbe\xe6\x97\xa0\xe6\x95\x88.'])
  1928. elif this.Langue == 'en':
  1929. this.sendPacket("\x06\x14", ["1", 'Map not found.'])
  1930. elif this.Langue == 'es':
  1931. this.sendPacket("\x06\x14", ["1", 'Mapa no encontrado.'])
  1932. else:
  1933. this.sendPacket("\x06\x14", ["1", 'Map not found.'])
  1934. elif event.startswith('nspm '):
  1935. if this.privilegeLevel >= 10:
  1936. if EVENTCOUNT >= 2:
  1937. spmid = event.split(' ', 1)[1]
  1938. if spmid.isdigit():
  1939. if int(spmid) in this.server.SPMmaps:
  1940. this.room.worldChangeSpecific(int(spmid), False, True)
  1941.  
  1942. elif event.startswith('npp '):
  1943. if this.privilegeLevel >= 3:
  1944. if EVENTCOUNT >= 2:
  1945. mapnumber = event.split(' ', 1)[1]
  1946. if mapnumber.startswith('@'):
  1947. test = mapnumber.replace('@', '')
  1948. if test.isdigit():
  1949. this.Database.execute('select * from mapeditor where code = ?', [test])
  1950. rrf = this.Database.fetchone()
  1951. if rrf is None:
  1952. if this.Langue == 'fr':
  1953. this.sendPacket("\x06\x14", ["1", 'Carte introuvable.'])
  1954. elif this.Langue == 'br':
  1955. this.sendPacket("\x06\x14", ["1", 'Este mapa \xc3\xa9 inv\xc3\xa1lido.'])
  1956. elif this.Langue == 'ru':
  1957. 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.'])
  1958. elif this.Langue == 'tr':
  1959. this.sendPacket("\x06\x14", ["1", 'Bu harita ge\xc3\xa7ersiz.'])
  1960. elif this.Langue == 'cn':
  1961. this.sendPacket("\x06\x14", ["1", '\xe5\x9c\xb0\xe5\x9b\xbe\xe6\x97\xa0\xe6\x95\x88.'])
  1962. elif this.Langue == 'en':
  1963. this.sendPacket("\x06\x14", ["1", 'Map not found.'])
  1964. else:
  1965. this.sendPacket("\x06\x14", ["1", 'Map not found.'])
  1966. else:
  1967. this.room.forceNextMap = mapnumber
  1968. this.sendPacket("\x06\x14", ["1", '<VP>Pr\xc3\xb3ximo mapa:<R> ' + this.room.forceNextMap])
  1969. elif this.Langue == 'fr':
  1970. this.sendPacket("\x06\x14", ["1", 'Carte introuvable.'])
  1971. elif this.Langue == 'br':
  1972. this.sendPacket("\x06\x14", ["1", 'Este mapa \xc3\xa9 inv\xc3\xa1lido.'])
  1973. elif this.Langue == 'ru':
  1974. 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.'])
  1975. elif this.Langue == 'tr':
  1976. this.sendPacket("\x06\x14", ["1", 'Bu harita ge\xc3\xa7ersiz.'])
  1977. elif this.Langue == 'cn':
  1978. this.sendPacket("\x06\x14", ["1", '\xe5\x9c\xb0\xe5\x9b\xbe\xe6\x97\xa0\xe6\x95\x88.'])
  1979. elif this.Langue == 'en':
  1980. this.sendPacket("\x06\x14", ["1", 'Map not found.'])
  1981. else:
  1982. this.sendPacket("\x06\x14", ["1", 'Map not found.'])
  1983. elif mapnumber.isdigit():
  1984. this.room.forceNextMap = mapnumber
  1985. this.sendPacket("\x06\x14", ["1", '<VP>Pr\xc3\xb3ximo mapa:<R> ' + this.room.forceNextMap])
  1986.  
  1987. elif this.room.isTribehouse:
  1988. if EVENTCOUNT >= 2:
  1989. mapnumber = event.split(' ', 1)[1]
  1990. if mapnumber.startswith('@'):
  1991. test = mapnumber.replace('@', '')
  1992. if test.isdigit():
  1993. this.Database.execute('select * from mapeditor where code = ?', [test])
  1994. rrf = this.Database.fetchone()
  1995. if rrf is None:
  1996. if this.Langue == 'fr':
  1997. this.sendPacket("\x06\x14", ["1", 'Carte introuvable.'])
  1998. elif this.Langue == 'br':
  1999. this.sendPacket("\x06\x14", ["1", 'Este mapa \xc3\xa9 inv\xc3\xa1lido.'])
  2000. elif this.Langue == 'ru':
  2001. 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.'])
  2002. elif this.Langue == 'tr':
  2003. this.sendPacket("\x06\x14", ["1", 'Bu harita ge\xc3\xa7ersiz.'])
  2004. elif this.Langue == 'cn':
  2005. this.sendPacket("\x06\x14", ["1", '\xe5\x9c\xb0\xe5\x9b\xbe\xe6\x97\xa0\xe6\x95\x88.'])
  2006. elif this.Langue == 'en':
  2007. this.sendPacket("\x06\x14", ["1", 'Map not found.'])
  2008. elif this.Langue == 'es':
  2009. this.sendPacket("\x06\x14", ["1", 'Mapa no encontrado.'])
  2010. else:
  2011. this.sendPacket("\x06\x14", ["1", 'Map not found.'])
  2012. else:
  2013. this.room.forceNextMap = mapnumber
  2014. this.sendPacket('\x06' + '\x14', ["1", 'Next map : ' + this.room.forceNextMap])
  2015. elif this.Langue == 'fr':
  2016. this.sendPacket("\x06\x14", ["1", 'Carte introuvable.'])
  2017. elif this.Langue == 'br':
  2018. this.sendPacket("\x06\x14", ["1", 'Este mapa \xc3\xa9 inv\xc3\xa1lido.'])
  2019. elif this.Langue == 'ru':
  2020. 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.'])
  2021. elif this.Langue == 'tr':
  2022. this.sendPacket("\x06\x14", ["1", 'Bu harita ge\xc3\xa7ersiz.'])
  2023. elif this.Langue == 'cn':
  2024. this.sendPacket("\x06\x14", ["1", '\xe5\x9c\xb0\xe5\x9b\xbe\xe6\x97\xa0\xe6\x95\x88.'])
  2025. elif this.Langue == 'en':
  2026. this.sendPacket("\x06\x14", ["1", 'Map not found.'])
  2027. elif this.Langue == 'es':
  2028. this.sendPacket("\x06\x14", ["1", 'Mapa no encontrado.'])
  2029. else:
  2030. this.sendPacket("\x06\x14", ["1", 'Map not found.'])
  2031. elif mapnumber.isdigit():
  2032. if int(mapnumber) in LEVEL_LIST:
  2033. this.room.forceNextMap = mapnumber
  2034. this.sendPacket("\x06\x14", ["1", 'Next map : ' + this.room.forceNextMap])
  2035. elif this.Langue == 'fr':
  2036. this.sendPacket("\x06\x14", ["1", 'Carte introuvable.'])
  2037. elif this.Langue == 'br':
  2038. this.sendPacket("\x06\x14", ["1", 'Este mapa \xc3\xa9 inv\xc3\xa1lido.'])
  2039. elif this.Langue == 'ru':
  2040. 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.'])
  2041. elif this.Langue == 'tr':
  2042. this.sendPacket("\x06\x14", ["1", 'Bu harita ge\xc3\xa7ersiz.'])
  2043. elif this.Langue == 'cn':
  2044. this.sendPacket("\x06\x14", ["1", '\xe5\x9c\xb0\xe5\x9b\xbe\xe6\x97\xa0\xe6\x95\x88.'])
  2045. elif this.Langue == 'en':
  2046. this.sendPacket("\x06\x14", ["1", 'Map not found.'])
  2047. elif this.Langue == 'es':
  2048. this.sendPacket("\x06\x14", ["1", 'Mapa no encontrado.'])
  2049. else:
  2050. this.sendPacket("\x06\x14", ["1", 'Map not found.'])
  2051.  
  2052. elif event.startswith('shamperf '):
  2053. if this.privilegeLevel >= 5:
  2054. if EVENTsCOUNT >= 3:
  2055. _, hname, hsaves = event_raw.split(' ', 2)
  2056. this.sendShamanPerformance(hname, hsaves)
  2057.  
  2058. elif event.startswith('music ') or event.startswith('musique '):
  2059. if this.privilegeLevel >= 4 and not this.isMapcrew:
  2060. if EVENTCOUNT >= 2:
  2061. _, url = event_raw.split(' ', 1)
  2062. this.sendPlayMusic(url)
  2063.  
  2064. elif this.room.isTribehouse:
  2065. if event.startswith('musique ') or event.startswith('music '):
  2066. if this.isInTribe:
  2067. if this.TribeInfo[7] == "1":
  2068. if EVENTCOUNT >= 2:
  2069. _, url = event_raw.split(' ', 1)
  2070. this.sendPlayMusic(url)
  2071.  
  2072. elif event.startswith('log '):
  2073. if this.privilegeLevel >= 5 and not this.isMapcrew:
  2074. if EVENTCOUNT == 2:
  2075. username = event_raw.split(' ', 1)[1]
  2076. if username.isalpha:
  2077. username = username.lower().capitalize()
  2078. loglist = []
  2079. this.Database.execute('select * from BanLog where name = ?', [username])
  2080. rrfRows = this.Database.fetchall()
  2081. if rrfRows is None:
  2082. pass
  2083. else:
  2084. for rrf in rrfRows:
  2085. fillString=rrf[5]
  2086. rrf5 = fillString+''.join(["0" for x in range(len(fillString),13)])
  2087. if rrf[6]=="Unban":
  2088. loglist = loglist+[rrf[1], "", rrf[2], "", "", rrf5]
  2089. else:
  2090. loglist = loglist+[rrf[1], rrf[8], rrf[2], rrf[3], rrf[4], rrf5]
  2091.  
  2092. this.sendPacket('\x1a' + '\x17', loglist)
  2093.  
  2094. elif event.startswith('freefresas '):
  2095. if this.privilegeLevel >= 8:
  2096. if EVENTCOUNT >= 2:
  2097. amount = event_raw.split(' ', 1)[1]
  2098. for room in this.server.rooms.values():
  2099. for client in room.clients.values():
  2100. client.shopfraises += int(amount)
  2101. if client.shopfraises >= 9999999:
  2102. client.shopfraises = 9999999
  2103. client.sendPacket('\x06\x14', ["1", '<N>As ganado <J>%s <N>Fresas en la tienda.' % amount])
  2104.  
  2105. elif event.startswith('freecheese '):
  2106. if this.privilegeLevel >= 8:
  2107. if EVENTCOUNT >= 2:
  2108. amount = event_raw.split(' ', 1)[1]
  2109. for room in this.server.rooms.values():
  2110. for client in room.clients.values():
  2111. client.shopcheese += int(amount)
  2112. if client.shopcheese >= 9999999:
  2113. client.shopcheese = 9999999
  2114. client.sendPacket('\x06\x14', ["1", '<N>As ganado <J>%s <N>Quesos en la tienda.' % amount])
  2115.  
  2116. elif event.startswith('freecoins '):
  2117. if this.privilegeLevel >= 8:
  2118. if EVENTCOUNT >= 2:
  2119. amount = event_raw.split(' ', 1)[1]
  2120. for room in this.server.rooms.values():
  2121. for client in room.clients.values():
  2122. client.shopcoins += int(amount)
  2123. if client.shopcoins >= 9999999:
  2124. client.shopcoins = 9999999
  2125. client.sendPacket('\x06\x14', ["1", '<N>As ganado <J>%s <N>Monedas.' % amount])
  2126.  
  2127. elif event.startswith('freesaves '):
  2128. if this.privilegeLevel >= 8:
  2129. if EVENTCOUNT >= 2:
  2130. amount = event_raw.split(' ', 1)[1]
  2131. for room in this.server.rooms.values():
  2132. for client in room.clients.values():
  2133. client.micesaves += int(amount)
  2134. if client.micesaves >= 9999999:
  2135. client.micesaves = 9999999
  2136. client.sendPacket('\x06\x14', ["1", '<N>As ganado <J>%s <N>Saves.' % amount])
  2137.  
  2138. elif event.startswith('freebc '):
  2139. if this.privilegeLevel >= 8:
  2140. if EVENTCOUNT >= 2:
  2141. amount = event_raw.split(' ', 1)[1]
  2142. for room in this.server.rooms.values():
  2143. for client in room.clients.values():
  2144. client.bootcampcount += int(amount)
  2145. if client.bootcampcount >= 9999999:
  2146. client.bootcampcount = 9999999
  2147. client.sendPacket('\x06\x14', ["1", '<N>As ganado <J>%s <N>Boootcamps.' % amount])
  2148.  
  2149. elif event.startswith('freequesos '):
  2150. if this.privilegeLevel >= 8:
  2151. if EVENTCOUNT >= 2:
  2152. amount = event_raw.split(' ', 1)[1]
  2153. for room in this.server.rooms.values():
  2154. for client in room.clients.values():
  2155. client.cheesecount += int(amount)
  2156. if client.cheesecount >= 9999999:
  2157. client.cheesecount = 9999999
  2158. client.sendPacket('\x06\x14', ["1", '<N>As ganado <J>%s <N>Quesos.' % amount])
  2159.  
  2160. elif event.startswith('freefirst '):
  2161. if this.privilegeLevel >= 8:
  2162. if EVENTCOUNT >= 2:
  2163. amount = event_raw.split(' ', 1)[1]
  2164. for room in this.server.rooms.values():
  2165. for client in room.clients.values():
  2166. client.firstcount += int(amount)
  2167. if client.firstcount >= 9999999:
  2168. client.firstcount = 9999999
  2169. client.sendPacket('\x06\x14', ["1", '<N>As ganado <J>%s <N>Firsts.' % amount])
  2170.  
  2171. elif event.startswith('gravity '):
  2172. if this.privilegeLevel >= 10:
  2173. if EVENTCOUNT >= 2:
  2174. _, arg1, arg2 = event_raw.split(' ', 2)
  2175. for playerCode, client in this.room.clients.items():
  2176. client.sendPacket('\x05' + '\x16', [arg1, arg2])
  2177. #Brasilero
  2178. elif event.startswith('ratocor '):
  2179. if this.privilegeLevel >= 1:
  2180. color = event_raw.split(' ', 1)[1]
  2181. 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'}
  2182. for k, v in colors.items():
  2183. if k == color:
  2184. this.sendPacket('\x06' + '\x14', ["<font color='#00C0FF'>Seu color e: %s</font>" % k])
  2185. this.color1 = v
  2186. break
  2187. #Ingles
  2188. elif event.startswith('mousecolor '):
  2189. if this.privilegeLevel >= 1:
  2190. color = event_raw.split(' ', 1)[1]
  2191. colors = {'blue': '025BF5', 'yellow': 'F3FA1E', 'pink': 'D968C8', 'green': '11F58B', 'cinza': '575355', 'red': 'FA0526', 'orange': 'FAA405', 'skyblue': '05F6FA', 'violet': '7900FF', 'black': '000001'}
  2192. for k, v in colors.items():
  2193. if k == color:
  2194. this.sendPacket('\x06' + '\x14', ["<font color='#00C0FF'>You color is: %s</font>" % k])
  2195. this.color1 = v
  2196. break
  2197. #Español
  2198. elif event.startswith('ratoncolor '):
  2199. if this.privilegeLevel >= 1:
  2200. color = event_raw.split(' ', 1)[1]
  2201. 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'}
  2202. for k, v in colors.items():
  2203. if k == color:
  2204. this.sendPacket('\x06' + '\x14', ["<font color='#00C0FF'>Tu color sera: %s</font>" % k])
  2205. this.color1 = v
  2206. break
  2207. #Ingles
  2208. elif event.startswith('colorchat '):
  2209. if this.privilegeLevel >= 1:
  2210. color = event_raw.split(' ', 1)[1]
  2211. colors = {'blue': '025BF5', 'yellow': 'F3FA1E', 'pink': 'D968C8', 'green': '11F58B', 'cinza': '575355', 'red': 'FA0526', 'orange': 'FAA405', 'skyblue': '05F6FA', 'violet': '7900FF', 'black': '000001'}
  2212. for k, v in colors.items():
  2213. if k == color:
  2214. this.sendPacket('\x06' + '\x14', ["<font color='#00C0FF'>You chat color is:<ROSE> %s</font>" % k])
  2215. this.chatcolor = v
  2216. break
  2217. #Brasilero
  2218. elif event.startswith('colorchat '):
  2219. if this.privilegeLevel >= 1:
  2220. color = event_raw.split(' ', 1)[1]
  2221. 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'}
  2222. for k, v in colors.items():
  2223. if k == color:
  2224. this.sendPacket('\x06' + '\x14', ["<font color='#00C0FF'>Seu cor de chat e:<ROSE> %s</font>" % k])
  2225. this.chatcolor = v
  2226. break
  2227. #Español
  2228. elif event.startswith('colorchat '):
  2229. if this.privilegeLevel >= 1:
  2230. color = event_raw.split(' ', 1)[1]
  2231. 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'}
  2232. for k, v in colors.items():
  2233. if k == color:
  2234. this.sendPacket('\x06' + '\x14', ["<font color='#00C0FF'>Tu color de chat sera:<ROSE> %s</font>" % k])
  2235. this.chatcolor = v
  2236. break
  2237. #Español
  2238. elif event.startswith('nombrecolor '):
  2239. if this.privilegeLevel >= 1:
  2240. color = event_raw.split(' ', 1)[1]
  2241. 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'}
  2242. for k, cor in colors.items():
  2243. if k == color:
  2244. this.sendPacket('\x06\x14', ['<VP>Tu color de nombre sera <BV> [%s]' % k])
  2245. hexcolor = struct.pack('!i', int(cor, 16))
  2246. this.room.sendAllBin('\x1d\x04', struct.pack('!i', int(this.playerCode)) + hexcolor)
  2247. break
  2248. #Ingles
  2249. elif event.startswith('namecolor '):
  2250. if this.privilegeLevel >= 1:
  2251. color = event_raw.split(' ', 1)[1]
  2252. colors = {'blue': '025BF5', 'yellow': 'F3FA1E', 'pink': 'D968C8', 'green': '11F58B', 'cinza': '575355', 'red': 'FA0526', 'orange': 'FAA405', 'skyblue': '05F6FA', 'violet': '7900FF', 'black': '000001'}
  2253. for k, cor in colors.items():
  2254. if k == color:
  2255. this.sendPacket('\x06\x14', ['<VP>You name color is <BV> [%s]' % k])
  2256. hexcolor = struct.pack('!i', int(cor, 16))
  2257. this.room.sendAllBin('\x1d\x04', struct.pack('!i', int(this.playerCode)) + hexcolor)
  2258. break
  2259. #Brasilero
  2260. elif event.startswith('nomecor '):
  2261. if this.privilegeLevel >= 1:
  2262. color = event_raw.split(' ', 1)[1]
  2263. 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'}
  2264. for k, cor in colors.items():
  2265. if k == color:
  2266. this.sendPacket('\x06\x14', ['<VP>Seu cor de nome e <BV> [%s]' % k])
  2267. hexcolor = struct.pack('!i', int(cor, 16))
  2268. this.room.sendAllBin('\x1d\x04', struct.pack('!i', int(this.playerCode)) + hexcolor)
  2269. break
  2270. elif event.startswith('teleport '):
  2271. if this.privilegeLevel >= 10:
  2272. x, y = event_raw.split(' ', 2)[1:]
  2273. this.sendPacket('\x08\x03' + struct.pack('!hhbhhb', int(x), int(y), 0, 0, 0, 0), [], True)
  2274.  
  2275. elif event.startswith('setting '):
  2276. if this.privilegeLevel == 10 and not this.isMapcrew:
  2277. if EVENTCOUNT >= 3:
  2278. _, setting, value = event_raw.split(' ', 2)
  2279. this.Database.execute('select value from settings where setting = ?', [setting])
  2280. rrf = this.Database.fetchone()
  2281. if rrf is None:
  2282. this.sendPacket("\x06\x14", ["1", '<R>Essa Configura\xc3\xa7\xc3\xa3o N\xc3\xa3o Existe.'])
  2283. else:
  2284. this.Database.execute('UPDATE settings SET value = ? WHERE setting = ?', [value, setting])
  2285. sthis.sendPacket("\x06\x14", ["1", 'Alterada Com Sucesso ' + str(setting) + ' Com Valor: ' + str(value) + '.'])
  2286. elif event.startswith('enviarmap '):
  2287. if this.privilegeLevel >= 1:
  2288. message = event_raw.split(' ', 1)[1]
  2289. this.sendMessage('<N>[Info] <J>Mapa enviado com sucesso! Aguarde ser avaliado pela modera\xc3\xa7\xc3\xa3o.')
  2290. 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 + ']'])
  2291. msg = str(str(this.username) + ' [' + str(this.address) + '] enviou o mapa: ' + message)
  2292. this.salvarLog('avaliaMap', msg)
  2293.  
  2294. elif event.startswith('newsetting '):
  2295. if this.privilegeLevel >= 10 and not this.isMapcrew:
  2296. if EVENTCOUNT >= 3:
  2297. _, setting, value = event_raw.split(' ', 2)
  2298. this.Database.execute('INSERT INTO settings (setting, value) values (?, ?)', (setting, value))
  2299. this.sendPacket("\x06\x14", ["1", 'Criado Com Sucesso ' + str(setting) + ' Como Valor: ' + str(value) + '.'])
  2300.  
  2301. elif event.startswith('join '):
  2302. if this.privilegeLevel >= 5 and not this.isMapcrew:
  2303. if EVENTCOUNT >= 2:
  2304. username = event_raw.split(' ', 1)[1]
  2305. username = username.lower().capitalize()
  2306. if this.room.checkRoomInvite(this, username):
  2307. this.enterRoom('\x03[Private] ' + username)
  2308. elif this.privilegeLevel >= 4:
  2309. this.enterRoom('\x03[Private] ' + username)
  2310.  
  2311. elif event.startswith('mjoin '):
  2312. if this.privilegeLevel >= 5 and not this.isMapcrew:
  2313. if EVENTCOUNT >= 2:
  2314. username = event_raw.split(' ', 1)[1]
  2315. if not username.startswith('*'):
  2316. username = username.lower().capitalize()
  2317. room = this.server.getFindPlayerRoom(username)
  2318. if room:
  2319. if room.startswith(this.Langue + '_' + '\x03' + '[Editeur] '):
  2320. pass
  2321. elif room.startswith(this.Langue + '_' + '\x03' + '[Totem] '):
  2322. pass
  2323. else:
  2324. this.enterRoom(room)
  2325.  
  2326. elif event.startswith('move '):
  2327. if this.privilegeLevel >= 5 and not this.isMapcrew:
  2328. if EVENTCOUNT >= 2:
  2329. playerName = event_raw.split(' ', 1)[1]
  2330. this.room.moveAllRoomClients(playerName, False)
  2331.  
  2332. elif event.startswith('del ') or event.startswith('p44 '):
  2333. if this.isMapCrew or this.privilegeLevel == 10:
  2334. if EVENTCOUNT == 2:
  2335. _, mapCode = event_raw.split(' ', 2)
  2336. if mapCode.startswith('@'):
  2337. mapCode = mapCode[1:]
  2338. this.Database.execute('UPDATE mapeditor SET deleted = ? WHERE code = ?', ['1', mapCode])
  2339. this.Database.execute('UPDATE mapeditor SET perma = ? WHERE code = ?', ['44', mapCode])
  2340. this.sendPacket("\x06\x14", ["1", '<J>this map was removed from rotation.'])
  2341. 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.'])
  2342.  
  2343. elif eventToken1 == '\x05':
  2344. if eventToken2 == '\x07':
  2345. this.room.sendAll(eventTokens, values)
  2346.  
  2347. elif eventToken2 == '\x08':
  2348. if not this.isDead:
  2349. if this.room.isMiniGame:
  2350. try:
  2351. objectType, xPosition, yPosition, angle = values
  2352. this.room.GameScript.eventSummoningStart(this.username, objectType, xPosition, yPosition, angle)
  2353. except:
  2354. pass
  2355.  
  2356. this.room.sendAll(eventTokens, [this.playerCode] + values)
  2357.  
  2358. if this.isAfk:
  2359. this.isAfk = False
  2360.  
  2361. elif eventToken2 == '\t':
  2362. if this.room.isMiniGame:
  2363. try:
  2364. this.room.GameScript.eventSummoningCancel(this.username)
  2365. except:
  2366. pass
  2367.  
  2368. this.room.sendAll(eventTokens, [this.playerCode])
  2369.  
  2370. elif eventToken2 == '\x0e':
  2371. this.room.sendAll(eventTokens, values)
  2372.  
  2373. elif eventToken2 == '\r':
  2374. code, x, y = values
  2375. if this.room.isTotemEditeur:
  2376. if this.LoadCountTotem == False:
  2377. this.room.identifiantTemporaire = 0
  2378. this.LoadCountTotem = True
  2379. if not this.room.identifiantTemporaire > 20:
  2380. if code == '11' or code == '12' or code == '13':
  2381. if re.search('#3#11\x01', this.Totem[1]):
  2382. pass
  2383. elif re.search('#3#12\x01', this.Totem[1]):
  2384. pass
  2385. elif re.search('#3#13\x01', this.Totem[1]):
  2386. pass
  2387. else:
  2388. this.room.identifiantTemporaire += 1
  2389. this.sendTotemItemCount(this.room.identifiantTemporaire)
  2390. this.Totem[0] = this.room.identifiantTemporaire
  2391. this.Totem[1] = this.Totem[1] + '#3#' + str(int(code)) + '\x01' + str(int(x)) + '\x01' + str(int(y))
  2392. else:
  2393. this.room.identifiantTemporaire += 1
  2394. this.sendTotemItemCount(this.room.identifiantTemporaire)
  2395. this.Totem[0] = this.room.identifiantTemporaire
  2396. this.Totem[1] = this.Totem[1] + '#3#' + str(int(code)) + '\x01' + str(int(x)) + '\x01' + str(int(y))
  2397.  
  2398. elif eventToken2 == '\x0f':
  2399. this.room.sendAll(eventTokens, values)
  2400.  
  2401. elif eventToken2 == '\x10':
  2402. if this.isSyncroniser:
  2403. this.room.sendAll(eventTokens, values)
  2404.  
  2405. elif eventToken2 == '\x11':
  2406. this.room.sendAll(eventTokens, values)
  2407.  
  2408. elif eventToken2 == '\x16':
  2409. if this.isSyncroniser:
  2410. this.room.sendAll(eventTokens, values)
  2411.  
  2412. elif eventToken1 == '\x14':
  2413. if eventToken2 == '\x14':
  2414. this.sendPacket('\x14' + '\x14', [str(this.shopcheese), this.shoplist, this.look, this.shopitems])
  2415.  
  2416. elif eventToken1 == '\x08':
  2417. if eventToken2 == '\x10':
  2418. this.room.sendAll(eventTokens, values)
  2419.  
  2420. elif eventToken2 == '\x11':
  2421. this.room.sendAll('\x08\x10', [this.playerCode, '0'])
  2422.  
  2423. elif eventToken1 == '\x19':
  2424. if eventToken2 == '\x03':
  2425. if this.privilegeLevel != 10:
  2426. this.sendPlayerDisconnect(this.playerCode)
  2427. this.room.removeClient(this)
  2428. message = '[' + this.address[0] + ' - ' + this.username + '] Tentou Limpar o Desenho.'
  2429. this.sendModMessageChannel('Hack Detect', message)
  2430. this.transport.loseConnection()
  2431. else:
  2432. this.room.sendAll(eventTokens, values)
  2433.  
  2434. elif eventToken2 == '\x04':
  2435. if this.privilegeLevel != 10:
  2436. this.sendPlayerDisconnect(this.playerCode)
  2437. this.room.removeClient(this)
  2438. message = '[' + this.address[0] + ' - ' + this.username + '] Tentativa de Desenhar.'
  2439. this.sendModMessageChannel('Hack Detect', message)
  2440. this.transport.loseConnection()
  2441. else:
  2442. this.room.sendAllOthers(this, eventTokens, values)
  2443.  
  2444. elif eventToken2 == '\x05':
  2445. if this.privilegeLevel != 10:
  2446. this.sendPlayerDisconnect(this.playerCode)
  2447. this.room.removeClient(this)
  2448. message = '[' + this.address[0] + ' - ' + this.username + '] Tentativa de Desenhar.'
  2449. this.sendModMessageChannel('Hack Detect', message)
  2450. this.transport.loseConnection()
  2451. else:
  2452. this.room.sendAllOthers(this, eventTokens, values)
  2453.  
  2454. elif eventToken1 == '\x0e':
  2455. if eventToken2 == '\x1a':
  2456. this.sendPacket('\x0e' + '\x0e', ['0'])
  2457. this.room.isEditeur = False
  2458. this.enterRoom(this.server.recommendRoom(this.Langue))
  2459.  
  2460. elif eventToken2 == '\x04':
  2461. if not this.Voted and not this.SPEC and this.room.votingMode and this.QualifiedVoter:
  2462. if len(values) == 1:
  2463. if int(values[0]) == 1:
  2464. this.Voted = True
  2465. this.room.recievedYes += 1
  2466. elif len(values) == 0:
  2467. this.Voted = True
  2468. this.room.recievedNo += 1
  2469.  
  2470. elif eventToken2 == '\x06':
  2471. code = values[0]
  2472. if this.privilegeLevel >= 5:
  2473. if str(code).isdigit():
  2474. this.Database.execute('select * from mapeditor where code = ?', [code])
  2475. rrf = this.Database.fetchone()
  2476. if rrf is None:
  2477. this.sendPacket('\x0e' + '\x08', [])
  2478. else:
  2479. this.sendLoadMapAtCode(rrf[0], rrf[1], rrf[2], rrf[3], rrf[4], rrf[5])
  2480. this.room.ISCMVdata[2] = rrf[2]
  2481. this.room.ISCMVdata[1] = rrf[0]
  2482. this.room.ISCMVdata[7] = rrf[5]
  2483. this.room.ISCMVloaded = int(code)
  2484. else:
  2485. this.sendPacket('\x0e' + '\x08', [])
  2486.  
  2487. elif str(code).isdigit():
  2488. this.Database.execute('select * from mapeditor where code = ?', [code])
  2489. rrf = this.Database.fetchone()
  2490. if rrf is None:
  2491. this.sendPacket('\x0e' + '\x08', [])
  2492. elif rrf[0] == this.username:
  2493. this.sendLoadMapAtCode(rrf[0], rrf[1], rrf[2], rrf[3], rrf[4], rrf[5])
  2494. this.room.ISCMVdata[2] = rrf[2]
  2495. this.room.ISCMVloaded = int(code)
  2496. else:
  2497. this.sendPacket('\x0e' + '\x08', [])
  2498. else:
  2499. this.sendPacket('\x0e' + '\x08', [])
  2500.  
  2501. elif eventToken2 == '\n':
  2502. mapxml = values[0]
  2503. if this.checkValidXML(mapxml):
  2504. this.sendPacket('\x0e' + '\x0e', [''])
  2505. this.room.ISCMV = 1
  2506. this.room.ISCMVdata = [1, '-', mapxml, 0, 0, 0, 0, 0]
  2507. this.room.killAllNoDie()
  2508.  
  2509. elif eventToken2 == '\x0e':
  2510. this.room.ISCMV = 0
  2511. this.sendPacket('\x0e' + '\x0e', ['', ''])
  2512.  
  2513. elif eventToken2 == '\x0b':
  2514. if this.cheesecount < this.server.EditeurCheese:
  2515. this.sendNotEnoughTotalCheeseEditeur()
  2516. elif this.shopcheese < this.server.EditorShopCheese and not this.privilegeLevel in [10, 8, 6, 5, 4, 3]:
  2517. this.sendNotEnoughCheeseEditeur()
  2518. elif not this.checkValidXML(values[0]):
  2519. pass
  2520. else:
  2521. if not this.privilegeLevel in [10, 8, 6, 5, 4, 3]:
  2522. this.shopcheese = this.shopcheese - this.server.EditorShopCheese
  2523. if this.room.ISCMVloaded != 0:
  2524. code = this.room.ISCMVloaded
  2525. this.Database.execute('UPDATE mapeditor SET mapxml = ? WHERE code = ?', [values[0], int(code)])
  2526. else:
  2527. code = int(this.server.getServerSetting('LastEditorMapCode')) + 1
  2528. this.Database.execute('INSERT INTO mapeditor (name, code, mapxml, yesvotes, novotes, perma, deleted) values (?, ?, ?, ?, ?, ?, ?)', (this.username, code, values[0], 0, 0, '22', '0'))
  2529. this.Database.execute('UPDATE settings SET value = ? WHERE setting = ?', [str(code), 'LastEditorMapCode'])
  2530. this.sendPacket('\x0e' + '\x0e', ['0'])
  2531. this.enterRoom(this.server.recommendRoom(this.Langue))
  2532. this.sendMapExported(code)
  2533.  
  2534. elif eventToken2 == '\x12':
  2535. if this.cheesecount < this.server.EditeurCheese:
  2536. this.sendNotEnoughTotalCheeseEditeur()
  2537. elif this.shopcheese < this.server.EditorShopCheese and not this.privilegeLevel in [3, 4, 5, 6, 8, 10]:
  2538. this.sendNotEnoughCheeseEditeur()
  2539. elif this.room.ISCMVdata[7] != 1:
  2540. pass
  2541. elif not this.checkValidXML(this.room.ISCMVdata[2]):
  2542. pass
  2543. else:
  2544. if not this.privilegeLevel in [3, 4, 5, 6, 8, 10]:
  2545. this.shopcheese = this.shopcheese - this.server.EditorShopCheese
  2546. if this.room.ISCMVloaded != 0:
  2547. code = this.room.ISCMVloaded
  2548. this.Database.execute('UPDATE mapeditor SET mapxml = ? WHERE code = ?', [this.room.ISCMVdata[2], int(code)])
  2549. else:
  2550. code = int(this.server.getServerSetting('LastEditorMapCode')) + 1
  2551. 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'))
  2552. this.Database.execute('UPDATE settings SET value = ? WHERE setting = ?', [str(code), 'LastEditorMapCode'])
  2553. this.sendPacket('\x0e' + '\x0e', ['0'])
  2554. this.enterRoom(this.server.recommendRoom(this.Langue))
  2555. this.sendMapExported(code)
  2556.  
  2557. elif eventToken2 == '\x13':
  2558. this.room.ISCMVloaded = 0
  2559.  
  2560. return None
Advertisement
Add Comment
Please, Sign In to add comment