public async Task <UserGameProfile> GetPlayerProfile(Uri url, UserSearch userSearch) { PushToLogWithUrl(url.ToString()); var page = await _browser.NavigateToPageAsync(url); var mainBoard = page.Html.CssSelect(".stata-body tr td").ToArray(); var gamesListUrl = mainBoard.CssSelect("a").First(a => a.GetAttributeValue("href").Contains("matchlist/")).GetAttributeValue("href"); var userProfile = new UserGameProfile(userSearch) { RaitingPosition5V5 = mainBoard[1].InnerText.Replace("#", "").AsInt(), Couriers = mainBoard[7].InnerText.AsInt(), Neutrals = mainBoard[9].InnerText.AsInt(), Hours = mainBoard[11].InnerText.AsInt(), Winrate5V5 = mainBoard[13].InnerText.Replace("%", "").AsInt(), Leaves5V5 = mainBoard[15].InnerText.AsInt(), MaxWinstreak5V5 = mainBoard[19].InnerText.AsInt(), CurrentWinstreak5V5 = mainBoard[21].InnerText.AsInt(), MatchListUrl = gamesListUrl, MatchUrls = (await _browser.NavigateToPageAsync(new Uri($"{Globals.iCCupUrl}dota/{gamesListUrl}"))) .Html.CssSelect(".game-details").Select(a => a.GetAttributeValue("href")).ToArray() }; return(userProfile); }
private void btn_Save_Click(object sender, EventArgs e) { if (MessageBox.Show("Save splitscreen positions and options with name " + combo_Presets.Text + " for game " + info.GameName + "?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes) { // save the preset GameManager manager = GameManager.Instance; UserGameProfile profile = new UserGameProfile(); profile.Options = options; profile.Preset = players; info.Profiles.Add(profile); manager.UpdateUserProfile(); } }
private void btn_Save_Click(object sender, EventArgs e) { if (MessageBox.Show("Save splitscreen positions and options with name " + combo_Presets.Text + " for game " + info.GameName + "?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes) { // save the preset GameManager manager = GameManager.Instance; UserGameProfile profile = new UserGameProfile(); profile.Options = options; profile.Preset = players; info.Profiles.Add(profile); manager.UpdateUserProfile(); } }