Esempio n. 1
0
        /// <summary>
        /// Removes the specified member.
        /// </summary>
        /// <param name="Member">The member.</param>
        internal bool TryRemove(AllianceMemberEntry Member)
        {
            if (Member != null)
            {
                if (this.Entries.TryRemove(Member.PlayerID, out AllianceMemberEntry MemberEntry))
                {
                    if (!Member.Equals(MemberEntry))
                    {
                        Logging.Error(this.GetType(), "TryRemove() - Entry has been removed but TryRemove(PlayerID, out Member) returned a member not equal to the one we are trying to remove.");
                        return(false);
                    }

                    return(true);
                }

                this.Connected.TryRemove(Member.PlayerID, out _);
            }
            else
            {
                Logging.Error(this.GetType(), "TryRemove() - Member was null at Remove(Member).");
            }

            return(false);
        }