Beispiel #1
0
        public async Task <bool> BuildTechAsync(TechFactoryData.TechFactoryItem item, int hall)
        {
            var techFactory = await _httpClient.GetAsyncLimit(Urls.Build(Urls.InternalNanoTechFactory));

            var reloadToken = Regex.Match(techFactory, "reloadToken=(.*?)'").Groups[1].Value;
            await Task.Delay(1500);

            var result = await _httpClient.GetAsyncLimit(string.Format(Urls.BuildTech, Urls.BaseUrl, item.GetShortName(), reloadToken));

            EvaluateTechFactory(result);

            if (TechFactoryData.GetById(hall) != null)
            {
                return(TechFactoryData.GetById(hall).Building);
            }

            return(false);
        }
Beispiel #2
0
        public async Task <bool> BuildTechAsync(TechFactoryData.TechFactoryItem item, int hall)
        {
            var techFactoryRaw = await _httpClient.PostAsyncLimitRaw(Urls.Build("{0}/ajax/nanotechFactory.php"), $"command=nanoTechFactoryShowBuff&key={item.GetShortName()}&level=1");

            var techFactory = await techFactoryRaw.Content.ReadAsStringAsync();

            var reloadToken = Regex.Match(techFactory, "reloadToken=(.*?)\"").Groups[1].Value;
            await Task.Delay(1500);

            var result = await _httpClient.GetAsyncLimit(string.Format(Urls.BuildTech, Urls.BaseUrl, item.GetShortName(), reloadToken));

            EvaluateTechFactory(result);

            if (TechFactoryData.GetById(hall) != null)
            {
                return(TechFactoryData.GetById(hall).Building);
            }

            return(false);
        }