示例#1
0
        public void GetRSAKey(string name)
        {
            uname = name;
            NameValueCollection formData = new NameValueCollection();

            formData["username"] = uname;

            MyWeb.MyWeb     web   = new MyWeb.MyWeb();
            MyUtils.MyUtils utils = new MyUtils.MyUtils();
            string          resp  = string.Empty;

            while ((resp == string.Empty) || (resp.Contains("Error 503 Service Unavailable")) || (resp.Contains("The Steam Community is currently unavailable")))
            {
                resp = web.PostPage("https://steamcommunity.com/login/getrsakey/", formData, 0, 0, ref cookie);
                if ((resp == string.Empty) || (resp.Contains("Error 503 Service Unavailable")) || (resp.Contains("The Steam Community is currently unavailable")))
                {
                    System.Threading.Thread.Sleep(3000);
                }
            }
            ;
            string sessid = GetSessionID(resp);

            if (sessid != string.Empty)
            {
                sessionid = sessid;
            }
            if (sessionid != string.Empty)
            {
                cookie = "sessionid=" + sessionid + ";";
            }
            kmod     = utils.GetStrBetween(resp, "\"publickey_mod\":\"", "\"");
            kexp     = utils.GetStrBetween(resp, "\"publickey_exp\":\"", "\"");
            krsatime = utils.GetStrBetween(resp, "\"timestamp\":\"", "\"");
        }
示例#2
0
        public string GetSessionID(string buff)
        {
            string ret = string.Empty;

            MyUtils.MyUtils utils = new MyUtils.MyUtils();
            ret = utils.GetStrBetween(buff, "sessionid=", ";");
            if (ret == string.Empty)
            {
                ret = utils.GetStrBetween(buff, "sessionid=", ",");
            }

            //int beg, end;
            //beg = end = -1;
            //if ((cookie != string.Empty) && (cookie != null))
            //    {
            //    beg = cookie.IndexOf("sessionid=");
            //    if (beg != -1)
            //        {
            //        beg += 10;
            //        end = cookie.IndexOfAny(new char[] { ';', ',' }, beg);
            //        if (end == -1)
            //            ret = cookie.Substring(beg);
            //        else
            //            ret = cookie.Substring(beg, end - beg);
            //        }
            //    }
            return(ret);
        }
示例#3
0
        public void GetAdminStats(ref string paid, ref string free, ref string totalinvites)
        {
            MyWeb.MyWeb web  = new MyWeb.MyWeb();
            string      resp = string.Empty;

            resp = web.GetWebPage(urlactiveusers, 0, 0);
            MyUtils.MyUtils utils = new MyUtils.MyUtils();
            string          ret   = utils.GetStrBetween(resp, "<h3>Active users: ", "</h3>");

            ret = ret.Replace(" ", string.Empty);
            if ((ret == string.Empty) || (ret == " "))
            {
                ret = "0";
            }
            paid = ret;

            ret = utils.GetStrBetween(resp, "<h3>Active free users: ", "</h3>");
            ret = ret.Replace(" ", string.Empty);
            if ((ret == string.Empty) || (ret == " "))
            {
                ret = "0";
            }
            free = ret;

            ret = utils.GetStrBetween(resp, "<h3>Global Invites Sent: ", "</h3>");
            ret = ret.Replace(" ", string.Empty);
            if ((ret == string.Empty) || (ret == " "))
            {
                ret = "0";
            }
            totalinvites = ret;
        }
示例#4
0
        public void GetDetailsMinimal( )
        {
            MyWeb.MyWeb     myweb = new MyWeb.MyWeb( );
            MyUtils.MyUtils utils = new MyUtils.MyUtils( );

            string post = string.Empty;

            while (post == string.Empty)
            {
                post = myweb.GetWebPage(link, 0, 0);
                if (post == string.Empty)
                {
                    System.Threading.Thread.Sleep(3000);
                }
                else
                {
                    break;
                }
            }

            string tmp = utils.GetStrBetween(post, "<steamID64>", "</steamID64>");

            tmp = tmp.Replace(Environment.NewLine, string.Empty);
            if (tmp != string.Empty)
            {
                id = tmp;
            }

            tmp = utils.GetStrBetween(post, "<customURL>", "</customURL>");
            tmp = utils.GetStrBetween(tmp, "<", ">");
            int beg, end;

            beg = end = -1;
            if (tmp != string.Empty)
            {
                beg = tmp.LastIndexOf("[");
                end = tmp.IndexOf("]");
                if ((beg != -1) && (end != -1) && ((end - beg) >= 0))
                {
                    url = tmp.Substring(beg + 1, end - beg - 1);
                }
            }

            tmp = utils.GetStrBetween(post, "<steamID>", "</steamID>");
            tmp = utils.GetStrBetween(tmp, "<", ">");
            beg = end = -1;
            if (tmp != string.Empty)
            {
                beg = tmp.LastIndexOf("[");
                end = tmp.IndexOf("]");
                if ((beg != -1) && (end != -1) && ((end - beg) >= 0))
                {
                    name = tmp.Substring(beg + 1, end - beg - 1);
                }
            }

            //groups.Clear( );
            //groupurls.Clear( );
        }
示例#5
0
        private void DonateClicked(Constants.DonateType dtype, bool ispaypal)
        {
            Gator25.PayPalWindow paypal = new Gator25.PayPalWindow();
            if (ispaypal == true)
            {
                string pcode = string.Empty;
                if (cboPaypalRates1.SelectedIndex != -1)
                {
                    string          tmp   = cboPaypalRates1.SelectedItem.ToString();
                    MyUtils.MyUtils utils = new MyUtils.MyUtils();

                    //$100.00 OR 1000 Points = 400 Days (75% Savings!)

                    string amnt = utils.GetStrBetween(tmp, "$", " ");
                    string days = utils.GetStrBetween(tmp, " = ", " ");
                    pcode = price.GetPaypalCode(amnt, days);
                    paypal.DisplayPaypal(pcode);
                }
            }
            else
            {
                paypal.DisplayGoogle(dtype);
            }

            //string reqfile = string.Empty;
            //GGDisk disk = new GGDisk();
            //switch (dtype)
            //    {
            //    case Constants.DonateType.Donate1:
            //        reqfile = disk.filedonator1;
            //        break;
            //    case Constants.DonateType.Donate2:
            //        reqfile = disk.filedonator2;
            //        break;
            //    case Constants.DonateType.Donate3:
            //        reqfile = disk.filedonator3;
            //        break;
            //    case Constants.DonateType.Donate4:
            //        reqfile = disk.filedonator4;
            //        break;
            //    case Constants.DonateType.Donate5:
            //        reqfile = disk.filedonator5;
            //        break;
            //    case Constants.DonateType.Donate6:
            //        reqfile = disk.filedonator6;
            //        break;
            //    }
            //if (File.Exists(reqfile))
            //    {
            //    try
            //        {
            //        System.Diagnostics.Process.Start(reqfile);
            //        }
            //    catch (Exception ex)
            //        {
            //        Log("Exception in donate : " + ex.Message.ToString(), Constants.LogMsgType.Error, true);
            //        }
            //    }
        }
示例#6
0
        public void WritePlayerGroupStats(Profile profile)
        {
            string buff = string.Empty;

            buff = Read(filetogrps);
            string toadd  = string.Empty;
            string strbeg = string.Empty;
            string strcur = string.Empty;

            for (int i = 0; i < profile.player.groups.Count; i++)
            {
                //string chk = "<GID>" + profile.player.groups[i].ToString() + "</GID>";
                string chk = "<GURL>" + profile.player.groups[i].ToString() + "</GURL>";
                if (buff.Contains(chk))
                {
                    MyUtils.MyUtils utils   = new MyUtils.MyUtils();
                    string          replace = utils.GetStrBetween(buff, chk, "</NCUR>");
                    if (replace != string.Empty)
                    {
                        replace = chk + replace + "</NCUR>";
                        strbeg  = utils.GetStrBetween(replace, "<NBEG>", "</NBEG>");
                        //strcur = utils.GetStrBetween(replace, "<NCUR>", "</NCUR>");
                        //Group grp = new Group(profile.player.groups[i].ToString(), Constants.GroupInitType.groupid);
                        Group grp = new Group(profile.player.groups[i].ToString(), Constants.GroupInitType.groupurl);
                        strcur = grp.total.ToString();
                        if ((grp.url != string.Empty) && (grp.url != ""))
                        {
                            toadd = chk + "<GURL>" + grp.url + "</GURL>";
                            toadd = toadd + "<NBEG>" + strbeg + "</NBEG>";
                            toadd = toadd + "<NCUR>" + strcur + "</NCUR>";
                            buff  = buff.Replace(replace, toadd);
                        }
                    }
                }
                else
                {
                    //Group grp = new Group(profile.player.groups[i].ToString(), Constants.GroupInitType.groupid);
                    Group grp = new Group(profile.player.groups[i].ToString(), Constants.GroupInitType.groupurl);
                    strcur = grp.total.ToString();
                    strcur = strcur.Replace(",", string.Empty);
                    strbeg = strcur;
                    if ((grp.url != string.Empty) && (grp.url != ""))
                    {
                        toadd = chk + "<GURL>" + grp.url + "</GURL>";
                        toadd = toadd + "<NBEG>" + strbeg + "</NBEG>";
                        toadd = toadd + "<NCUR>" + strcur + "</NCUR>";
                        buff  = buff + toadd;
                    }
                }
                System.Threading.Thread.Sleep(500);
            }
            Write(buff, filetogrps);
        }
