public void Run() { var battleId = _client.ViewModel.GuildBattleId; while (_client.ViewModel.TpValue >= 10 && _client.ViewModel.IsRunning) { GuildBattleInfo battleInfo = GuildBattle(battleId); _client.ViewModel.TpValue = battleInfo.status.tp.value; // attack var type = "front".Equals(battleInfo.status.position) ? "attack" : "yell"; var ablility = "front".Equals(battleInfo.status.position) ? "ability_front_attack_default" : "ability_back_yell_default_1"; GuildBattleCmdInfo cmdInfo = GuildBattleCmd(battleId, type); var cmd = cmdInfo.cmd.Find(item => ablility.Equals(item._id)); if (cmd != null) { GuildBattleCmd(battleId, ablility, type); } } TpInfo tpInfo = GuildBattleTpInfo(); // quest TpQuest(); }
public async Task <ActionResult <ApiResult> > GotoGame(TpInfo tpInfo) { var result = new ApiResult(); // var data = await _thirdPartyService.GotoGameAsync(tpInfo); // result.Data = data; return(Ok(result)); }
public async Task <string> GotoGameAsync(TpInfo tpInfo) { string json = JsonSerializer.Serialize(tpInfo); StringContent stringContent = new StringContent(json); var resp = await _Client.PostAsync("ThirdParty", stringContent); resp.EnsureSuccessStatusCode(); var result = await resp.Content.ReadAsStringAsync(); return(result); }
public async Task <ActionResult <ApiResult> > Get() { var result = new ApiResult(); TpInfo tpInfo = new TpInfo() { GameType = "Ag" }; var data = await _thirdPartyService.GotoGameAsync(tpInfo); result.Data = data; return(Ok(result)); }
private TpInfo GuildBattleTpInfo() { var battleId = _client.ViewModel.GuildBattleId; var result = _client.GetXHR("http://astrum.amebagames.com/_/guildbattle/tp?_id=" + Uri.EscapeDataString(battleId)); TpInfo tpInfo = JsonConvert.DeserializeObject <TpInfo>(result); _client.ViewModel.IsTpNormalAvailable = tpInfo.normal.available; _client.ViewModel.IsTpChatAvailable = tpInfo.chat.available; _client.ViewModel.IsTpRouletteAvailable = tpInfo.roulette.available; _client.DelayShort(); return(tpInfo); }
//[ServiceFilter(typeof(MyActionFilterAttribute))] public async Task <IActionResult> GotoGame(TpInfo tpInfo) { ThirdPartyCore serive = _thirdPartyCollection[tpInfo.TpType]; return(Ok(serive.tset())); }