Exemple #1
0
 public string getDepositAddress()
 {
     try
     {
         string    s   = Client.GetStringAsync("depositAddress?accessToken=" + accesstoken + "&coin=" + Currency).Result;
         PRCDepost tmp = json.JsonDeserialize <PRCDepost>(s);
         return(tmp.Address);
     }
     catch (AggregateException e)
     {
         return("");
     }
 }
Exemple #2
0
        void GetDeposit()
        {
            System.Threading.Thread.Sleep(10000);
            HttpWebRequest getHeaders = HttpWebRequest.Create("https://betking.io/account/getDepositAddress") as HttpWebRequest;

            if (Prox != null)
            {
                getHeaders.Proxy = Prox;
            }
            getHeaders.CookieContainer = Cookies;
            HttpWebResponse Response = (HttpWebResponse)getHeaders.GetResponse();
            string          s1       = new StreamReader(Response.GetResponseStream()).ReadToEnd();
            PRCDepost       dep      = json.JsonDeserialize <PRCDepost>(s1);

            Parent.updateDeposit(dep.Address);
        }
Exemple #3
0
        public string getDepositAddress()
        {
            return("");

            HttpWebRequest betrequest = (HttpWebRequest)HttpWebRequest.Create("https://betterbets.io/api/depositAddress?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();
            PRCDepost       tmp            = json.JsonDeserialize <PRCDepost>(sEmitResponse2);

            return(tmp.Address);
        }
Exemple #4
0
        public override bool Register(string Username, string Passwrd)
        {
            HttpWebRequest getHeaders = HttpWebRequest.Create("https://betking.io/play/#account") as HttpWebRequest;

            if (Prox != null)
            {
                getHeaders.Proxy = Prox;
            }
            var cookies = new CookieContainer();

            getHeaders.CookieContainer = cookies;
            getHeaders.CookieContainer.Add(new Cookie("PRC_Affiliate", "357", "/", "betking.io"));
            HttpWebResponse Response = null;
            string          rqtoken  = "";

            try
            {
                Response = (HttpWebResponse)getHeaders.GetResponse();
                string s1  = new StreamReader(Response.GetResponseStream()).ReadToEnd();
                string tmp = s1.Substring(s1.IndexOf("__RequestVerificationToken") + "__RequestVerificationToken\" type=\"hidden\" value=\"".Length);
                rqtoken = tmp.Substring(0, tmp.IndexOf("\""));
            }
            catch (WebException e)
            {
                return(false);
            }
            CookieContainer tmpContainer = getHeaders.CookieContainer;


            foreach (Cookie c in Response.Cookies)
            {
                /*if (c.Name == "__RequestVerificationToken")
                 *  rqtoken = c.Value;*/
                Cookies.Add(c);
            }
            con.CookieContainer = Cookies;
            try
            {
                string s1 = "";
                getHeaders = HttpWebRequest.Create("https://betking.io/account/GetUserAccount") as HttpWebRequest;
                //getHeaders.CookieContainer.Add(new Cookie("PRC_Affiliate", "357", "/", "betking.io"));
                if (Prox != null)
                {
                    getHeaders.Proxy = Prox;
                }
                getHeaders.CookieContainer = Cookies;
                Response = (HttpWebResponse)getHeaders.GetResponse();
                string stmp  = new StreamReader(Response.GetResponseStream()).ReadToEnd();
                string sstmp = stmp.Substring(stmp.IndexOf("__RequestVerificationToken") + "__RequestVerificationToken\" type=\"hidden\" value=\"".Length);
                //s = rqtoken = sstmp.Substring(0, sstmp.IndexOf("\""));


                dicehub = con.CreateHubProxy("diceHub");
                con.Start().Wait();
                getHeaders = HttpWebRequest.Create("https://betking.io/account/SaveUserNameAndPassword") as HttpWebRequest;
                if (Prox != null)
                {
                    getHeaders.Proxy = Prox;
                }
                getHeaders.CookieContainer = tmpContainer;
                foreach (Cookie c in Response.Cookies)
                {
                    getHeaders.CookieContainer.Add(c);
                }
                getHeaders.CookieContainer.Add(new Cookie("PRC_Affiliate", "357", "/", "betking.io"));
                System.Threading.Thread.Sleep(5000);
                getHeaders.Method = "POST";
                string post = string.Format("userName={0}&password={1}&confirmPassword={1}&__RequestVerificationToken={2}", Username, Passwrd, rqtoken);
                getHeaders.ContentType   = "application/x-www-form-urlencoded";
                getHeaders.ContentLength = post.Length;
                using (var writer = new StreamWriter(getHeaders.GetRequestStream()))
                {
                    string writestring = post as string;
                    writer.Write(writestring);
                }
                try
                {
                    Response = (HttpWebResponse)getHeaders.GetResponse();
                    s1       = new StreamReader(Response.GetResponseStream()).ReadToEnd();

                    /*string tmp = s1.Substring(s1.IndexOf("__RequestVerificationToken") + "__RequestVerificationToken\" type=\"hidden\" value=\"".Length);
                     * rqtoken = tmp.Substring(0, tmp.IndexOf("\""));*/
                }
                catch (WebException e)
                {
                    Response = (HttpWebResponse)e.Response;
                    s1       = new StreamReader(Response.GetResponseStream()).ReadToEnd();
                    return(false);
                }

                dicehub.On <string, string, string, string, string, string>("receiveChatMessage", GotChatMessage);

                getHeaders = HttpWebRequest.Create("https://betking.io/account/GetUserAccount") as HttpWebRequest;
                if (Prox != null)
                {
                    getHeaders.Proxy = Prox;
                }
                getHeaders.CookieContainer = Cookies;
                //Response = (HttpWebResponse)getHeaders.GetResponse();
                //s1 = new StreamReader(Response.GetResponseStream()).ReadToEnd();
                //PRCUser tmp = json.JsonDeserialize<PRCUser>(s1);
                balance = 0; // (double)tmp.AvailableBalance;
                profit  = 0; //(double)tmp.Profit;
                wagered = 0; //(double) tmp.Wagered;
                bets    = 0; //(int)tmp.NumBets;
                wins    = 0; //(int)tmp.Wins;
                losses  = 0; //(int)tmp.Losses;
                UserID  = 0; //tmp.Id;
                Parent.updateBalance((decimal)(balance));
                Parent.updateBets(bets);
                Parent.updateLosses(losses);
                Parent.updateProfit(profit);
                Parent.updateWagered(wagered);
                Parent.updateWins(wins);
                //Parent.updateDeposit(tmp.DepositAddress);

                /*getHeaders = HttpWebRequest.Create("https://betking.io/account/GetCurrentSeed") as HttpWebRequest;
                 * if (Prox != null)
                 *  getHeaders.Proxy = Prox;
                 * getHeaders.CookieContainer = Cookies;
                 * Response = (HttpWebResponse)getHeaders.GetResponse();
                 * s1 = new StreamReader(Response.GetResponseStream()).ReadToEnd();
                 * prcSeed getseed = json.JsonDeserialize<prcSeed>(s1);
                 * client = getseed.ClientSeed;
                 * serverhash = getseed.ServerHash;*/
                try
                {
                    getHeaders = HttpWebRequest.Create("https://betking.io/account/getDepositAddress") as HttpWebRequest;
                    if (Prox != null)
                    {
                        getHeaders.Proxy = Prox;
                    }
                    getHeaders.CookieContainer = Cookies;
                    Response = (HttpWebResponse)getHeaders.GetResponse();
                    s1       = new StreamReader(Response.GetResponseStream()).ReadToEnd();
                    PRCDepost dep = json.JsonDeserialize <PRCDepost>(s1);
                    Parent.updateDeposit(dep.Address);
                }
                catch
                {
                    new System.Threading.Thread(GetDeposit).Start();
                }
                finishedlogin(true);
                return(true);
            }
            catch
            {
                finishedlogin(false);
                return(false);
            }
        }
Exemple #5
0
        public override void Login(string Username, string Password, string twofa)
        {
            HttpWebRequest getHeaders = HttpWebRequest.Create("https://betking.io/play/#dice") as HttpWebRequest;

            if (Prox != null)
            {
                getHeaders.Proxy = Prox;
            }
            var cookies = new CookieContainer();

            getHeaders.CookieContainer = cookies;
            HttpWebResponse Response = null;
            string          rqtoken  = "";
            string          s1       = "";

            try
            {
                Response = (HttpWebResponse)getHeaders.GetResponse();
                s1       = new StreamReader(Response.GetResponseStream()).ReadToEnd();
                string tmp = s1.Substring(s1.IndexOf("__RequestVerificationToken") + "__RequestVerificationToken\" type=\"hidden\" value=\"".Length);
                s = rqtoken = tmp.Substring(0, tmp.IndexOf("\""));
            }
            catch (WebException e)
            {
                finishedlogin(false);
                return;
            }

            getHeaders = HttpWebRequest.Create("https://betking.io/account/login") as HttpWebRequest;
            if (Prox != null)
            {
                getHeaders.Proxy = Prox;
            }
            getHeaders.CookieContainer = new CookieContainer();
            foreach (Cookie c in Response.Cookies)
            {
                getHeaders.CookieContainer.Add(c);
            }
            getHeaders.Method = "POST";
            string post = string.Format("userName={0}&password={1}&twoFactorCode={2}&__RequestVerificationToken={3}", Username, Password, twofa, rqtoken);

            getHeaders.ContentType   = "application/x-www-form-urlencoded";
            getHeaders.ContentLength = post.Length;
            using (var writer = new StreamWriter(getHeaders.GetRequestStream()))
            {
                string writestring = post as string;
                writer.Write(writestring);
            }
            try
            {
                Response = (HttpWebResponse)getHeaders.GetResponse();
                s1       = new StreamReader(Response.GetResponseStream()).ReadToEnd();
                if (!s1.ToLower().Contains("true"))
                {
                    finishedlogin(false);
                    return;
                }

                /*string tmp = s1.Substring(s1.IndexOf("__RequestVerificationToken") + "__RequestVerificationToken\" type=\"hidden\" value=\"".Length);
                 * rqtoken = tmp.Substring(0, tmp.IndexOf("\""));*/
            }
            catch (WebException e)
            {
                Response = (HttpWebResponse)e.Response;
                s1       = new StreamReader(Response.GetResponseStream()).ReadToEnd();
                finishedlogin(false);
                return;
            }

            foreach (Cookie c in Response.Cookies)
            {
                if (c.Name == "__RequestVerificationToken")
                {
                    rqtoken = c.Value;
                }
                Cookies.Add(c);
            }
            Cookies.Add((new Cookie("PRC_Affiliate", "357", "/", "betking.io")));
            con.CookieContainer = Cookies;
            try
            {
                getHeaders = HttpWebRequest.Create("https://betking.io/play/#dice") as HttpWebRequest;
                if (Prox != null)
                {
                    getHeaders.Proxy = Prox;
                }
                getHeaders.CookieContainer = Cookies;
                Response = (HttpWebResponse)getHeaders.GetResponse();
                string stmp  = new StreamReader(Response.GetResponseStream()).ReadToEnd();
                string sstmp = stmp.Substring(stmp.IndexOf("__RequestVerificationToken") + "__RequestVerificationToken\" type=\"hidden\" value=\"".Length);
                s = rqtoken = sstmp.Substring(0, sstmp.IndexOf("\""));



                dicehub = con.CreateHubProxy("diceHub");
                con.Start().Wait();

                dicehub.Invoke("joinChatRoom", 1);
                dicehub.On <string, string, string, int, int, bool>("chat", ReceivedChat);
                dicehub.On <string, string, string, int, bool>("receivePrivateMesssage", ReceivedChat);

                getHeaders = HttpWebRequest.Create("https://betking.io/account/GetUserAccount") as HttpWebRequest;
                if (Prox != null)
                {
                    getHeaders.Proxy = Prox;
                }
                getHeaders.CookieContainer = Cookies;
                Response = (HttpWebResponse)getHeaders.GetResponse();
                s1       = new StreamReader(Response.GetResponseStream()).ReadToEnd();
                PRCUser tmp = json.JsonDeserialize <PRCUser>(s1);
                balance = (double)tmp.AvailableBalance;
                profit  = (double)tmp.Profit;
                wagered = (double)tmp.Wagered;
                bets    = (int)tmp.NumBets;
                wins    = (int)tmp.Wins;
                losses  = (int)tmp.Losses;
                UserID  = tmp.Id;
                Parent.updateBalance((decimal)(balance));
                Parent.updateBets(tmp.NumBets);
                Parent.updateLosses(tmp.Losses);
                Parent.updateProfit(profit);
                Parent.updateWagered(wagered);
                Parent.updateWins(tmp.Wins);
                //Parent.updateDeposit(tmp.DepositAddress);

                getHeaders = HttpWebRequest.Create("https://betking.io/account/GetCurrentSeed?gameType=0") as HttpWebRequest;
                if (Prox != null)
                {
                    getHeaders.Proxy = Prox;
                }
                getHeaders.CookieContainer = Cookies;
                Response = (HttpWebResponse)getHeaders.GetResponse();
                s1       = new StreamReader(Response.GetResponseStream()).ReadToEnd();
                prcSeed getseed = json.JsonDeserialize <prcSeed>(s1);
                client     = getseed.ClientSeed;
                serverhash = getseed.ServerHash;

                try
                {
                    getHeaders = HttpWebRequest.Create("https://betking.io/account/getDepositAddress") as HttpWebRequest;
                    if (Prox != null)
                    {
                        getHeaders.Proxy = Prox;
                    }
                    getHeaders.CookieContainer = Cookies;
                    Response = (HttpWebResponse)getHeaders.GetResponse();
                    s1       = new StreamReader(Response.GetResponseStream()).ReadToEnd();
                    PRCDepost dep = json.JsonDeserialize <PRCDepost>(s1);
                    Parent.updateDeposit(dep.Address);
                }
                catch
                {
                    new System.Threading.Thread(GetDeposit).Start();
                }
                finishedlogin(true);
                return;
            }
            catch
            {
                finishedlogin(false);
                return;
            }
            finishedlogin(false);
        }