コード例 #1
0
        public void ApplicationProcessStopForce()
        {
            string           path   = ApplicationUtils.CreateValidExampleApplication();
            ManualResetEvent handle = new ManualResetEvent(false);

            try
            {
                using (ApplicationProcess process = new ApplicationProcess(Logger, path, Path.GetFullPath("Collar.exe")))
                {
                    process.Exited += (object sender, EventArgs e) =>
                    {
                        Assert.Fail();
                        handle.Set();
                    };

                    process.KillTimeout += (object sender, EventArgs e) =>
                    {
                        Assert.Fail();
                        handle.Set();
                    };

                    Assert.IsTrue(process.Start());
                    process.Stop(true);
                    WaitHandle.WaitAll(new WaitHandle[] { handle }, 11000);
                }
            }
            finally
            {
                handle.Close();
            }
        }
コード例 #2
0
        public void StartGameServer()
        {
            if (!IsGameServerInstalled()) // If our Game Server directory does not exist with the srcds executable in
            {
                try
                {
                    Update();
                }
                catch
                {
                    this.State = ApplicationState.Failed;
                    return;
                }
            }

            this.State       = ApplicationState.PreStart;
            IssueUpdateEvent = true;

            if (!IsGameServerInstalled())
            {
                this.State = ApplicationState.Failed;
                module.log.Warning("Rust is not installed!");
                return;
            }

            SetupProcess();
            ApplicationProcess.Start();
            SetupRCON();
            this.State = ApplicationState.Starting;
        }
コード例 #3
0
        public void ApplicationProcessStart()
        {
            string path = ApplicationUtils.CreateValidExampleApplication();

            using (ApplicationProcess process = new ApplicationProcess(Logger, path, Path.GetFullPath("Collar.exe")))
            {
                Assert.IsTrue(process.Start());
            }
        }
コード例 #4
0
        /// <summary>
        /// Start main application process if not already started.
        /// </summary>
        protected void StartApplicationProcess()
        {
            GRoggle.Write("Try starting Aida process", RoggleLogLevel.Debug);

            if (ApplicationProcess != null && ApplicationFile.Exists)
            {
                ApplicationProcess.Start();

                GRoggle.Write("Aida process started successfuly", RoggleLogLevel.Debug);
            }
            else
            {
                GRoggle.Write("There is no Aida process to start", RoggleLogLevel.Debug);
            }
        }