Exemple #1
0
        void InstOutput(object sender, DataReceivedEventArgs e)
        {
            IMinecraftProblem prob = Problems.GetRelevantProblem(e.Data);

            if (prob != null)
            {
                string errorMsg = prob.GetErrorMessage(e.Data);

                Invoke((o, args) =>
                       MultiMC.GUI.MessageDialog.Show(this, errorMsg, "Error Detected"));
                if (prob.ShouldTerminate(e.Data) && AppSettings.Main.QuitIfProblem)
                {
                    KillMinecraft(false);
                }
            }

            Message(e.Data);
        }
Exemple #2
0
        void ScanOutput(string mcOutput)
        {
            if (mcOutput == null)
            {
                return;
            }

            bool killMC            = false;
            IMinecraftProblem prob = Problems.GetRelevantProblem(mcOutput);

            if (prob != null)
            {
                Application.Invoke(
                    (sender2, e2) =>
                {
                    if (!Visible)
                    {
                        Show();
                    }
                    else
                    {
                        GdkWindow.Raise();
                    }
                    GUI.MessageDialog.Show(this,
                                           prob.GetErrorMessage(mcOutput),
                                           "You dun goofed!");
                });
                killMC        = prob.ShouldTerminate(mcOutput) && AppSettings.Main.QuitIfProblem;
                ErrorOccurred = killMC;
            }

            if (killMC)
            {
                new Thread(() =>
                {
                    Thread.Sleep(1000);
                    if (Inst.InstProcess != null &&
                        !Inst.InstProcess.HasExited)
                    {
                        Inst.InstProcess.Kill();
                    }
                }).Start();
            }
        }