Example #1
0
        private void WorkerGame_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Cancelled)
            {
                ProcessKiller killer = new ProcessKiller();

                killer.Samp();
                killer.SanAndreas();
                killer.Host();

                Application.Exit();
                return;
            }

            workerGame.RunWorkerAsync();
        }
Example #2
0
        private void WorkerCheck_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Cancelled)
            {
                MessageTitle  title  = new MessageTitle();
                ProcessKiller killer = new ProcessKiller();

                killer.Samp();
                killer.SanAndreas();
                killer.Host();

                string message = "Greška, otkriveni su pokušaji izmjene modifikacije tokom rada.\n" +
                                 "Columbia State Launcher æe se zatovriti iz sigurnosnih razloga.\n" +
                                 "Napomena, izmjene modifikacije nisu dozvoljene od strane korisnika.";

                MessageBoxAdv.Show(message, title.ErrorMsg, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                //workerGame.CancelAsync();
                //workerHost.CancelAsync();
                Application.Exit();
                return;
            }

            workerCheck.RunWorkerAsync();
        }
Example #3
0
        private void workerLoad_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            this.Hide();
            MessageTitle title = new MessageTitle();

            if (e.Result.ToString() == ErrorResult.Work.ToString())
            {
                string text = "Instanca aplikacije Columbia State Launcher-a je veæ pokrenuta.\n" +
                              "Pokretanje više instanci nije dozvoljeno i ista neæe biti startovana.";

                MessageBoxAdv.Show(text, title.ErrorMsg, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                Application.Exit();
                return;
            }
            else if (e.Result.ToString() == ErrorResult.Service.ToString())
            {
                string text = "Prijava na servis Columbia State moda nije uspješno izvršena.\n" +
                              "Pokušajte ponovo ili evidentirajte vašu grešku na forum.";
                MessageBoxAdv.Show(text, title.ErrorMsg, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
                return;
            }
            else if (e.Result.ToString() == ErrorResult.Edit.ToString())
            {
                ProcessKiller killer = new ProcessKiller();

                killer.Samp();
                killer.SanAndreas();
                killer.Host();

                string text = "Naziv Columbia State Launcher aplikacije je neovlašteno izmjenjen!\n" +
                              "Svaka neovlaštena izmjena smatra se pokušajem nanoštenja štete istoj.\n" +
                              "Napomena, nažalost aplikacija se iz sigurnostnih razloga neæe pokrenuti.";

                MessageBoxAdv.Show(text, title.ErrorMsg, MessageBoxButtons.OK, MessageBoxIcon.Stop);

                Application.Exit();
                return;
            }
            else if (e.Result.ToString() == ErrorResult.Network.ToString())
            {
                Network net = new Network();
                MessageBoxAdv.Show(net.Error, title.ErrorMsg, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
                return;
            }
            else if (e.Result.ToString() == ErrorResult.Database.ToString())
            {
                string text = "Konekcija sa bazom podataka je neuspješna.\nKontaktirajte administratora na forumu ili pokušajte ponovo.";
                MessageBoxAdv.Show(text, title.ErrorMsg, MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
                return;
            }
            else if (e.Result.ToString() == ErrorResult.Unknown.ToString())
            {
                long size = 0;
                foreach (string file in unknownFiles)
                {
                    if (System.IO.File.Exists(file))
                    {
                        FileInfo info = new FileInfo(file);
                        size += info.Length;
                        //size += new System.IO.FileInfo(file).Length;
                    }
                }
                double total = size / 1048576.0;

                string message = String.Format("Vaša modifikacija sadrži {0} nepoznatih datoteka, velièine {1:0.00} MB.\n", unknownFiles.Count, total) +
                                 "Da li želite iste obrisati sada i nastaviti sa uèitavanem launcher-a?\n" +
                                 "Napomena, aplikacija se neæe uèitati dok postoje strane nepredviðene datoteke.";

                if (System.Windows.Forms.DialogResult.Yes == MessageBoxAdv.Show(message, title.WarningMsg, MessageBoxButtons.YesNo, MessageBoxIcon.Warning))
                {
                    try
                    {
                        foreach (string name in this.unknownFiles)
                        {
                            System.IO.File.Delete(name);
                        }

                        message = "Nepoznate datoteke su uspješno uklonjene, launcher æe se ponovo uèitati.";
                        MessageBoxAdv.Show(message, title.InfoMsg, MessageBoxButtons.OK, MessageBoxIcon.Information);
                        this.workerLoad.RunWorkerAsync();
                        return;
                    }
                    catch (Exception)
                    {
                        message = "Nepoznate datoteke nisu uspješno izbrisane, uèinite mehanièki uklanjanje!";
                        MessageBoxAdv.Show(message, title.ErrorMsg, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }

                Application.Exit();
                return;
            }
            else if (e.Result.ToString() == ErrorResult.Missed.ToString())
            {
                long size = 0;
                foreach (int id in missedFiles)
                {
                    if (System.IO.File.Exists(Launcher.Name[id]))
                    {
                        size += new System.IO.FileInfo(Launcher.Name[id]).Length;
                    }
                }

                string message = String.Format("Vašoj modifikaciji nedostaje {0} datoteka, ukupne velièine {1:0.00} MB.\n", missedFiles.Count, size / 1048576.0) +
                                 "Da li želite iste skinuti sada i nastaviti sa uèitavanem launcher-a?\n" +
                                 "Napomena, aplikacija se neæe uèitati dok sve datoteke ne budu ažurirane.";

                if (System.Windows.Forms.DialogResult.Yes == MessageBoxAdv.Show(message, title.WarningMsg, MessageBoxButtons.YesNo, MessageBoxIcon.Warning))
                {
                    DownloadForm dw = new DownloadForm();
                    foreach (int index in this.missedFiles)
                    {
                        dw.Id.Add(index);
                    }

                    if (dw.ShowDialog(this) == System.Windows.Forms.DialogResult.Abort)
                    {
                        message = "Nažalost skidanje novih datoteka nije uspješno izvršeno do kraja.\n" +
                                  "Columbia State Launcher ne može nastaviti sa daljnjim uèitavanjem.\n" +
                                  "Potražiti na forumu upustvo za pogrešku ovog tipa ili evidentirajte istu.";

                        MessageBoxAdv.Show(message, title.ErrorMsg, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        Process.Start("https://columbia-state.com/");
                        Application.Exit();
                        return;
                    }
                }
                else
                {
                    Application.Exit();
                    return;
                }
            }

            if (Launcher.Working == false)
            {
                string text = "Columbia State Server je trenutno u procesu nadogradnje, pokušajte kasnije!";
                MessageBoxAdv.Show(text, title.ErrorMsg, MessageBoxButtons.OK, MessageBoxIcon.Error);

                Application.Exit();
                return;
            }

            mainForm.Show();
        }