class AsynchronousLogin implements AsynchronousProcess {

    @VisibleForTesting
    boolean hasReachedMaxLoggedInPlayersForIp(Player player, String ip) {
        // Do not perform the check if player has multiple accounts permission or if IP is localhost
        if (service.getProperty(RestrictionSettings.MAX_LOGIN_PER_IP) <= 0
            || service.hasPermission(player, PlayerStatePermission.ALLOW_MULTIPLE_ACCOUNTS)
            || "127.0.0.1".equalsIgnoreCase(ip)
            || "localhost".equalsIgnoreCase(ip)) {
            return false;
        }

        // Count logged in players with same IP address
        final String name = player.getName();
        int count = 0;
        for (Player onlinePlayer : bukkitService.getOnlinePlayers()) {
            if (ip.equalsIgnoreCase(PlayerUtils.getPlayerIp(onlinePlayer))
                && !onlinePlayer.getName().equals(name)
                && dataSource.isLogged(onlinePlayer.getName().toLowerCase())) {
                ++count;
            }
        }
        return count >= service.getProperty(RestrictionSettings.MAX_LOGIN_PER_IP);
    }

      AsynchronousLogin();

}