public override OutgoingMessage Send(IMessageable target)
        {
            if (InternalOutgoingMessage.ID == 0)
            {
                InternalOutgoingMessage.Initialize(2);
                foreach (string fuseRight in FuseRights)
                {
                    InternalOutgoingMessage.AppendString(fuseRight);
                }
            }

            target.SendMessage(InternalOutgoingMessage);
            return(this);
        }
        public override OutgoingMessage Send(IMessageable target)
        {
            if (InternalOutgoingMessage.ID == 0)
            {
                InternalOutgoingMessage.Initialize(13)
                .AppendInt32(Categories.Count - 1);     // -1 because the default category doesn't count.
                foreach (Category category in Categories.Where(category => category.ID != 0))
                {
                    InternalOutgoingMessage
                    .AppendInt32(category.ID)
                    .AppendString(category.Name);
                }

                InternalOutgoingMessage
                .AppendInt32(FriendUpdates.Count);

                foreach (MessengerFriendEventArgs friendUpdate in FriendUpdates)
                {
                    Friend friend = friendUpdate.Friend;

                    InternalOutgoingMessage
                    .AppendInt32((int)friendUpdate.Type)
                    .AppendInt32(friend.Befriendable.GetID());

                    if (friendUpdate.Type != FriendUpdateType.Removed)
                    {
                        InternalOutgoingMessage
                        .AppendString(friend.Befriendable.GetDisplayName())
                        .AppendBoolean(false)     // TODO: Find out what this does.
                        .AppendBoolean(friend.Befriendable.IsLoggedIn())
                        .AppendBoolean(friend.Befriendable.IsStalkable())
                        .AppendString(friend.Befriendable.GetFigure().ToString())
                        .AppendInt32(friendUpdate.Category.ID)
                        .AppendString(friend.Befriendable.GetMotto())
                        .AppendString(friend.Befriendable.GetLastAccess().ToString());
                    }
                }
            }

            target.SendMessage(InternalOutgoingMessage);
            return(this);
        }
        public override OutgoingMessage Send(IMessageable target)
        {
            if (InternalOutgoingMessage.ID == 0)
            {
                InternalOutgoingMessage.Initialize(351)
                .AppendInt32(RoomListings.Count);


                foreach (GuestRoomListing roomListing in RoomListings)
                {
                    InternalOutgoingMessage
                    .AppendInt32(roomListing.ID)
                    .AppendString(roomListing.Name)
                    .AppendString(roomListing.Owner.GetDisplayName());

                    switch (roomListing.LockMode)
                    {
                    case RoomLock.Open:
                        InternalOutgoingMessage.AppendString("open");
                        break;

                    case RoomLock.Password:
                        InternalOutgoingMessage.AppendString("password");
                        break;

                    case RoomLock.Doorbell:
                        InternalOutgoingMessage.AppendString("closed");
                        break;
                    }

                    InternalOutgoingMessage
                    .AppendInt32(roomListing.Population)
                    .AppendInt32(roomListing.Capacity)
                    .AppendString(roomListing.Description);
                }
            }
            target.SendMessage(InternalOutgoingMessage);
            return(this);
        }
        public override OutgoingMessage Send(IMessageable target)
        {
            if (InternalOutgoingMessage.ID == 0)
            {
                InternalOutgoingMessage.Initialize(220)
                .AppendBoolean(ExcludeFullRooms)
                .AppendInt32(ID)
                .AppendInt32(IsPublicCategory ? 0 : 2)
                .AppendString(Name)
                .AppendInt32(UnknownA)
                .AppendInt32(UnknownB)
                .AppendInt32(ParentID);

                if (!IsPublicCategory)
                {
                    InternalOutgoingMessage
                    .AppendInt32(
                        Listings
                        .Where(listing => listing is GuestRoomListing)
                        .Count());
                }

                foreach (Listing listing in Listings)
                {
                    if (listing is Category)
                    {
                        InternalOutgoingMessage
                        .AppendInt32(listing.ID)
                        .AppendBoolean(false)
                        .AppendString(listing.Name)
                        .AppendInt32(listing.Population)
                        .AppendInt32(listing.Capacity)
                        .AppendInt32(ID);
                        continue;
                    }

                    if (listing is GuestRoomListing)
                    {
                        GuestRoomListing specificListing = listing as GuestRoomListing;

                        InternalOutgoingMessage
                        .AppendInt32(listing.ID)
                        .AppendString(listing.Name)
                        .AppendString(specificListing.Owner.GetDisplayName());

                        switch (specificListing.LockMode)
                        {
                        case RoomLock.Open:
                        {
                            InternalOutgoingMessage.AppendString("open");
                            break;
                        }

                        case RoomLock.Password:
                        {
                            InternalOutgoingMessage.AppendString("password");
                            break;
                        }

                        case RoomLock.Doorbell:
                        {
                            InternalOutgoingMessage.AppendString("closed");
                            break;
                        }
                        }
                        InternalOutgoingMessage
                        .AppendInt32(listing.Population)
                        .AppendInt32(listing.Capacity)
                        .AppendString(specificListing.Description);
                        continue;
                    }


                    if (listing is PublicRoomListing)
                    {
                        PublicRoomListing specificListing = listing as PublicRoomListing;

                        InternalOutgoingMessage
                        .AppendInt32(listing.ID)
                        .AppendBoolean(true)
                        .AppendString(listing.Name)
                        .AppendInt32(listing.Population)
                        .AppendInt32(listing.Capacity)
                        // Possible category ID needed here?
                        .AppendString(specificListing.Description)
                        .AppendInt32(listing.ID)
                        .AppendInt32(UnknownA)
                        .AppendString(specificListing.ClientFiles)
                        .AppendInt32(UnknownB)
                        .AppendInt32(UnknownC);
                        continue;
                    }
                }
            }
            target.SendMessage(InternalOutgoingMessage);
            return(this);
        }