示例#7
0
        public ServerData CheckUsage()
        {
            //uniqueid
            //#IREM#1000#/IREM##GREM#1000#/GREM##TREM#0#/TREM#GroupGatorv2.5
            NameValueCollection nvm = new NameValueCollection();

            nvm.Clear();
            nvm["uniqueid"] = mid;

            MyWeb.MyWeb web  = new MyWeb.MyWeb();
            string      resp = string.Empty;

            while (!resp.Contains("GroupGatorv2.5"))
            {
                resp = web.PostPage(urlchkusg, nvm, 0, 0);
                if (!resp.Contains("GroupGatorv2.5"))
                {
                    System.Threading.Thread.Sleep(2000);
                }
            }
            MyUtils.MyUtils utils = new MyUtils.MyUtils();
            string          i     = utils.GetStrBetween(resp, "#IREM#", "#/IREM#");
            string          g     = utils.GetStrBetween(resp, "#GREM#", "#/GREM#");
            string          t     = utils.GetStrBetween(resp, "#TREM#", "#/TREM#");
            ServerData      sdata = new ServerData();

            try
            {
                sdata.iremain = Convert.ToInt32(i);
            }
            catch (Exception ex)
            {
                sdata.iremain = 0;
            }
            try
            {
                sdata.gremain = Convert.ToInt32(g);
            }
            catch (Exception ex)
            {
                sdata.gremain = 0;
            }
            try
            {
                sdata.tremain = Convert.ToInt32(t);
            }
            catch (Exception ex)
            {
                sdata.tremain = 0;
            }
            return(sdata);
        }
示例#8
0
        public string UpdateGlobalInviteCount(int icur)
        {
            string resp             = string.Empty;
            string ret              = string.Empty;
            NameValueCollection nvm = new NameValueCollection( );

            nvm.Clear( );
            nvm["iadd"] = icur.ToString( );
            MyWeb.MyWeb web = new MyWeb.MyWeb();
            while (resp == string.Empty)
            {
                resp = web.PostPage(urlglobal, nvm, 0, 0);
                if (resp == string.Empty)
                {
                    System.Threading.Thread.Sleep(2000);
                }
                else
                {
                    break;
                }
            }
            MyUtils.MyUtils utils = new MyUtils.MyUtils( );
            ret = utils.GetStrBetween(resp, "{TOTAL}", "{/TOTAL}");

            return(ret);
        }
示例#9
0
        public Constants.ServerResponse GetTimeRemaining(string email, ref string tremain)
        {
            Constants.ServerResponse ret = Constants.ServerResponse.Failed;
            tremain = "0";
            NameValueCollection nvm = new NameValueCollection();

            nvm.Clear();
            nvm["email"] = email;
            MyWeb.MyWeb web  = new MyWeb.MyWeb();
            string      resp = string.Empty;

            while (resp == string.Empty)
            {
                resp = web.PostPage(urlgettime, nvm, 0, 0);
                if (resp == string.Empty)
                {
                    System.Threading.Thread.Sleep(2000);
                }
            }
            if (resp.Contains("agettime:fail"))
            {
                ret = Constants.ServerResponse.Failed;
            }
            else if (resp.Contains("agettime:succss"))
            {
                ret = Constants.ServerResponse.Success;
                MyUtils.MyUtils utils = new MyUtils.MyUtils();
                tremain = utils.GetStrBetween(resp, "rem{", "}");
                tremain = tremain.Replace(",", string.Empty);
            }
            return(ret);
        }
示例#10
0
        public int GetGatorPointsUsed(string ggemail)
        {
            int ret = 0;

            NameValueCollection nvm = new NameValueCollection( );

            nvm.Clear( );
            nvm["email"] = ggemail;
            MyWeb.MyWeb web  = new MyWeb.MyWeb( );
            string      resp = string.Empty;

            while (resp == string.Empty)
            {
                resp = web.PostPage(urlggptsqry, nvm, 0, 0);
                if (resp == string.Empty)
                {
                    System.Threading.Thread.Sleep(2000);
                }
            }
            MyUtils.MyUtils utils = new MyUtils.MyUtils();
            string          tmp   = utils.GetStrBetween(resp, "{USED}", "{/USED}");

            try
            {
                ret = Convert.ToInt32(tmp);
            }
            catch (Exception ex)
            {
                ret = 0;
            }

            ret *= 10;
            return(ret);
        }
示例#11
0
        public void ReadPlayerGroupStats(string gurl, ref string beg, ref string cur)
        {
            string buff = Read(filetogrps);

            beg = "0";
            cur = "0";

            if (buff.Contains("<GURL>" + gurl + "</GURL>"))
            {
                MyUtils.MyUtils utils = new MyUtils.MyUtils();
                string          block = string.Empty;
                block = utils.GetStrBetween(buff, "<GURL>" + gurl + "</GURL>", "</NCUR>");
                if (block != string.Empty)
                {
                    block = block + "</NCUR>";
                    beg   = utils.GetStrBetween(block, "<NBEG>", "</NBEG>");
                    cur   = utils.GetStrBetween(block, "<NCUR>", "</NCUR>");
                }
            }
        }
示例#12
0
        public string GetActiveUsersCount()
        {
            MyWeb.MyWeb web  = new MyWeb.MyWeb();
            string      resp = string.Empty;

            resp = web.GetWebPage(urlactiveusers, 0, 0);
            MyUtils.MyUtils utils = new MyUtils.MyUtils();
            string          ret   = utils.GetStrBetween(resp, "<h3>Active users: ", "</h3>");

            ret = ret.Replace(" ", string.Empty);
            return(ret);
        }
