private boolean isWithinAccLimit(String ipaddress) {
		int limit = plugin.getConfig().getInt("registration.account-limit");
		if (limit < 1 || xPermissions.has(player.getPlayer(), "xauth.bypass.acclimit"))
			return true;

		int count = 0;
		Connection conn = plugin.getDbCtrl().getConnection();
		PreparedStatement ps = null;
		ResultSet rs = null;

		try {
			String sql = String.format("SELECT COUNT(`id`) FROM `%s` WHERE `registerip` = ?",
					plugin.getDbCtrl().getTable(Table.ACCOUNT));
			ps = conn.prepareStatement(sql);
			ps.setString(1, ipaddress);
			rs = ps.executeQuery();
			if (rs.next())
				count = rs.getInt(1);
		} catch (SQLException e) {
			xAuthLog.severe("Could not check account count for ip: " + ipaddress, e);
		} finally {
			plugin.getDbCtrl().close(conn, ps, rs);
		}

		return limit > count;
	}