Exemplo n.º 1
0
        //    Thread thUpd;
        //    ThreadStart thUpdStart;
        //    thUpdStart = new ThreadStart(UpdateProc);
        //    thUpd = new Thread(thUpdStart);
        //    thUpd.IsBackground = true;
        //    thUpd.Start();
        //    }
        //private void UpdateProc()
        //    {
        //    do
        //        {
        //        System.Threading.Thread.Sleep(15000);
        //        player.GetDetails();
        //        } while (true);
        //    }
        public void SaveConfig()
        {
            string buff       = string.Empty;
            string gatherpref = string.Empty;

            gatherpref = gpref.ToString();


            buff = buff + "<STNAME>" + uname + "</STNAME>";
            buff = buff + "<STPASS>" + upass + "</STPASS>";
            buff = buff + "<GPREF>" + gatherpref + "</GPREF>";
            buff = buff + "<IWAIT>" + idelay.ToString() + "</IWAIT>";
            buff = buff + "<FWAIT>" + fdelay.ToString() + "</FWAIT>";
            if (israndomdelayon == true)
            {
                buff = buff + "<RNDFAILON>0</RNDFAILON>";
            }
            else
            {
                buff = buff + "<RNDFAILON>1</RNDFAILON>";
            }
            buff = buff + "<MIPH>" + miph.ToString() + "</MIPH>";
            buff = buff + "<BLTOTAL>" + ntotalblacklist.ToString() + "</BLTOTAL>";
            buff = buff + "<GGNAME>" + gatoremail + "</GGNAME>";
            buff = buff + "<GGPASS>" + gatorpass + "</GGPASS>";
            buff = buff + "<SESSID>" + sessid + "</SESSID>";
            buff = buff + "<INVTOTAL>" + ntotalinvite.ToString() + "</INVTOTAL>";
            buff = buff + "<BLTOTAL>" + ntotalblacklist.ToString() + "</BLTOTAL>";

            GGDisk disk = new GGDisk();

            disk.Write(buff, disk.filecfg);
        }
Exemplo n.º 2
0
 public Price(string adminname, string adminpass)
 {
     disk           = new GGDisk();
     web            = new MyWeb.MyWeb();
     utils          = new MyUtils.MyUtils();
     nvm            = new NameValueCollection();
     plist          = new ArrayList();
     pricelocal     = disk.dirconfig + "\\pricelist";
     pricegetremote = "http://www.groupgatorcommunity.net/GroupGator/2.5/getprice.php";
     pricesetremote = "http://www.groupgatorcommunity.net/GroupGator/2.5/setprice.php";
     uid            = adminname;
     upass          = adminpass;
     Count          = 0;
     GetAll();
 }
Exemplo n.º 3
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;
                }
            }
        }
Exemplo n.º 4
0
        private void UpdaterProc()
        {
            string remote = string.Empty;

            Constants.AvailableUpdate status = IsUpdateAvailable(ref remote);
            UpdateMessageDlg          updmsgdlg;

            Constants.UpdateResponse dlgupdresp;
            if (status == Constants.AvailableUpdate.NoUpdate)
            {
                if (type == Constants.UpdateType.Manual)
                {
                    updmsgdlg = new UpdateMessageDlg("Your version of Group Gator is latest! No new updates available", Constants.UpdateMessageType.Info);
                    updmsgdlg.Display();
                    updmsgdlg.Dispose();
                }
                checking = false;
                return;
            }
            else if (status == Constants.AvailableUpdate.NonCritical)
            {
                updmsgdlg  = new UpdateMessageDlg("A new version of GroupGator is available. Do you want to download this update?", Constants.UpdateMessageType.Question);
                dlgupdresp = updmsgdlg.Display();
                updmsgdlg.Dispose();
                if (dlgupdresp == Constants.UpdateResponse.Yes)
                {
                    GGDisk disk = new GGDisk();
                    try
                    {
                        if (File.Exists(disk.fileupd))
                        {
                            File.Delete(disk.fileupd);
                        }

                        DownloadUpdate(remote, disk.fileupd);

                        updmsgdlg  = new UpdateMessageDlg("Update downloaded! Would you like to exit GroupGator now and install this new update?", Constants.UpdateMessageType.Question);
                        dlgupdresp = updmsgdlg.Display();
                        updmsgdlg.Dispose();
                        if (dlgupdresp == Constants.UpdateResponse.Yes)
                        {
                            System.Diagnostics.Process.Start(disk.fileupd);
                            //todo freeversion update
                            Environment.Exit(0);
                        }
                    }
                    catch (Exception ex)
                    {
                        ;// log.Show(ex.Message.ToString(), 0, true);
                    }
                    finally
                    {
                        checking = false;
                    }
                }
            }
            else if (status == Constants.AvailableUpdate.Critical)
            {
                GGDisk disk = new GGDisk();
                try
                {
                    if (File.Exists(disk.fileupd))
                    {
                        File.Delete(disk.fileupd);
                    }

                    DownloadUpdate(remote, disk.fileupd);
                    updmsgdlg = new UpdateMessageDlg("CRITICAL UPDATE: GroupGATOR will now exit and apply the update.", Constants.UpdateMessageType.Info);
                    updmsgdlg.Display();
                    updmsgdlg.Dispose();

                    System.Diagnostics.Process.Start(disk.fileupd);
                    //todo freeversion update
                    Environment.Exit(0);
                }
                catch (Exception ex)
                {
                    ;
                }
                finally
                {
                    checking = false;
                }
            }

            checking = false;
        }
Exemplo n.º 5
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( );
        }
Exemplo n.º 6
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;
         }
     }
 }