Exemplo n.º 1
0
        private async Task DownloadRoundAsync(ClanApiModel storedClan, RoundApiModel round)
        {
            foreach (var warTag in round.WarTags.EmptyIfNull().Where(w => w != "#0"))
            {
                ICurrentWarApiModel leagueWar = await _cocApi.GetLeagueWarAsync(warTag, allowStoredItem : true, allowExpiredItem : false);

                if (leagueWar.Clans.Any(c => c.ClanTag == storedClan.ClanTag))
                {
                    storedClan.Wars.TryAdd(leagueWar.WarId, leagueWar);

                    continue;
                }

                if (!_continueUpdatingObjects || !_cocApi.IsDownloadingLeagueWars() || !storedClan.DownloadLeagueWars)
                {
                    return;
                }
            }
        }
Exemplo n.º 2
0
 private void CocApi_WarStarted(ICurrentWarApiModel currentWarApiModel)
 {
     _logService.LogInformation("war started");
 }
Exemplo n.º 3
0
 private void CocApi_NewWar(ICurrentWarApiModel currentWarApiModel)
 {
     _logService.LogInformation($"New War: {currentWarApiModel.WarId}");
 }
Exemplo n.º 4
0
 private void CocApi_NewAttacks(ICurrentWarApiModel currentWarApiModel, List <AttackApiModel> attackApiModels)
 {
     _logService.LogInformation($"new attacks: {attackApiModels.Count()}");
 }
Exemplo n.º 5
0
 private void CocApi_WarIsAccessibleChanged(ICurrentWarApiModel currentWarApiModel)
 {
     _logService.LogInformation($"War is accessible changed:{currentWarApiModel.Flags.WarIsAccessible}");
 }