Advertisement
Guest User

Untitled

a guest
Nov 24th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.39 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. if this.client.privLevel == 11 and not this.client.room.isUtility:
  6. message = ("<font color='#C79593'>" + message + "</font>")
  7. if this.client.privLevel == 10 and not this.client.room.isUtility:
  8. message = ("<font color='#EDCC8D'>" + message + "</font>")
  9. if this.client.privLevel == 9 and not this.client.room.isUtility:
  10. message = ("<font color='#B865ed'>" + message + "</font>")
  11. if this.client.privLevel == 8 and not this.client.room.isUtility:
  12. message = ("<font color='#babd2f'>" + message + "</font>")
  13. if this.client.privLevel == 7 and not this.client.room.isUtility:
  14. message = ("<font color='#babd2f'>" + message + "</font>")
  15. if this.client.privLevel == 6 and not this.client.room.isUtility:
  16. message = ("<font color='#2EC494'>" + message + "</font>")
  17. if this.client.privLevel == 5 and not this.client.room.isUtility:
  18. message = ("<font color='#3283bf'>" + message + "</font>")
  19. if this.client.isGuest:
  20. this.client.sendLangueMessage("", "$Créer_Compte_Parler")
  21. elif not message == "" and len(message) < 256:
  22. if this.client.isMute:
  23. muteInfo = this.server.getModMuteInfo(this.client.playerName)
  24. timeCalc = Utils.getHoursDiff(muteInfo[1])
  25. if timeCalc <= 0:
  26. this.client.isMute = False
  27. this.server.removeModMute(this.client.playerName)
  28. 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))
  29. else:
  30. this.client.sendModMute(this.client.playerName, timeCalc, muteInfo[0], True)
  31. return
  32. else:
  33. if this.client.room.isUtility == True:
  34. this.client.Utility.isCommand = False
  35. if message.startswith("!"):
  36. this.client.Utility.sentCommand(message)
  37. if this.client.Utility.isCommand == True:
  38. message = ""
  39. if not this.client.chatdisabled:
  40. if not message == this.client.lastMessage:
  41. this.client.lastMessage = message
  42. this.client.room.sendAllChat(this.client.playerCode, this.client.playerName, message, this.client.langueID, this.server.checkMessage(message))
  43. reactor.callLater(0.9, this.client.chatEnable)
  44. this.client.chatdisabled = True
  45. else:
  46. if this.client.langue == "PL":
  47. this.client.sendPacket([6, 9], ByteArray().writeUTF("Twoja poprzednia wiadomość jest taka sama.").toByteArray())
  48. else:
  49. this.client.sendPacket([6, 9], ByteArray().writeUTF("Your last message is the same.").toByteArray())
  50. else:
  51. if this.client.langue == "PL":
  52. this.client.sendPacket([6, 9], ByteArray().writeUTF("Cśśśś, spokojnie.").toByteArray())
  53. else:
  54. this.client.sendPacket([6, 9], ByteArray().writeUTF("Silence, thank you.").toByteArray())
  55.  
  56. if not this.server.chatMessages.has_key(this.client.playerName):
  57. messages = deque([], 60)
  58. messages.append([_time.strftime("%Y/%m/%d %H:%M:%S"), message])
  59. this.server.chatMessages[this.client.playerName] = messages
  60. else:
  61. this.server.chatMessages[this.client.playerName].append([_time.strftime("%Y/%m/%d %H:%M:%S"), message])
  62. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement