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("<", "<")
- if this.client.privLevel == 11 and not this.client.room.isUtility:
- message = ("<font color='#C79593'>" + message + "</font>")
- if this.client.privLevel == 10 and not this.client.room.isUtility:
- message = ("<font color='#EDCC8D'>" + message + "</font>")
- if this.client.privLevel == 9 and not this.client.room.isUtility:
- message = ("<font color='#B865ed'>" + message + "</font>")
- if this.client.privLevel == 8 and not this.client.room.isUtility:
- message = ("<font color='#babd2f'>" + message + "</font>")
- if this.client.privLevel == 7 and not this.client.room.isUtility:
- message = ("<font color='#babd2f'>" + message + "</font>")
- if this.client.privLevel == 6 and not this.client.room.isUtility:
- message = ("<font color='#2EC494'>" + message + "</font>")
- if this.client.privLevel == 5 and not this.client.room.isUtility:
- message = ("<font color='#3283bf'>" + message + "</font>")
- if this.client.isGuest:
- this.client.sendLangueMessage("", "$Créer_Compte_Parler")
- elif not message == "" and len(message) < 256:
- 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, this.server.checkMessage(message))
- else:
- this.client.sendModMute(this.client.playerName, timeCalc, muteInfo[0], True)
- return
- else:
- if this.client.room.isUtility == True:
- this.client.Utility.isCommand = False
- if message.startswith("!"):
- this.client.Utility.sentCommand(message)
- if this.client.Utility.isCommand == True:
- message = ""
- if not this.client.chatdisabled:
- if not message == this.client.lastMessage:
- this.client.lastMessage = message
- this.client.room.sendAllChat(this.client.playerCode, this.client.playerName, message, this.client.langueID, this.server.checkMessage(message))
- reactor.callLater(0.9, this.client.chatEnable)
- this.client.chatdisabled = True
- else:
- if this.client.langue == "PL":
- this.client.sendPacket([6, 9], ByteArray().writeUTF("Twoja poprzednia wiadomość jest taka sama.").toByteArray())
- else:
- this.client.sendPacket([6, 9], ByteArray().writeUTF("Your last message is the same.").toByteArray())
- else:
- if this.client.langue == "PL":
- this.client.sendPacket([6, 9], ByteArray().writeUTF("Cśśśś, spokojnie.").toByteArray())
- else:
- this.client.sendPacket([6, 9], ByteArray().writeUTF("Silence, thank you.").toByteArray())
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement