Example #1
0
        private async Task UpdateVillageAsync(ClanVillageApiModel village)
        {
            VillageApiModel?storedVillage;

            VillageApiModel?downloadedVillage;

            try
            {
                storedVillage = await _cocApi.GetVillageAsync(village.VillageTag, allowStoredItem : true, allowExpiredItem : true);

                downloadedVillage = await _cocApi.GetVillageAsync(village.VillageTag, allowStoredItem : true, allowExpiredItem : false);
            }
            catch (NotFoundException)
            {
                //there is a bug in the api where some villages that appear in the clan village list do not appear in the player end point
                return;
            }

            storedVillage.Update(_cocApi, downloadedVillage);
        }
Example #2
0
 private void CocApi_ClanVillageNameChanged(ClanVillageApiModel oldMember, string newName)
 {
     _logService.LogInformation($"New name: {newName}");
 }