Example #1
0
        public void SendBuddyList()
        {
            Packet pw = new Packet(ServerMessages.FRIEND_RESULT);

            pw.WriteByte(0x07);
            pw.WriteByte((byte)(Buddies.Values.Count + Math.Min(1, BuddyRequests.Count)));

            Buddies.Values.ForEach(bud =>
            {
                pw.WriteInt(bud.charId);
                pw.WriteString(bud.charName, 13);
                pw.WriteByte(0);
                pw.WriteInt(Owner.IsVisibleTo(bud) == true ? bud.GetChannel() : -1);
            });

            if (BuddyRequests.Count != 0)
            {
                BuddyData data = BuddyRequests.Peek();
                pw.WriteInt(data.charId);
                pw.WriteString(data.charName, 13);
                pw.WriteByte(1);
                pw.WriteInt(data.GetChannel());
            }

            Enumerable.Range(0, (Buddies.Values.Count + BuddyRequests.Count())).ForEach(e => pw.WriteInt(0));
            Owner.SendPacket(pw);
        }
Example #2
0
        private void SendUpdate(BuddyData buddy, bool dc)
        {
            Packet pw = new Packet(ServerMessages.FRIEND_RESULT);

            pw.WriteByte(20);
            pw.WriteInt(buddy.charId);
            pw.WriteByte(0); // 0 = not in cash shop, 1 = in cash shop
            pw.WriteInt(dc == true ? -1 : buddy.GetChannel());
            Owner.SendPacket(pw);
        }
Example #3
0
        private void SendInviteFrom(BuddyData from)
        {
            Packet pw = new Packet(ServerMessages.FRIEND_RESULT);

            pw.WriteByte(9);
            pw.WriteInt(from.charId);
            pw.WriteString(from.charName);
            pw.WriteInt(from.charId);
            pw.WriteString(from.charName, 13);
            pw.WriteByte(1);
            pw.WriteInt(from.GetChannel());
            pw.WriteByte(0);
            Owner.SendPacket(pw);
        }