Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Text;
  4. using System.Collections.Generic;
  5.  
  6. using Plus.HabboHotel.Users;
  7. using Plus.HabboHotel.Users.Messenger;
  8. using Plus.HabboHotel.Users.Relationships;
  9.  
  10. namespace Plus.Communication.Packets.Outgoing.Messenger
  11. {
  12. class BuddyListComposer : ServerPacket
  13. {
  14. public BuddyListComposer(ICollection<MessengerBuddy> Friends, Habbo Player)
  15. : base(ServerPacketHeader.BuddyListMessageComposer)
  16. {
  17. base.WriteInteger(1); // Page Count?
  18. base.WriteInteger(0); // Page Index?
  19. base.WriteInteger(Friends.Count); // Items Count
  20.  
  21. foreach (MessengerBuddy Friend in Friends.ToList()) // Loop (Foreach means in there is 4 run 4 times, once for each)
  22. {
  23. Relationship Relationship = Player.Relationships.FirstOrDefault(x => x.Value.UserId == Convert.ToInt32(Friend.UserId)).Value;
  24.  
  25. base.WriteInteger(Friend.Id); // Friends ID (Finds friends ID so it can find the users data, ex: look, name, etc)
  26. base.WriteString(Friend.mUsername); // Friends Username (Enough said)
  27. base.WriteInteger(1); // Gender of friend (Ex: Male, Female, etc)
  28. base.WriteBoolean(Friend.IsOnline); // Is the user online?
  29. base.WriteBoolean(Friend.IsOnline && Friend.InRoom); // Is your friend in a room?
  30. base.WriteString(Friend.IsOnline ? Friend.mLook : string.Empty); // Badge code??? How the fuck does Friend.IsOnline tell us the badge code? Hmm ok
  31. base.WriteInteger(0); // Category ID, Offline? Online? Group Chats? Etc.
  32. base.WriteString(Friend.IsOnline ? Friend.mMotto : string.Empty); // Friend's motto
  33. base.WriteString(string.Empty); //Alternative name? <- ?_? "Real name"? Yh ok
  34. base.WriteString(string.Empty); // Useless, but needed for structure
  35. base.WriteBoolean(true); // Can they message an offline user? Hmm, may disable this in the future.
  36. base.WriteBoolean(false); // Unknown
  37. base.WriteBoolean(false); // Does this mother fucker use Pocket Habbo? (Failed Chat App)
  38. base.WriteShort(Relationship == null ? 0 : Relationship.Type); // Relationship Type (<3, :), X_X)
  39. } // End loop
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement