Beispiel #1
0
 void GetBalanceThread()
 {
     while (iskd)
     {
         try
         {
             if ((DateTime.Now - lastupdate).TotalSeconds > 30 || ForceUpdateStats)
             {
                 lastupdate = DateTime.Now;
                 string   Stats    = Client.GetStringAsync("userstats").Result;
                 PIOStats tmpstats = json.JsonDeserialize <PIOStats>(Stats);
                 this.balance = ((decimal)tmpstats.user.balances.btc) / 100000000m;
                 this.bets    = (int)tmpstats.user.stats.btc.bets;
                 this.wagered = ((decimal)tmpstats.user.stats.btc.wagered) / 100000000m;
                 this.profit  = ((decimal)tmpstats.user.stats.btc.profit) / 100000000m;
                 Parent.updateBalance(balance);
                 Parent.updateBets(bets);
                 Parent.updateWagered(wagered);
                 Parent.updateProfit(profit);
             }
         }
         catch { }
         Thread.Sleep(1000);
     }
 }
Beispiel #2
0
        public override void Login(string Username, string Password, string twofa)
        {
            ClientHandlr = new HttpClientHandler {
                UseCookies = true, AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip, Proxy = this.Prox, UseProxy = Prox != null
            };
            Client = new HttpClient(ClientHandlr)
            {
                BaseAddress = new Uri("https://coinpro.fit/api/")
            };
            Client.DefaultRequestHeaders.AcceptEncoding.Add(new System.Net.Http.Headers.StringWithQualityHeaderValue("gzip"));
            Client.DefaultRequestHeaders.AcceptEncoding.Add(new System.Net.Http.Headers.StringWithQualityHeaderValue("deflate"));
            Client.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:43.0) Gecko/20100101 Firefox/43.0");
            Client.DefaultRequestHeaders.Add("Host", "coinpro.fit");
            Client.DefaultRequestHeaders.Add("Origin", "https://coinpro.fit/");
            Client.DefaultRequestHeaders.Add("Referer", "https://coinpro.fit/");

            try
            {
                //ClientHandlr.CookieContainer.Add(new Cookie("socket", Password,"/","coinpro.fit"));
                ClientHandlr.CookieContainer.Add(new Cookie("PHPSESSID", Password, "/", "coinpro.fit"));
                //string page = Client.GetStringAsync()
                string   Stats    = Client.GetStringAsync("userstats").Result;
                PIOStats tmpstats = json.JsonDeserialize <PIOStats>(Stats);
                accesstoken  = Password;
                this.balance = (tmpstats.user.balances.btc) / 100000000m;
                this.bets    = (int)tmpstats.user.stats.btc.bets;
                this.wagered = (tmpstats.user.stats.btc.wagered) / 100000000m;
                this.profit  = (tmpstats.user.stats.btc.profit) / 100000000m;
                Parent.updateBalance(balance);
                Parent.updateBets(bets);
                Parent.updateWagered(wagered);
                Parent.updateProfit(profit);
                iskd       = true;
                lastupdate = DateTime.Now;
                //lasthash=tmpstats.user.
                new Thread(new ThreadStart(GetBalanceThread)).Start();
                finishedlogin(true);
            }
            catch
            {
                finishedlogin(false);
                return;
            }
        }