Exemplo n.º 1
0
        public WarcraftLogs(IServiceProvider services)
        {
            _logger = services.GetRequiredService <ILogger <WarcraftLogs> >();
            _client = services.GetRequiredService <DiscordShardedClient>();
            _config = services.GetRequiredService <IConfigurationRoot>();
            _wowApi = services.GetRequiredService <WowApi>();

            try
            {
                _api           = new ApiRequestorThrottle(_config["WarcraftLogsApiCmd"], baseUrl: "https://www.warcraftlogs.com:443/v1/", services.GetRequiredService <IHttpClientFactory>().CreateClient());
                _apiCmd        = new ApiRequestorThrottle(_config["WarcraftLogsApiCmd"], baseUrl: "https://www.warcraftlogs.com:443/v1/", services.GetRequiredService <IHttpClientFactory>().CreateClient());
                _apiClassic    = new ApiRequestorThrottle(_config["WarcraftLogsApi"], baseUrl: "https://classic.warcraftlogs.com:443/v1/", services.GetRequiredService <IHttpClientFactory>().CreateClient());
                _apiClassicCmd = new ApiRequestorThrottle(_config["WarcraftLogsApiCmd"], baseUrl: "https://classic.warcraftlogs.com:443/v1/", services.GetRequiredService <IHttpClientFactory>().CreateClient());
                CharClasses    = this.GetCharClasses().Result;
                Zones          = this.GetZones().Result;
                ClassicZones   = this.GetClassicZones().Result;

                _currentRaidTier = this.SetCurrentTier();
                this.MigrateOldReports();
                this.StartTimer();
            }
            catch (Exception ex)
            {
                _logger.LogError($"Error performing class setup for WCL: {ex.Message}");
            }
        }
Exemplo n.º 2
0
 public WowUtilities(IServiceProvider services)
 {
     _logger  = services.GetRequiredService <ILogger <WowUtilities> >();
     _cc      = services.GetRequiredService <ChannelCheck>();
     _logsApi = services.GetRequiredService <WarcraftLogs>();
     _wowApi  = services.GetRequiredService <WowApi>();
     _rioApi  = services.GetRequiredService <RaiderIOApi>();
     _client  = services.GetRequiredService <DiscordShardedClient>();
     _config  = services.GetRequiredService <IConfigurationRoot>();
     _prefix  = _config["prefix"];
 }