Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Text;
- using System.Collections.Generic;
- using Plus.HabboHotel.Users;
- using Plus.HabboHotel.Users.Messenger;
- using Plus.HabboHotel.Users.Relationships;
- namespace Plus.Communication.Packets.Outgoing.Messenger
- {
- class BuddyListComposer : ServerPacket
- {
- public BuddyListComposer(ICollection<MessengerBuddy> Friends, Habbo Player)
- : base(ServerPacketHeader.BuddyListMessageComposer)
- {
- base.WriteInteger(1); // Page Count?
- base.WriteInteger(0); // Page Index?
- base.WriteInteger(Friends.Count); // Items Count
- foreach (MessengerBuddy Friend in Friends.ToList()) // Loop (Foreach means in there is 4 run 4 times, once for each)
- {
- Relationship Relationship = Player.Relationships.FirstOrDefault(x => x.Value.UserId == Convert.ToInt32(Friend.UserId)).Value;
- base.WriteInteger(Friend.Id); // Friends ID (Finds friends ID so it can find the users data, ex: look, name, etc)
- base.WriteString(Friend.mUsername); // Friends Username (Enough said)
- base.WriteInteger(1); // Gender of friend (Ex: Male, Female, etc)
- base.WriteBoolean(Friend.IsOnline); // Is the user online?
- base.WriteBoolean(Friend.IsOnline && Friend.InRoom); // Is your friend in a room?
- base.WriteString(Friend.IsOnline ? Friend.mLook : string.Empty); // Badge code??? How the fuck does Friend.IsOnline tell us the badge code? Hmm ok
- base.WriteInteger(0); // Category ID, Offline? Online? Group Chats? Etc.
- base.WriteString(Friend.IsOnline ? Friend.mMotto : string.Empty); // Friend's motto
- base.WriteString(string.Empty); //Alternative name? <- ?_? "Real name"? Yh ok
- base.WriteString(string.Empty); // Useless, but needed for structure
- base.WriteBoolean(true); // Can they message an offline user? Hmm, may disable this in the future.
- base.WriteBoolean(false); // Unknown
- base.WriteBoolean(false); // Does this mother fucker use Pocket Habbo? (Failed Chat App)
- base.WriteShort(Relationship == null ? 0 : Relationship.Type); // Relationship Type (<3, :), X_X)
- } // End loop
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement