private async Task LoadCache() { Progress.IsIndeterminate = false; Progress.Value = 0; Status.Text = Text.Loading; Cancel.Visibility = Visibility.Hidden; Hint.Visibility = Visibility.Visible; WebCache.Init(); if (WebCache.CacheGameVersion != await Riot.GetLatestVersionAsync() || WebCache.CacheLocale != CultureInfo.CurrentCulture.Name) { LogTo.Info("Clearing web cache due to a new LoL version being available, or a language change"); WebCache.Clear(); WebCache.CacheGameVersion = await Riot.GetLatestVersionAsync(); WebCache.CacheLocale = CultureInfo.CurrentCulture.Name; } Riot.SetLanguage(Config.Current.Culture); await Riot.CacheAllAsync(o => Dispatcher.Invoke(() => Progress.Value = o * 0.7)); await TeamGuesser.Load(new Progress <float>(o => Dispatcher.Invoke(() => Progress.Value = 0.7 + (o * 0.3)))); }
private async void Window_Initialized(object sender, EventArgs e) { await Guesser.Load(new Progress <float>(o => Console.WriteLine("Loading: {0:0.0}", o * 100))); await LoL?.Socket.SubscribeAndUpdate <LolChampSelectChampSelectSession>("/lol-champ-select/v1/session", ChampSelectSessionCallback); var c = await new UGGProvider().GetCountersFor(84, Position.Mid); //var events = JsonConvert.DeserializeObject<EventData[]>(File.ReadAllText("events.json")); //Client.Socket.Playback(events, 10); }