Advertisement
Guest User

SendMsgEvent.cs

a guest
Sep 1st, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Text;
  4. using System.Collections.Generic;
  5. using Plus.Communication.Packets.Outgoing.Messenger;
  6.  
  7. namespace Plus.Communication.Packets.Incoming.Messenger
  8. {
  9. class SendMsgEvent : IPacketEvent
  10. {
  11. public void Parse(HabboHotel.GameClients.GameClient Session, ClientPacket Packet)
  12. {
  13. if (Session == null || Session.GetHabbo() == null || Session.GetHabbo().GetMessenger() == null)
  14. return;
  15.  
  16. int userId = Packet.PopInt();
  17. if (userId == 0 || userId == Session.GetHabbo().Id)
  18. return;
  19.  
  20. string message = PlusEnvironment.GetGame().GetChatManager().GetFilter().CheckMessage(Packet.PopString());
  21. if (string.IsNullOrWhiteSpace(message))
  22. return;
  23.  
  24.  
  25. if (Session.GetHabbo().TimeMuted > 0)
  26. {
  27. Session.SendNotification("Oops, you're currently muted - you cannot send messages.");
  28. return;
  29. }
  30.  
  31. if (userId == 0x7fffffff)
  32. {
  33.  
  34. PlusEnvironment.GetGame().GetClientManager().StaffAlert(new NewConsoleMessageComposer(0x7fffffff, Session.GetHabbo().Username + ": " + message), Session.GetHabbo().Id);
  35. return;
  36. }
  37.  
  38.  
  39. Session.GetHabbo().GetMessenger().SendInstantMessage(userId, message);
  40.  
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement