private async Task LoadStatsAsync() { try { var data = _achievements ?? (_achievements = await CmApiProvider.GetAsync <Dictionary <string, double> >("achievements/get")); if (data == null) { throw new Exception("Failed to load data"); } await SpecialEventsManager.Instance.EnsureLoadedAsync(); foreach (var eventObject in SpecialEventsManager.Instance.Loaded) { eventObject.PlaceStats = data.Where(x => x.Key.StartsWith(eventObject.Id + "_")).OrderBy(x => x.Key) .Select(x => x.Value).ToArray(); } } catch (Exception e) { Logging.Warning(e); } }
private async void LoadOtherLocales() { _online = _online ?? await CmApiProvider.GetAsync <LocalePackageManifest[]>("locales/list"); if (_online == null) { return; } foreach (var entry in _online) { if (Locales.Any(x => string.Equals(x.Id, entry.Id, StringComparison.OrdinalIgnoreCase))) { continue; } // TODO: check if there is an update Locales.Insert(Locales.Count - 1, new LocaleEntry(entry.Id, entry.Version, entry.Coverity, entry.Size)); } LoadCurrentLocale(); }