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; } } }
private void CocApi_WarStarted(ICurrentWarApiModel currentWarApiModel) { _logService.LogInformation("war started"); }
private void CocApi_NewWar(ICurrentWarApiModel currentWarApiModel) { _logService.LogInformation($"New War: {currentWarApiModel.WarId}"); }
private void CocApi_NewAttacks(ICurrentWarApiModel currentWarApiModel, List <AttackApiModel> attackApiModels) { _logService.LogInformation($"new attacks: {attackApiModels.Count()}"); }
private void CocApi_WarIsAccessibleChanged(ICurrentWarApiModel currentWarApiModel) { _logService.LogInformation($"War is accessible changed:{currentWarApiModel.Flags.WarIsAccessible}"); }