fCraft.PlayerOpException.ThrowPlayerAndIPNotBanned C# (CSharp) Method

ThrowPlayerAndIPNotBanned() static private method

static private ThrowPlayerAndIPNotBanned ( [ player, [ targetInfo, [ address ) : void
player [
targetInfo [
address [
return void
        internal static void ThrowPlayerAndIPNotBanned( [NotNull] Player player, [NotNull] PlayerInfo targetInfo, [NotNull] IPAddress address )
        {
            if ( player == null )
                throw new ArgumentNullException( "player" );
            if ( targetInfo == null )
                throw new ArgumentNullException( "targetInfo" );
            if ( address == null )
                throw new ArgumentNullException( "address" );
            string msg, colorMsg;
            if ( player.Can( Permission.ViewPlayerIPs ) ) {
                msg = String.Format( "Player {0} and their IP ({1}) are not currently banned.",
                                     targetInfo.Name, address );
                colorMsg = String.Format( "&SPlayer {0}&S and their IP ({1}) are not currently banned.",
                                     targetInfo.ClassyName, address );
            } else {
                msg = String.Format( "Player {0} and their IP are not currently banned.",
                                     targetInfo.Name );
                colorMsg = String.Format( "&SPlayer {0}&S and their IP are not currently banned.",
                                     targetInfo.ClassyName );
            }
            throw new PlayerOpException( player, targetInfo, PlayerOpExceptionCode.NoActionNeeded, msg, colorMsg );
        }