public override void Login(string Username, string Password, string twofa) { HttpWebRequest getHeaders = HttpWebRequest.Create("https://betking.io/bitcoindice#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/bitcoindice#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); dicehub.On <PRCMYstats>("diceBetResult", DiceBetResult); dicehub.On <PRCResetSeed>("generateServerSeedResult", GenerateServerSeedResult); dicehub.On <PRCResetSeed>("saveClientSeedResult", SaveClientSeedResult); 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 = (decimal)tmp.AvailableBalance; profit = (decimal)tmp.Profit; wagered = (decimal)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); }
public override bool Register(string Username, string Passwrd) { HttpWebRequest getHeaders = HttpWebRequest.Create("https://pocketrocketscasino.eu/play/#account") as HttpWebRequest; if (Prox != null) { getHeaders.Proxy = Prox; } var cookies = new CookieContainer(); getHeaders.CookieContainer = cookies; 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://pocketrocketscasino.eu/account/GetUserAccount") 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(); getHeaders = HttpWebRequest.Create("https://pocketrocketscasino.eu/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", "/", "pocketrocketscasino.eu")); 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://pocketrocketscasino.eu/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://pocketrocketscasino.eu/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; getHeaders = HttpWebRequest.Create("https://pocketrocketscasino.eu/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); finishedlogin(true); return(true); } catch { finishedlogin(false); return(false); } }