protected override void CurrencyChanged() { try { if (accesstoken != "") { lastupdate = DateTime.Now; List <KeyValuePair <string, string> > pairs = new List <KeyValuePair <string, string> >(); pairs.Add(new KeyValuePair <string, string>("accessToken", accesstoken)); pairs.Add(new KeyValuePair <string, string>("coin", Currency)); FormUrlEncodedContent Content = new FormUrlEncodedContent(pairs); string responseData = ""; string s = Client.PostAsync(("user"), Content).Result.Content.ReadAsStringAsync().Result; bbStats tmpu = json.JsonDeserialize <bbStats>(s); balance = tmpu.balance; //i assume bets = tmpu.total_bets; wagered = tmpu.total_wagered; profit = tmpu.total_profit; wins = tmpu.total_wins; losses = bets - losses; Parent.updateBalance((decimal)(balance)); Parent.updateBets(bets); Parent.updateLosses(losses); Parent.updateProfit(profit); Parent.updateWagered(wagered); Parent.updateWins(wins); } } catch { } }
void GetBalanceThread() { while (ispd) { try { if (accesstoken != "" && ((DateTime.Now - lastupdate).TotalSeconds > 60||ForceUpdateStats)) { lastupdate = DateTime.Now; string s1 = "user?accessToken=" + accesstoken+"&coin="+actualcur; string s = Client.GetStringAsync(s1).Result; bbStats tmpu = json.JsonDeserialize<bbStats>(s); balance = tmpu.balance; //i assume bets = tmpu.total_bets; wagered = tmpu.total_wagered; profit = tmpu.total_profit; wins = tmpu.total_wins; losses = bets - losses; Parent.updateBalance((decimal)(balance)); Parent.updateBets(bets); Parent.updateLosses(losses); Parent.updateProfit(profit); Parent.updateWagered(wagered ); Parent.updateWins(wins); } } catch { } Thread.Sleep(1000); } }
protected override void CurrencyChanged() { actualcur = Currency == "btc" ? Currency : "rbs"; try { if (accesstoken != "") { lastupdate = DateTime.Now; string s1 = "user?accessToken=" + accesstoken + "&coin=" + actualcur; string s = Client.GetStringAsync(s1).Result; bbStats tmpu = json.JsonDeserialize<bbStats>(s); balance = tmpu.balance; //i assume bets = tmpu.total_bets; wagered = tmpu.total_wagered; profit = tmpu.total_profit; wins = tmpu.total_wins; losses = bets - losses; Parent.updateBalance((decimal)(balance)); Parent.updateBets(bets); Parent.updateLosses(losses); Parent.updateProfit(profit); Parent.updateWagered(wagered); Parent.updateWins(wins); } } catch { } }
protected override void CurrencyChanged() { try { if (accesstoken != "" && (DateTime.Now - lastupdate).TotalSeconds > 60) { lastupdate = DateTime.Now; string s = Client.GetAsync(new Uri("user?accessToken=" + accesstoken + "&coin=" + Currency)).Result.RequestMessage.Content.ReadAsStringAsync().Result; bbStats tmpu = json.JsonDeserialize <bbStats>(s); balance = tmpu.balance; //i assume bets = tmpu.total_bets; wagered = tmpu.total_wagered; profit = tmpu.total_profit; wins = tmpu.total_wins; losses = bets - losses; Parent.updateBalance((decimal)(balance)); Parent.updateBets(bets); Parent.updateLosses(losses); Parent.updateProfit(profit); Parent.updateWagered(wagered); Parent.updateWins(wins); } } catch { } }
public override void Login(string Username, string Password, string otp) { this.username = Username; this.accesstoken = Password; try { if (accesstoken != "") { HttpWebRequest betrequest = (HttpWebRequest)HttpWebRequest.Create("https://betterbets.io/api/user?accessToken=" + accesstoken); betrequest.Method = "GET"; if (Prox != null) { betrequest.Proxy = Prox; } betrequest.ContentType = "application/x-www-form-urlencoded; charset=UTF-8"; HttpWebResponse EmitResponse2 = (HttpWebResponse)betrequest.GetResponse(); string sEmitResponse2 = new StreamReader(EmitResponse2.GetResponseStream()).ReadToEnd(); bbStats tmpu = json.JsonDeserialize <bbStats>(sEmitResponse2); if (tmpu.error != 1) { balance = tmpu.balance; //i assume bets = tmpu.total_bets; wagered = tmpu.total_wagered; profit = tmpu.total_profit; wins = tmpu.total_wins; losses = bets - losses; Parent.updateBalance((decimal)(balance)); Parent.updateBets(bets); Parent.updateLosses(losses); Parent.updateProfit(profit); Parent.updateWagered(wagered); Parent.updateWins(wins); lastupdate = DateTime.Now; getDepositAddress(); finishedlogin(true); return; } } } catch (WebException e) { if (e.Response != null) { } finishedlogin(false); return; } finishedlogin(false); }
void GetBalanceThread() { try { while (ispd) { if (accesstoken != "" && (DateTime.Now - lastupdate).TotalSeconds > 60) { HttpWebRequest betrequest = (HttpWebRequest)HttpWebRequest.Create("https://betterbets.io/api/user?accessToken=" + accesstoken); if (Prox != null) { betrequest.Proxy = Prox; } betrequest.ContentType = "application/x-www-form-urlencoded; charset=UTF-8"; HttpWebResponse EmitResponse2 = (HttpWebResponse)betrequest.GetResponse(); string sEmitResponse2 = new StreamReader(EmitResponse2.GetResponseStream()).ReadToEnd(); bbStats tmpu = json.JsonDeserialize <bbStats>(sEmitResponse2); balance = tmpu.balance; //i assume bets = tmpu.total_bets; wagered = tmpu.total_wagered; profit = tmpu.total_profit; wins = tmpu.total_wins; losses = bets - losses; Parent.updateBalance((decimal)(balance)); Parent.updateBets(bets); Parent.updateLosses(losses); Parent.updateProfit(profit); Parent.updateWagered(wagered); Parent.updateWins(wins); lastupdate = DateTime.Now; } Thread.Sleep(1000); } } catch { } }
void GetBalanceThread() { while (ispd) { try { if (accesstoken != "" && ((DateTime.Now - lastupdate).TotalSeconds > 60 || ForceUpdateStats)) { lastupdate = DateTime.Now; List <KeyValuePair <string, string> > pairs = new List <KeyValuePair <string, string> >(); pairs.Add(new KeyValuePair <string, string>("accessToken", accesstoken)); pairs.Add(new KeyValuePair <string, string>("coin", Currency)); FormUrlEncodedContent Content = new FormUrlEncodedContent(pairs); string responseData = ""; string s = Client.PostAsync(("user"), Content).Result.Content.ReadAsStringAsync().Result; bbStats tmpu = json.JsonDeserialize <bbStats>(s); balance = tmpu.balance; //i assume bets = tmpu.total_bets; wagered = tmpu.total_wagered; profit = tmpu.total_profit; wins = tmpu.total_wins; losses = bets - losses; Parent.updateBalance((decimal)(balance)); Parent.updateBets(bets); Parent.updateLosses(losses); Parent.updateProfit(profit); Parent.updateWagered(wagered); Parent.updateWins(wins); } Thread.Sleep(1000); } catch { } } }
public override void Login(string Username, string Password, string otp) { ClientHandlr = new HttpClientHandler() { UseCookies = true, AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate, Proxy = (IWebProxy)this.Prox, UseProxy = this.Prox != null }; Client = new HttpClient(ClientHandlr) { BaseAddress = new Uri("https://betterbets.io/api/") }; Client.DefaultRequestHeaders.AcceptEncoding.Add(new System.Net.Http.Headers.StringWithQualityHeaderValue("gzip")); Client.DefaultRequestHeaders.AcceptEncoding.Add(new System.Net.Http.Headers.StringWithQualityHeaderValue("deflate")); lastupdate = DateTime.Now; this.username = Username; this.accesstoken = Password; try { if (accesstoken != "") { //string s1 = "user?accessToken=" + accesstoken+"&coin="+Currency; try { List <KeyValuePair <string, string> > pairs = new List <KeyValuePair <string, string> >(); pairs.Add(new KeyValuePair <string, string>("accessToken", accesstoken)); pairs.Add(new KeyValuePair <string, string>("coin", Currency)); FormUrlEncodedContent Content = new FormUrlEncodedContent(pairs); string s = Client.PostAsync(("user"), Content).Result.Content.ReadAsStringAsync().Result; bbStats tmpu = json.JsonDeserialize <bbStats>(s); if (tmpu.error != 1) { balance = tmpu.balance; //i assume bets = tmpu.total_bets; wagered = tmpu.total_wagered; profit = tmpu.total_profit; wins = tmpu.total_wins; losses = bets - losses; Parent.updateBalance((decimal)(balance)); Parent.updateBets(bets); Parent.updateLosses(losses); Parent.updateProfit(profit); Parent.updateWagered(wagered); Parent.updateWins(wins); lastupdate = DateTime.Now; //getDepositAddress(); Thread t = new Thread(GetBalanceThread); ispd = true; t.Start(); finishedlogin(true); return; } else { finishedlogin(false); return; } } catch (AggregateException e) { } catch (Exception e) { finishedlogin(false); return; } } } catch (WebException e) { if (e.Response != null) { } finishedlogin(false); return; } finishedlogin(false); }
public override void Login(string Username, string Password, string otp) { ClientHandlr = new HttpClientHandler() { UseCookies = true, AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate }; Client = new HttpClient(ClientHandlr) { BaseAddress = new Uri("https://betterbets.io/api/") }; Client.DefaultRequestHeaders.AcceptEncoding.Add(new System.Net.Http.Headers.StringWithQualityHeaderValue("gzip")); Client.DefaultRequestHeaders.AcceptEncoding.Add(new System.Net.Http.Headers.StringWithQualityHeaderValue("deflate")); lastupdate = DateTime.Now; this.username = Username; this.accesstoken = Password; try { if (accesstoken != "") { string s1 = "user?accessToken=" + accesstoken + "&coin=" + Currency; try { string s = Client.GetStringAsync(s1).Result; bbStats tmpu = json.JsonDeserialize <bbStats>(s); if (tmpu.error != 1) { balance = tmpu.balance; //i assume bets = tmpu.total_bets; wagered = tmpu.total_wagered; profit = tmpu.total_profit; wins = tmpu.total_wins; losses = bets - losses; Parent.updateBalance((decimal)(balance)); Parent.updateBets(bets); Parent.updateLosses(losses); Parent.updateProfit(profit); Parent.updateWagered(wagered); Parent.updateWins(wins); lastupdate = DateTime.Now; getDepositAddress(); finishedlogin(true); return; } else { finishedlogin(false); return; } } catch (AggregateException e) { } catch (Exception e) { finishedlogin(false); return; } } } catch (WebException e) { if (e.Response != null) { } finishedlogin(false); return; } finishedlogin(false); }