Ejemplo n.º 1
0
        public async void StartRead()
        {
            await Task.Delay(1000 * 15);


            if (!Directory.Exists(Define.GetExtensionsPath() + @"Temp"))
            {
                Directory.CreateDirectory(Define.GetExtensionsPath() + @"Temp");
            }
            _makeRequest._ini_PostClient();
            Episodes.Clear();
            var useAccount = new EventScore.UseAccount
            {
                pid = "790180",
                id  = "34303764313230342c336765612e3666633529676062342c353767673232603f30613234"
            };
            var    makeParams = new MakeParams();
            string apiName;
            var    count = 0;


            while (count < 40)
            {
                Episodes.Clear();

                Console.WriteLine($@"Now Count:{count}");

                apiName = Define.GetApiName(Define.APINAME_TYPE.episode_main);
                makeParams.ClearParam();
                makeParams.AddCommonParams();
                makeParams.AddParam("pid", useAccount.pid);
                makeParams.AddSignatureParam(useAccount.id, apiName);
                await _makeRequest.MakeNaturalPostRequest(apiName, makeParams.GetParam());
                await ParseResultJsonAsync(Define.GetExtensionsTempPath());

                ParseEpisodeMain();

                await Task.Delay(1000 * 3);

                apiName = Define.GetApiName(Define.APINAME_TYPE.scenario_result);
                makeParams.ClearParam();
                makeParams.AddParam("scenarioId", Episodes[0].EpisodeId.ToString());
                makeParams.AddCommonParams();
                makeParams.AddParam("pid", useAccount.pid);
                makeParams.AddSignatureParam(useAccount.id, apiName);
                await _makeRequest.MakeNaturalPostRequest(apiName, makeParams.GetParam());
                await ParseResultJsonAsync(Define.GetExtensionsTempPath());

                Console.WriteLine($@"Read Success! id:{Episodes[0].EpisodeId.ToString()}");

                await Task.Delay(1000 * 3);

                count++;
            }
        }
Ejemplo n.º 2
0
        public async void StartFirstSetup()
        {
            MakeRequest._ini_PostClient();
            var accountCount = 0;

            try
            {
                do
                {
                    Define.Rev = "0";
                    var apiName    = Define.GetApiName(Define.APINAME_TYPE.first);
                    var makeParams = new MakeParams();
                    makeParams.AddCommonParams();
                    makeParams.AddSignatureParam("", apiName, true);
                    await MakeRequest.MakeNaturalPostRequest(apiName, makeParams.GetParam());
                    await ParseResultJsonAsync(Define.GetExtensionsTempPath());

                    var account = ParseAccount();

                    apiName = Define.GetApiName(Define.APINAME_TYPE.comp);
                    makeParams.ClearParam();
                    makeParams.AddParam("tpid", account.tpid);
                    makeParams.AddCommonParams();
                    makeParams.AddSignatureParam(account.Id, apiName);
                    await MakeRequest.MakeNaturalPostRequest(apiName, makeParams.GetParam());

                    apiName = Define.GetApiName(Define.APINAME_TYPE.login);
                    makeParams.ClearParam();
                    makeParams.AddCommonParams();
                    makeParams.AddParam("pid", account.pid);
                    makeParams.AddSignatureParam(account.Id, apiName);
                    await MakeRequest.MakeNaturalPostRequest(apiName, makeParams.GetParam());

                    apiName = Define.GetApiName(Define.APINAME_TYPE.tutorial_chara);
                    makeParams.ClearParam();
                    makeParams.AddParam("characterId", "4");
                    makeParams.AddCommonParams();
                    makeParams.AddParam("pid", account.pid);
                    makeParams.AddSignatureParam(account.Id, apiName);
                    await MakeRequest.MakeNaturalPostRequest(apiName, makeParams.GetParam());

                    apiName = Define.GetApiName(Define.APINAME_TYPE.tutorial_name);
                    makeParams.ClearParam();
                    makeParams.AddParam("userName", "777wiki");
                    makeParams.AddCommonParams();
                    makeParams.AddParam("pid", account.pid);
                    makeParams.AddSignatureParam(account.Id, apiName);
                    await MakeRequest.MakeNaturalPostRequest(apiName, makeParams.GetParam());

                    apiName = Define.GetApiName(Define.APINAME_TYPE.tutorial_type);
                    makeParams.ClearParam();
                    makeParams.AddParam("userTypeId", "1");
                    makeParams.AddCommonParams();
                    makeParams.AddParam("pid", account.pid);
                    makeParams.AddSignatureParam(account.Id, apiName);
                    await MakeRequest.MakeNaturalPostRequest(apiName, makeParams.GetParam());

                    apiName = Define.GetApiName(Define.APINAME_TYPE.gacha_main);
                    makeParams.ClearParam();
                    makeParams.AddCommonParams();
                    makeParams.AddParam("pid", account.pid);
                    makeParams.AddSignatureParam(account.Id, apiName);
                    await MakeRequest.MakeNaturalPostRequest(apiName, makeParams.GetParam());
                    await ParseResultJsonAsync(Define.GetExtensionsTempPath());

                    apiName = Define.GetApiName(Define.APINAME_TYPE.gacha_result);
                    makeParams.ClearParam();
                    makeParams.AddParam("gachaId", ParseGachaMain(0));
                    makeParams.AddParam("continueNum", "1");
                    makeParams.AddParam("paymentType", "4");
                    makeParams.AddParam("sellRarity", "0");
                    makeParams.AddParam("removeTarget", "0");
                    makeParams.AddParam("eventType", "0");
                    makeParams.AddCommonParams();
                    makeParams.AddParam("pid", account.pid);
                    makeParams.AddSignatureParam(account.Id, apiName);
                    await MakeRequest.MakeNaturalPostRequest(apiName, makeParams.GetParam());
                    await ParseResultJsonAsync(Define.GetExtensionsTempPath());

                    account.Gachas = new List <Gacha> {
                        ParseGachaResult()
                    };

                    DownloadGachaCard(account.Gachas[0], $@"{Define.GetExtensionsSavePath()}{account.pid}\").Start();

                    apiName = Define.GetApiName(Define.APINAME_TYPE.tutorial_end);
                    makeParams.ClearParam();
                    makeParams.AddCommonParams();
                    makeParams.AddParam("pid", account.pid);
                    makeParams.AddSignatureParam(account.Id, apiName);
                    await MakeRequest.MakeNaturalPostRequest(apiName, makeParams.GetParam());

                    apiName = Define.GetApiName(Define.APINAME_TYPE.tutorial_questionnaire);
                    makeParams.ClearParam();
                    makeParams.AddParam("answers%5B%5D", "0");
                    makeParams.AddParam("answers%5B%5D", "2");
                    makeParams.AddParam("answers%5B%5D", "1");
                    makeParams.AddParam("answers%5B%5D", "11");
                    makeParams.AddCommonParams();
                    makeParams.AddParam("pid", account.pid);
                    makeParams.AddSignatureParam(account.Id, apiName);
                    await MakeRequest.MakeNaturalPostRequest(apiName, makeParams.GetParam());

                    apiName = Define.GetApiName(Define.APINAME_TYPE.tutorial_beginner);
                    makeParams.ClearParam();
                    makeParams.AddCommonParams();
                    makeParams.AddParam("pid", account.pid);
                    makeParams.AddSignatureParam(account.Id, apiName);
                    await MakeRequest.MakeNaturalPostRequest(apiName, makeParams.GetParam());

                    apiName = Define.GetApiName(Define.APINAME_TYPE.gacha_main);
                    makeParams.ClearParam();
                    makeParams.AddCommonParams();
                    makeParams.AddParam("pid", account.pid);
                    makeParams.AddSignatureParam(account.Id, apiName);
                    await MakeRequest.MakeNaturalPostRequest(apiName, makeParams.GetParam());
                    await ParseResultJsonAsync(Define.GetExtensionsTempPath());

                    var gachaId1 = ParseGachaMain(2);
                    var gachaId2 = ParseGachaMain(3);

                    apiName = Define.GetApiName(Define.APINAME_TYPE.gacha_result);
                    makeParams.ClearParam();
                    makeParams.AddParam("gachaId", gachaId1);
                    makeParams.AddParam("continueNum", "1");
                    makeParams.AddParam("paymentType", "1");
                    makeParams.AddParam("sellRarity", "0");
                    makeParams.AddParam("removeTarget", "0");
                    makeParams.AddParam("eventType", "0");
                    makeParams.AddCommonParams();
                    makeParams.AddParam("pid", account.pid);
                    makeParams.AddSignatureParam(account.Id, apiName);
                    await MakeRequest.MakeNaturalPostRequest(apiName, makeParams.GetParam());
                    await ParseResultJsonAsync(Define.GetExtensionsTempPath());

                    account.Gachas.Add(ParseGachaResult());

                    apiName = Define.GetApiName(Define.APINAME_TYPE.gacha_result);
                    makeParams.ClearParam();
                    makeParams.AddParam("gachaId", gachaId2);
                    makeParams.AddParam("continueNum", "1");
                    makeParams.AddParam("paymentType", "1");
                    makeParams.AddParam("sellRarity", "0");
                    makeParams.AddParam("removeTarget", "0");
                    makeParams.AddParam("eventType", "0");
                    makeParams.AddCommonParams();
                    makeParams.AddParam("pid", account.pid);
                    makeParams.AddSignatureParam(account.Id, apiName);
                    await MakeRequest.MakeNaturalPostRequest(apiName, makeParams.GetParam());
                    await ParseResultJsonAsync(Define.GetExtensionsTempPath());

                    account.Gachas.Add(ParseGachaResult());

                    SetUserCardList(account);

                    DownloadGachaCard(account.Gachas[1], Define.GetExtensionsSavePath() + account.pid + @"\").Start();

                    Accounts.Add(account);

                    Thread.Sleep(60000);
                    accountCount++;
                } while (accountCount < 5);
            }
            finally
            {
                var downloadConfing = JsonConvert.SerializeObject(Accounts);
                using (var fileStream = File.OpenWrite(Define.GetExtensionsSavePath() + @"Accounts.json"))
                {
                    var fileBytes = Encoding.UTF8.GetBytes(downloadConfing);
                    fileStream.Write(fileBytes, 0, fileBytes.Length);
                    fileStream.Close();
                }
            }
        }