Пример #1
0
 private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (started)
     {
         MessageBox.Show("Please stop before changing options");
     }
     else
     {
         frmOptions frmOptions = new frmOptions(this);
         frmOptions.Show(this);
     }
 }
Пример #2
0
        private void fmrMain_Load(object sender, EventArgs e)
        {
            WritePIDFile(pidFile);

            try
            {
                iniFile = new INIFile(iniFilePath);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error accessing INI file: " + ex.Message);
                return;
            }

            LoadSettings();

            if (!Directory.Exists(basePath))
            {
                MessageBox.Show("You need to set the path to your BattlEye folder");
                frmOptions frmOptions = new frmOptions(this);
                frmOptions.Show(this);
            }

            if (!appendLogs)
            {
                // We're not appending so create/overwrite program log files
                try
                {
                    FileStream fs = new FileStream(logFileOutput, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite);
                    fs.Close();
                    fs = new FileStream(logFileDebug, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite);
                    fs.Close();
                    fs = new FileStream(logFileRCON, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite);
                    fs.Close();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(MethodBase.GetCurrentMethod().Name + " " + ex.Message);
                }
            }

            // create and start UI threads
            Thread tLinesQueued = new Thread(DoLinesQueued);
            tLinesQueued.IsBackground = true;
            tLinesQueued.Start();

            if (autoStart)
            {
                if (Start())
                {
                    started = true;
                    btnStartStop.Text = "Stop";
                    cbRewindOn.Enabled = false;
                    cbConnect.Enabled = false;
                }
            }
        }