public bool CancelOrderFromActiveQueue(RequestManager reqManager, int orderNr, string token, int village) { var url = $"https://sv36.tribalwars.se/game.php?village={village}&screen=train&ajaxaction=cancel&h={token}"; var postData = $"id={orderNr}"; var res = reqManager.SendPOSTRequest(url, postData, null, null, true); var jsonRes = RequestManager.GetResponseStringFromResponse(res); return(jsonRes.Contains("success:true")); }
public bool AddOrderToActiveQueue(RequestManager reqManager, Dictionary <Units, int> units, string token, int village) { var url = $"https://sv36.tribalwars.se/game.php?village={village}&screen=train&ajaxaction=train&mode=train&h={token}"; var postData = ""; foreach (var unitKeyPair in units) { var unitName = UnitHelper.GetNameForType(unitKeyPair.Key); postData += $"units%5B{unitName}%5D={unitKeyPair.Value}&"; } var res = reqManager.SendPOSTRequest(url, postData, null, null, true); var jsonRes = RequestManager.GetResponseStringFromResponse(res); return(jsonRes.Contains("success:true")); }
private void SendAttackConfirm(RequestManager requestManager, string postData, string token, int village) { var url = $"https://sv36.tribalwars.se/game.php?village={village}&screen=place&action=command&h={token}"; var res = requestManager.SendPOSTRequest(url, postData, null, null, true); var htmlResponse = RequestManager.GetResponseStringFromResponse(res); }