示例#13
0
        public string GetLastInvitee(StringBuilder list)
        {
            string ret = "-1";

            MyUtils.MyUtils utils = new MyUtils.MyUtils();
            string          tmp   = string.Empty;
            int             beg   = -1;

            beg = list.ToString().LastIndexOf("<LASTINV>");
            if (beg != -1)
            {
                tmp = list.ToString().Substring(beg);
                ret = utils.GetStrBetween(tmp, "<LASTINV>", "</LASTINV>");
            }
            return(ret);
        }
示例#14
0
        public void ChangeGroupBeginCount(string gurl, string newcount)
        {
            string chk  = "<GURL>" + gurl + "</GURL>";
            string buff = Read(filetogrps);

            if (buff.Contains(chk))
            {
                MyUtils.MyUtils utils   = new MyUtils.MyUtils();
                string          replace = utils.GetStrBetween(buff, chk, "</NBEG>");
                if (replace != string.Empty)
                {
                    replace = chk + replace + "</NBEG>";
                    string toadd = chk + "<NBEG>" + newcount + "</NBEG>";
                    buff = buff.Replace(replace, toadd);
                    Write(buff, filetogrps);
                }
            }
        }
示例#15
0
        public string GetPaypalCode(string price, string days)
        {
            string    buff = disk.Read(pricelocal);
            ArrayList temp = new ArrayList();
            string    ret  = string.Empty;

            temp = utils.GetTokensBetween(buff, "{PRICETAG}{AMOUNT}" + price + "{/AMOUNT}", "{/PRICETAG}");
            for (int i = 0; i < temp.Count; i++)
            {
                if (temp[i].ToString().Contains("{DAYS}" + days + "{/DAYS}"))
                {
                    ret = utils.GetStrBetween(buff, "{PAYPAL}", "{/PAYPAL}");
                    break;
                }
            }
            return(ret);
        }
