static void Main() { MainAsync().Wait(); async Task MainAsync() { string maxkill = null; /*string id_name = null; * string id_match = null; * PubgNetClient client = new PubgNetClient("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI0ZjYyODUxMC1kM2UwLTAxMzctZDdhNC0wZjNhMTg5NGE0ZTciLCJpc3MiOiJnYW1lbG9ja2VyIiwiaWF0IjoxNTcxNDA4NDA3LCJwdWIiOiJibHVlaG9sZSIsInRpdGxlIjoicHViZyIsImFwcCI6ImNpcGlkcmlzLWdtYWlsIn0.vTbdRV5CgGMOUUU7zDmMojlSULLafjhfFbBfEkbidjI"); * var players = await client.GetPlayersByUsernames(new string[]{"DeadCorporation"}); * * * var season2 = await client.GetSeasons(); * foreach(var s in players.Data) * { * id_name = s.Id; * } * foreach (var i in season2.Data) * { * * if (i.Attributes.IsCurrentSeason) * { * id_match = i.Id; * } * var season = await client.GetSeasonStatsForPlayer(id_name,id_match); * } * */ string id_name = null; PubgNetClient client = new PubgNetClient("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI0ZjYyODUxMC1kM2UwLTAxMzctZDdhNC0wZjNhMTg5NGE0ZTciLCJpc3MiOiJnYW1lbG9ja2VyIiwiaWF0IjoxNTcxNDA4NDA3LCJwdWIiOiJibHVlaG9sZSIsInRpdGxlIjoicHViZyIsImFwcCI6ImNpcGlkcmlzLWdtYWlsIn0.vTbdRV5CgGMOUUU7zDmMojlSULLafjhfFbBfEkbidjI"); var players = await client.GetPlayersByUsernames(new string[] { "DeadCorporation" }); foreach (var s in players.Data) { id_name = s.Id; maxkill = id_name; break; } Console.WriteLine(maxkill); System.Console.ReadKey(); } }
public async Task take_data() { var players = await client.GetPlayersByUsernames(new string[] { Name }); if (Name == null) { await DisplayAlert("Уведомление", "Поле не може бути пустим", "ОK"); check_reaspon = false; } else if (players == null) { await DisplayAlert("Уведомление", "Неправильне імя гравця", "ОK"); check_reaspon = false; } else { foreach (var item in players.Data) { player_id = item.Id; } var season_stat = await client.GetSeasonStatsForPlayer(player_id, season_ids); var lifetime_stat = await client.GetLifetimeStatsForPlayer(player_id); solo_fpp_vm = set_vm(season_stat.Data.Attributes.GameModeStats.SoloFpp, solo_fpp_vm); solo_fpp_vm.image = get_rank_pics(solo_fpp_vm.rank_points, solo_i); MessagingCenter.Send <search_page, data_page_view_model>(this, "data_s", solo_fpp_vm); duo_fpp_vm = set_vm(season_stat.Data.Attributes.GameModeStats.DuoFpp, duo_fpp_vm); duo_fpp_vm.image = get_rank_pics(duo_fpp_vm.rank_points, duo_i); MessagingCenter.Send <search_page, data_page_view_model>(this, "data_d", duo_fpp_vm); squad_fpp_vm = set_vm(season_stat.Data.Attributes.GameModeStats.SquadFpp, squad_fpp_vm); squad_fpp_vm.image = get_rank_pics(squad_fpp_vm.rank_points, sq_i); MessagingCenter.Send <search_page, data_page_view_model>(this, "data_sq", squad_fpp_vm); solo_tpp_vm = set_vm(season_stat.Data.Attributes.GameModeStats.Solo, solo_tpp_vm); solo_tpp_vm.image = get_rank_pics(solo_tpp_vm.rank_points, solo_i_t); MessagingCenter.Send <search_page, data_page_view_model>(this, "data_s_t", solo_tpp_vm); duo_tpp_vm = set_vm(season_stat.Data.Attributes.GameModeStats.Duo, duo_tpp_vm); duo_tpp_vm.image = get_rank_pics(duo_tpp_vm.rank_points, duo_i_t); MessagingCenter.Send <search_page, data_page_view_model>(this, "data_d_t", duo_tpp_vm); squad_tpp_vm = set_vm(season_stat.Data.Attributes.GameModeStats.Squad, squad_tpp_vm); squad_tpp_vm.image = get_rank_pics(squad_tpp_vm.rank_points, sq_i_t); MessagingCenter.Send <search_page, data_page_view_model>(this, "data_sq_t", squad_tpp_vm); lsolo_fpp_vm = set_vm(lifetime_stat.Data.Attributes.GameModeStats.SoloFpp, lsolo_fpp_vm); MessagingCenter.Send <search_page, data_page_view_model>(this, "data_ls", lsolo_fpp_vm); lduo_fpp_vm = set_vm(lifetime_stat.Data.Attributes.GameModeStats.DuoFpp, lduo_fpp_vm); MessagingCenter.Send <search_page, data_page_view_model>(this, "data_ld", lduo_fpp_vm); lsquad_fpp_vm = set_vm(lifetime_stat.Data.Attributes.GameModeStats.SquadFpp, lsquad_fpp_vm); MessagingCenter.Send <search_page, data_page_view_model>(this, "data_lsq", lsquad_fpp_vm); lsolo_tpp_vm = set_vm(lifetime_stat.Data.Attributes.GameModeStats.Solo, lsolo_tpp_vm); MessagingCenter.Send <search_page, data_page_view_model>(this, "data_ls_t", lsolo_tpp_vm); lduo_tpp_vm = set_vm(lifetime_stat.Data.Attributes.GameModeStats.Duo, lduo_tpp_vm); MessagingCenter.Send <search_page, data_page_view_model>(this, "data_ld_t", lduo_tpp_vm); lsquad_tpp_vm = set_vm(lifetime_stat.Data.Attributes.GameModeStats.Squad, lsquad_tpp_vm); MessagingCenter.Send <search_page, data_page_view_model>(this, "data_lsq_t", lsquad_tpp_vm); } }