Ejemplo n.º 1
0
        /// <summary>
        /// Adds a new friend to the friend list.
        /// If they are already a friend, nothing happens.
        /// </summary>
        /// <param name="Friend">The friend to add to the friend list.</param>
        public Messenger AddFriend(Friend Friend)
        {
            lock (this)
            {
                if (this.fFriends.ContainsKey(Friend.GetHabbo().GetID()))    // Check if they are already a friend.
                    return this;                                            // They are, abort!
                this.fFriends.Add(Friend.GetHabbo().GetID(), Friend);        // Nope, not a friend. Add them.
            }

            AddUpdate(new FriendUpdate(FriendUpdateActions.Add, Friend));   // Add the friend to the update data.

            return this;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds a new friend to the friend list.
        /// If they are already a friend, nothing happens.
        /// </summary>
        /// <param name="Friend">The friend to add to the friend list.</param>
        public Messenger AddFriend(Friend Friend)
        {
            lock (this)
            {
                if (this.fFriends.ContainsKey(Friend.GetHabbo().GetID()))    // Check if they are already a friend.
                {
                    return(this);                                            // They are, abort!
                }
                this.fFriends.Add(Friend.GetHabbo().GetID(), Friend);        // Nope, not a friend. Add them.
            }

            AddUpdate(new FriendUpdate(FriendUpdateActions.Add, Friend));   // Add the friend to the update data.

            return(this);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Remove a Friend from the friend list.
        /// </summary>
        /// <param name="Friend">The Friend to remove.</param>
        public Messenger RemoveFriend(Friend Friend)
        {
            AddUpdate(new FriendUpdate(FriendUpdateActions.Remove, Friend));

            lock (this)
            {
                if (!this.fFriends.ContainsKey(Friend.GetHabbo().GetID()))   // Does the Friend exist in the friend list?
                {
                    this.fFriends.Remove(Friend.GetHabbo().GetID());         // Yes, remove it.
                }
            }

            SendUpdates();  // Force an early update.

            return(this);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Remove a Friend from the friend list.
        /// </summary>
        /// <param name="Friend">The Friend to remove.</param>
        public Messenger RemoveFriend(Friend Friend)
        {
            AddUpdate(new FriendUpdate(FriendUpdateActions.Remove, Friend));

            lock (this)
            {
                if (!this.fFriends.ContainsKey(Friend.GetHabbo().GetID()))   // Does the Friend exist in the friend list?
                    this.fFriends.Remove(Friend.GetHabbo().GetID());         // Yes, remove it.
            }

            SendUpdates();  // Force an early update.

            return this;
        }