示例#16
0
        public bool IsObsolete(string cver)
        {
            string updfile = string.Empty;

            MyUtils.MyUtils util  = new MyUtils.MyUtils();
            MyWeb.MyWeb     myweb = new MyWeb.MyWeb();
            WebService      wserv = new WebService();

            while (updfile == string.Empty)
            {
                updfile = myweb.GetWebPage(wserv.urlupdchk, 0, 0);
                System.Threading.Thread.Sleep(3000);
            }
            string over = util.GetStrBetween(updfile, "<OVER>", "</OVER>");

            cver = cver.Replace(".", string.Empty);
            over = over.Replace(".", string.Empty);


            int icver = 0;
            int iover = 0;

            try
            {
                icver = Convert.ToInt32(cver);
                iover = Convert.ToInt32(over);
            }
            catch (Exception ex)
            {
                icver = 0;
                iover = 0;
            }


            if (icver <= iover)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#17
0
        public string GetMyIp()
        {
            MyWeb.MyWeb         web = new MyWeb.MyWeb();
            NameValueCollection nvm = new NameValueCollection();

            nvm.Clear();
            nvm["uniqueid"] = mid;
            string post = web.PostPage(urlmyip, nvm, 3, 3000);
            string ret  = string.Empty;

            if (post.Contains("{user_ip:fail}"))
            {
                ret = string.Empty;
            }
            else
            {
                MyUtils.MyUtils utils = new MyUtils.MyUtils();
                ret = utils.GetStrBetween(post, "{user_ip:", "}");
            }
            return(ret);
        }
示例#18
0
        public int GetGatherTotal(StringBuilder list)
        {
            int    ret = 0;
            string tmp = string.Empty;
            string val = string.Empty;
            int    beg = list.ToString().LastIndexOf("<NTOTAL>");

            if (beg != -1)
            {
                tmp = list.ToString().Substring(beg);
                MyUtils.MyUtils utils = new MyUtils.MyUtils();
                val = utils.GetStrBetween(tmp, "<NTOTAL>", "</NTOTAL>");
                try
                {
                    ret = Convert.ToInt32(val);
                }
                catch (Exception ex)
                {
                    ret = 0;
                }
            }
            return(ret);
        }
示例#19
0
        public void LoadConfig()
        {
            GGDisk disk = new GGDisk();

            MyUtils.MyUtils utils     = new MyUtils.MyUtils();
            string          buff      = disk.Read(disk.filecfg);
            string          stridelay = string.Empty;
            string          strfdelay = string.Empty;
            string          strmiph   = string.Empty;

            if (buff.Length != 0)
            {
                string invitedelay     = string.Empty;
                string invitefaildelay = string.Empty;
                string gatherpref      = string.Empty;

                uname      = utils.GetStrBetween(buff, "<STNAME>", "</STNAME>");
                upass      = utils.GetStrBetween(buff, "<STPASS>", "</STPASS>");
                gatherpref = utils.GetStrBetween(buff, "<GPREF>", "</GPREF>");
                stridelay  = utils.GetStrBetween(buff, "<IWAIT>", "</IWAIT>");
                strfdelay  = utils.GetStrBetween(buff, "<FWAIT>", "</FWAIT>");
                string tmp = utils.GetStrBetween(buff, "<RNDFAILON>", "</RNDFAILON>");
                if (tmp == "0")
                {
                    israndomdelayon = false;
                }
                else
                {
                    israndomdelayon = true;
                }
                strmiph    = utils.GetStrBetween(buff, "<MIPH>", "</MIPH>");
                gatoremail = utils.GetStrBetween(buff, "<GGNAME>", "</GGNAME>");
                gatorpass  = utils.GetStrBetween(buff, "<GGPASS>", "</GGPASS>");
                sessid     = utils.GetStrBetween(buff, "<SESSID>", "</SESSID>");
                string nti  = utils.GetStrBetween(buff, "<INVTOTAL>", "</INVTOTAL>");;
                string ntbl = utils.GetStrBetween(buff, "<BLTOTAL>", "</BLTOTAL>");;


                try
                {
                    ntotalblacklist = Convert.ToInt32(ntbl);
                    ntotalinvite    = Convert.ToInt32(nti);
                }
                catch (Exception ex)
                {
                    ntotalinvite    = 0;
                    ntotalblacklist = 0;
                }

                if (gatherpref == string.Empty)
                {
                    gatherpref = "6";
                }
                try
                {
                    gpref = Convert.ToInt32(gatherpref);
                }
                catch (Exception ex)
                {
                    gpref = 6;
                }
                try
                {
                    miph = Convert.ToInt32(strmiph);
                }
                catch (Exception ex)
                {
                    miph = 100;
                }

                try
                {
                    idelay = Convert.ToInt32(stridelay);
                }
                catch (Exception ex)
                {
                    idelay = 18;
                }

                try
                {
                    fdelay = Convert.ToInt32(strfdelay);
                }
                catch (Exception ex)
                {
                    fdelay = 0;
                }
            }
        }
示例#20
0
 private void LoadForEdit()
 {
     if (price != null)
     {
         string buff = string.Empty;
         buff = cboPriceEdit.Text;
         if (buff != string.Empty)
         {
             //$100.00 OR 1000 Points = 400 Days (75% Savings!)
             int beg, end;
             beg = end = -1;
             beg = 1;
             end = buff.IndexOf(" ");
             txtSetPrice.Text = buff.Substring(beg, end - beg);
             beg                = end + " OR ".Length;
             end                = buff.IndexOf(" ", beg);
             txtSetGP.Text      = buff.Substring(beg, end - beg);
             beg                = end + " Points = ".Length;
             end                = buff.IndexOf(" ", beg);
             txtSetDays.Text    = buff.Substring(beg, end - beg);
             beg                = end + " Days (".Length;
             end                = buff.IndexOf("%", beg);
             txtSetSavings.Text = buff.Substring(beg, end - beg);
             string tmp  = string.Empty;
             GGDisk disk = new GGDisk();
             tmp = disk.Read(price.pricelocal);
             if (tmp == string.Empty)
             {
                 price.GetAll();
                 tmp = disk.Read(price.pricelocal);
             }
             if (tmp != string.Empty)
             {
                 //"{PRICETAG}{AMOUNT}{/AMOUNT}){GP}{/GP}{PROMO}{/PROMO}{DAYS}{/DAYS}{PAYPAL}{/PAYPAL}{SAVE}{/SAVE}{/PRICETAG}
                 MyUtils.MyUtils utils = new MyUtils.MyUtils();
                 //string ppal = utils.GetStrBetween(tmp, "{/PROMO}{DAYS}" + txtSetDays.Text + "{/DAYS}{PAYPAL}", "{/PAYPAL}");
                 //txtSetPayPal.Text = price.GetPaypalCode( txtSetDays.Text );//, txtSetDays.Text);
                 txtSetPayPal.Text = utils.GetStrBetween(tmp, "{DAYS}" + txtSetDays.Text + "{/DAYS}{PAYPAL}", "{/PAYPAL}");
                 string promo = utils.GetStrBetween(tmp, "{PROMO}", "{/PROMO}{DAYS}" + txtSetDays.Text + "{/DAYS}{PAYPAL}");
                 if (promo == "0 ")
                 {
                     optNo.Checked = true;
                 }
                 else
                 {
                     optYes.Checked = true;
                 }
             }
             string txt1 = "$" + txtSetPrice.Text + " = " + txtSetDays.Text + " Days (" + txtSetSavings.Text + "% Savings!)";
             if (txtSetSavings.Text == "0")
             {
                 txt1 = "$" + txtSetPrice.Text + " = " + txtSetDays.Text + " Days (" + txtSetSavings.Text + "Trail Price)";
             }
             string txt2 = txtSetGP.Text + "GP = " + txtSetDays.Text + " Days";
             txtPaypalEdit.Text = txt1;
             txtGPEdit.Text     = txt2;
             //lblPayment1.Text = txt1;
             //lblPayment2.Text = txt2;
         }
     }
 }
示例#21
0
        public void GetDetails()
        {
            MyWeb.MyWeb     myweb = new MyWeb.MyWeb();
            MyUtils.MyUtils utils = new MyUtils.MyUtils();

            string post = string.Empty;

            while (post == string.Empty)
            {
                post = myweb.GetWebPage(link, 0, 0);
                if (post == string.Empty)
                {
                    System.Threading.Thread.Sleep(3000);
                }
                else
                {
                    break;
                }
            }

            string tmp = utils.GetStrBetween(post, "<steamID64>", "</steamID64>");

            tmp = tmp.Replace(Environment.NewLine, string.Empty);
            if (tmp != string.Empty)
            {
                id = tmp;
            }

            tmp = utils.GetStrBetween(post, "<customURL>", "</customURL>");
            tmp = utils.GetStrBetween(tmp, "<", ">");
            int beg, end;

            beg = end = -1;
            if (tmp != string.Empty)
            {
                beg = tmp.LastIndexOf("[");
                end = tmp.IndexOf("]");
                if ((beg != -1) && (end != -1) && ((end - beg) >= 0))
                {
                    url = tmp.Substring(beg + 1, end - beg - 1);
                }
            }

            tmp = utils.GetStrBetween(post, "<steamID>", "</steamID>");
            tmp = utils.GetStrBetween(tmp, "<", ">");
            beg = end = -1;
            if (tmp != string.Empty)
            {
                beg = tmp.LastIndexOf("[");
                end = tmp.IndexOf("]");
                if ((beg != -1) && (end != -1) && ((end - beg) >= 0))
                {
                    name = tmp.Substring(beg + 1, end - beg - 1);
                }
            }

            groups.Clear();
            groups = utils.GetTokensBetween(post, "<groupID64>" + Environment.NewLine, Environment.NewLine + "</groupID64>");
            if (groups.Count == 0)
            {
                groups = utils.GetTokensBetween(post, "<groupID64>", "</groupID64>");
            }

            ArrayList arrltmp = new ArrayList();

            arrltmp.Clear();
            for (int i = 0; i < groups.Count; i++)
            {
                Group grp = new Group(groups[i].ToString(), Constants.GroupInitType.groupid);
                arrltmp.Add(grp.url);
                //string strcnt = grp.total.ToString();
            }
            groups.Clear();
            groups = arrltmp;
        }
示例#22
0
        private void PluginWindow_Load(object sender, EventArgs e)
        {
            this.Text = capt;
            //label1.Text = capt;

            //"<GGID>" + txtDBName.Text + "</GGID><GGPASS>" + txtDBPass.Text + "</GGPASS>";
            //towrite = towrite + "<LIC>PAID</LIC>";
            //disk.Write(towrite, disk.filedbdetails);

            GGDisk disk = new GGDisk();

            MyUtils.MyUtils utils = new MyUtils.MyUtils();
            string          buff  = disk.Read(disk.filedbdetails);

            usr  = utils.GetStrBetween(buff, "<GGID>", "</GGID>");
            pass = utils.GetStrBetween(buff, "<GGPASS>", "</GGPASS>");
            if (buff.Contains("<LIC>DEMO</LIC>"))
            {
                lic = Constants.SoftLicense.Demo;
                usr = "******";
            }
            else
            {
                FingerPrint fp  = new FingerPrint();
                string      mid = fp.GetComuputerID();

                WebService            serv  = new WebService();
                WebService.ServerData sdata = new WebService.ServerData();
                sdata.email    = usr;
                sdata.pass     = pass;
                sdata.hid      = mid;
                sdata.lockcomp = "false";
                Constants.ServerResponse resp = serv.Login(sdata);
                lic = Constants.SoftLicense.Demo;

                if (resp == Constants.ServerResponse.Valid)
                {
                    lic = Constants.SoftLicense.Paid;
                }
                else
                {
                    lic = Constants.SoftLicense.Demo;
                }
            }

            if (lic == Constants.SoftLicense.Demo)
            {
                lblUserMail1.Text = "*****@*****.**";
            }
            else
            {
                lblUserMail1.Text = usr;
            }


            ThreadStart tsSK = new ThreadStart(SideKick);
            Thread      tSK  = new Thread(tsSK);

            tSK.IsBackground = true;
            tSK.Start( );
        }
示例#23
0
        public Constants.AvailableUpdate IsUpdateAvailable(ref string loc)
        {
            string updfile = string.Empty;

            MyUtils.MyUtils util  = new MyUtils.MyUtils();
            MyWeb.MyWeb     myweb = new MyWeb.MyWeb();
            WebService      wserv = new WebService();

            while (updfile == string.Empty)
            {
                updfile = myweb.GetWebPage(wserv.urlupdchk, 0, 0);
                System.Threading.Thread.Sleep(3000);
            }
            lcv  = util.GetStrBetween(updfile, "<TYPEC>", "</TYPEC>");
            lcf  = util.GetStrBetween(updfile, "<CFILE>", "</CFILE>");
            lncv = util.GetStrBetween(updfile, "<TYPENC>", "</TYPENC>");
            lncf = util.GetStrBetween(updfile, "<NCFILE>", "</NCFILE>");
            cv   = cv.Replace(".", string.Empty);
            lncv = lncv.Replace(".", string.Empty);
            lcv  = lcv.Replace(".", string.Empty);

            int icv   = 0;
            int ilncv = 0;
            int ilcv  = 0;

            try
            {
                icv   = Convert.ToInt32(cv);
                ilncv = Convert.ToInt32(lncv);
                ilcv  = Convert.ToInt32(lcv);
            }
            catch (Exception ex)
            {
                icv   = 0;
                ilncv = 0;
                ilcv  = 0;
            }

            Constants.AvailableUpdate ret = Constants.AvailableUpdate.NoUpdate;

            if (icv > ilcv)
            {
                ret = Constants.AvailableUpdate.NoUpdate;
                if (ilncv > icv)
                {
                    ret = Constants.AvailableUpdate.NonCritical;
                    loc = lncf;
                }
            }
            else if (icv == ilcv)
            {
                if (ilncv > icv)
                {
                    loc = lncf;
                    ret = Constants.AvailableUpdate.NonCritical;
                }
            }
            else if (icv < ilcv)
            {
                ret = Constants.AvailableUpdate.Critical;
                if (ilncv >= ilcv)
                {
                    loc = lncf;
                }
                else
                {
                    loc = lcf;
                }
            }

            return(ret);
        }
示例#24
0
        private void AuthProc()
        {
            gt.lblLoginStatus.Text = "AUTHENTICATING";
            gt.lblLoginStatus.Refresh();
            NameValueCollection formData = new NameValueCollection();

            formData.Clear();
            formData["username"]     = uname;
            formData["password"]     = encpwd;
            formData["emailauth"]    = emailauth;
            formData["captchagid"]   = captchaid;
            formData["captcha_text"] = captchatxt;
            formData["emailsteamid"] = emailsteamid;
            formData["rsatimestamp"] = krsatime;

            MyWeb.MyWeb web  = new MyWeb.MyWeb();
            string      resp = string.Empty;

            while ((resp == string.Empty) || (resp.Contains("Error 503 Service Unavailable")) || (resp.Contains("The Steam Community is currently unavailable")))
            {
                resp = web.PostPage("https://steamcommunity.com/login/dologin/", formData, 0, 0, ref cookie);
                if ((resp == string.Empty) || (resp.Contains("Error 503 Service Unavailable")) || (resp.Contains("The Steam Community is currently unavailable")))
                {
                    System.Threading.Thread.Sleep(3000);
                }
            }
            ;

            string sessid = GetSessionID(resp);

            if (sessid != string.Empty)
            {
                sessionid = sessid;
            }
            if (sessionid != string.Empty)
            {
                cookie = "sessionid=" + sessionid + ";";
            }
//sessionid=NTY4MjAzNjI3; Steam_Language=english; timezoneOffset=19800,0; steamLogin=76561198060247951%7C%7CB758FED3E08631A1A8468DCD27508C49E0CA4EBD


            MyUtils.MyUtils utils = new MyUtils.MyUtils();
            if (resp.Contains("\"message\":\"Incorrect login\""))
            {
                status = Constants.SignInStatus.Failed;
            }

            if (resp.Contains("login_complete\":true"))
            {
                //{"success":true,"login_complete":true,"transfer_url":"https:\/\/store.steampowered.com\/\/login\/transfer","transfer_parameters":{"steamid":"76561198060247951","token":"4A932916A0F2FC5D1E14EC141545E5758153BFD6"}}
                ///////
//              Cache-Control: no-cache
                //Pragma: no-cache
                //Set-Cookie: steamLogin=76561198060247951%7C%7CB758FED3E08631A1A8468DCD27508C49E0CA4EBD; path=/
                //Set-Cookie: steamMachineAuth76561198060247951=DB9DA53AC036A06AC4D80E5409DADB21088D3991; expires=Fri, 15-Jul-2022 18:12:35 GMT; path=/; secure; httponly
                //Content-Length: 267
                //Connection: close
                //Content-Type: application/json; charset=utf-8
                //{"success":true,"login_complete":true,"transfer_url":"https:\/\/store.steampowered.com\/\/login\/transfer","transfer_parameters":{"steamid":"76561198060247951","token":"B758FED3E08631A1A8468DCD27508C49E0CA4EBD","webcookie":"DB9DA53AC036A06AC4D80E5409DADB21088D3991"}}
//                ////////
                transurl  = utils.GetStrBetween(resp, "\"transfer_url\":\"", "\"");
                transurl  = transurl.Replace("\\", string.Empty);
                steamid   = utils.GetStrBetween(resp, "steamid\":\"", "\"");
                token     = utils.GetStrBetween(resp, "token\":\"", "\"");
                webcookie = utils.GetStrBetween(resp, "webcookie\":\"", "\"");

                steamlogin = steamid + "%7C%7c" + token;



                //string tmpckie = string.Empty;
                if (sessionid == string.Empty)
                {
                    //web.GetWebPage("http://steamcommunity.com/profiles/" + steamid + "/?xml=1", 3, 5000, ref tmpckie);
                    resp   = web.GetWebPage("http://steamcommunity.com/profiles/" + steamid + "/?xml=1", 3, 5000);
                    sessid = string.Empty;
                    sessid = GetSessionID(resp);
                    if (sessid != string.Empty)
                    {
                        sessionid = sessid;
                    }
                    //int beg, end;
                    //beg = end = -1;
                    //if ((tmpckie != string.Empty) && (tmpckie != null))
                    //    {
                    //    beg = tmpckie.IndexOf("sessionid=");
                    //    if (beg != -1)
                    //        {
                    //        beg += 10;
                    //        end = tmpckie.IndexOfAny(new char[] { ';', ',' }, beg);
                    //        if (end == -1)
                    //            sessionid = tmpckie.Substring(beg);
                    //        else
                    //            sessionid = tmpckie.Substring(beg, end - beg);
                    //        }
                    //    }
                }

                if (transurl != string.Empty)
                {
                    if (sessionid == string.Empty)
                    {
                        TransferLogin();
                    }
                }

                if ((steamlogin != string.Empty) && (sessionid != string.Empty))
                {
                    cookie = "sessionid=" + sessionid + ";steamLogin="******"captcha_needed\":true"))
            {
                //{"success":false,"captcha_needed":false,"captcha_gid":-1,"message":"Incorrect login."}
                //{"success":false,"captcha_needed":true,"captcha_gid":"1317542928092269974","message":"Incorrect login."}
                captchaid  = utils.GetStrBetween(resp, "captcha_gid\":\"", "\"");
                captchaurl = "https://steamcommunity.com/public/captcha.php?gid=" + captchaid;
                status     = Constants.SignInStatus.CaptchaReqd;
            }
            //{"success":false,"message":"SteamGuard","emailauth_needed":true,"emaildomain":"yahoo.com","emailsteamid":"76561198060247951"}
            if (resp.Contains("emailauth_needed\":true"))
            {
                emailsteamid = utils.GetStrBetween(resp, "emailsteamid\":\"", "\"");
                status       = Constants.SignInStatus.SGuardReqd;
            }

            authdone.Set();
        }
示例#25
0
        public string GetDetails()
        {
            MyWeb.MyWeb     myweb = new MyWeb.MyWeb();
            MyUtils.MyUtils utils = new MyUtils.MyUtils();

            string post = string.Empty;

            while (post == string.Empty)
            {
                post = myweb.GetWebPage(link, 100, 2000);
                if (post == string.Empty)
                {
                    System.Threading.Thread.Sleep(2000);
                }
                else
                {
                    break;
                }
            }
            ;

            string tmp = utils.GetStrBetween(post, "<groupID64>", "</groupID64>");

            tmp = tmp.Replace(Environment.NewLine, string.Empty);
            if (tmp != string.Empty)
            {
                id = tmp;
            }

            tmp = utils.GetStrBetween(post, "<groupName>", "</groupName>");
            tmp = utils.GetStrBetween(tmp, "<", ">");
            int beg, end;

            beg = end = -1;
            if (tmp != string.Empty)
            {
                beg = tmp.LastIndexOf("[");
                end = tmp.IndexOf("]");
                if ((beg != -1) && (end != -1) && ((end - beg) >= 0))
                {
                    name = tmp.Substring(beg + 1, end - beg - 1);
                }
            }

            tmp = utils.GetStrBetween(post, "<groupURL>", "</groupURL>");
            tmp = utils.GetStrBetween(tmp, "<", ">");
            beg = end = -1;
            if (tmp != string.Empty)
            {
                beg = tmp.LastIndexOf("[");
                end = tmp.IndexOf("]");
                if ((beg != -1) && (end != -1) && ((end - beg) >= 0))
                {
                    url = tmp.Substring(beg + 1, end - beg - 1);
                }
            }

            tmp = utils.GetStrBetween(post, "<memberCount>", "</memberCount>");
            tmp = tmp.Replace(Environment.NewLine, string.Empty);
            tmp = tmp.Replace(",", string.Empty);
            if (tmp != string.Empty)
            {
                try
                {
                    total = Convert.ToInt32(tmp);
                }
                catch (Exception ex)
                {
                    total = 0;
                }
            }

            tmp = utils.GetStrBetween(post, "<membersInGame>", "</membersInGame>");
            tmp = tmp.Replace(Environment.NewLine, string.Empty);
            tmp = tmp.Replace(",", string.Empty);
            if (tmp != string.Empty)
            {
                try
                {
                    ingame = Convert.ToInt32(tmp);
                }
                catch (Exception ex)
                {
                    ingame = 0;
                }
            }


            tmp = utils.GetStrBetween(post, "<membersOnline>", "</membersOnline>");
            tmp = tmp.Replace(Environment.NewLine, string.Empty);
            tmp = tmp.Replace(",", string.Empty);
            if (tmp != string.Empty)
            {
                try
                {
                    online = Convert.ToInt32(tmp);
                }
                catch (Exception ex)
                {
                    online = 0;
                }
            }

            tmp = utils.GetStrBetween(post, "<totalPages>", "</totalPages>");
            tmp = tmp.Replace(Environment.NewLine, string.Empty);
            tmp = tmp.Replace(",", string.Empty);
            if (tmp != string.Empty)
            {
                try
                {
                    npages = Convert.ToInt32(tmp);
                }
                catch (Exception ex)
                {
                    npages = 0;
                }
            }

            tmp = utils.GetStrBetween(post, "<members>", "</members>");
            return(tmp);
        }