Пример #1
0
        public static List <ArenaAttackTeam> AttackTeamQuery(ArenaAttackTeamQueryParams args)
        {
            var url       = GetFullUrl("/PCRArena");
            var jsonStr   = JsonUtils.SerializeObject(args);
            var encrtpted = SimpleEncryptor.Default.Encrypt(jsonStr);
            var r         = Client.Default.Post(url, encrtpted, ContentTypes.PlainText);
            var apiResult = APIResult.Parse <string>(r);

            apiResult.AssertSuccessCode();
            var rawData        = apiResult.Data;
            var arenaApiResult = ArenaAPIResult.Parse <ArenaAttackTeamQueryResult>(rawData);

            arenaApiResult.AssertSuccessCode();
            var teams = arenaApiResult.Data.Teams;

            if (ConfigMgr.GetConfig().Debug)
            {
                File.WriteAllText("AttackTeamQueryResult.txt", JsonUtils.SerializeObject(teams));
            }
            return(teams);
        }