fCraft.SecurityController.Check C# (CSharp) Method

Check() public method

Checks whether a player is allowed by this controller.
public Check ( [ info ) : bool
info [ Player to check.
return bool
        public bool Check( [NotNull] PlayerInfo info )
        {
            // ReSharper disable LoopCanBeConvertedToQuery
            if ( info == null )
                throw new ArgumentNullException( "info" );
            PlayerExceptions listCache = ExceptionList;
            for ( int i = 0; i < listCache.Excluded.Length; i++ ) {
                if ( listCache.Excluded[i] == info ) {
                    return false;
                }
            }

            if ( info.Rank >= MinRank /*&& player.info.rank <= maxRank*/ )
                return true; // TODO: implement maxrank

            for ( int i = 0; i < listCache.Included.Length; i++ ) {
                if ( listCache.Included[i] == info ) {
                    return true;
                }
            }

            return false;
            // ReSharper restore LoopCanBeConvertedToQuery
        }