/// <summary> /// Creates a new <see cref="RiotClient"/> instance. /// </summary> /// <param name="settings">The settings to use.</param> /// <param name="platformId">The platform ID of the default server to connect to. This should equal one of the <see cref="Models.PlatformId"/> values.</param> /// <param name="appRateLimiter">The rate limiter to use for proactive rate limiting.</param> /// <remarks> /// You should pass the same <see cref="IRateLimiter"/> instance to all <see cref="RiotClient"/> instances. Do not create multiple <see cref="IRateLimiter"/> instances. /// Reactive rate limiting will always be used, even if a proactive rate limiter is not specified. /// </remarks> public RiotClient(RiotClientSettings settings, string platformId, IRateLimiter appRateLimiter) { this.settings = settings; this.platformId = platformId; this.rateLimiter = appRateLimiter; client = CreateHttpClient(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); }
/// <summary> /// Creates a new <see cref="RiotClient"/> instance. /// </summary> /// <param name="settings">The settings to use.</param> /// <param name="platformId">The platform ID of the default server to connect to. This should equal one of the <see cref="Models.PlatformId"/> values.</param> public RiotClient(RiotClientSettings settings, string platformId) : this(settings, platformId, RateLimiter) { }
/// <summary> /// Creates a new <see cref="RiotClient"/> instance. /// </summary> /// <param name="settings">The settings to use.</param> public RiotClient(RiotClientSettings settings) : this(settings, DefaultPlatformId) { }