Beispiel #1
0
        /// <summary>
        /// End process polling interval and finalise logging
        /// </summary>
        private void EndProcessListener()
        {
            try
            {
                //Stop main listener timer
                ListenerTimer.Stop();
                ListenerTimer.Dispose();
                //Stop update timer
                UpdateTimer.Stop();
                UpdateTimer.Dispose();
            }
            catch (Exception ex)
            {
                Tools.LogError(ex);
                Errors.Add("Error stopping process listener: " + ex.Message);
            }

            try
            {
                OnProcessEnd?.Invoke(this, EventArgs.Empty);
            }
            catch (Exception ex)
            {
                Tools.LogError(ex);
                Errors.Add("Error running Process End event: " + ex.Message);
            }
        }
Beispiel #2
0
        private void p_Exited(object sender, EventArgs e)
        {
            OnProcessEnd?.Invoke(this, EventArgs.Empty);

            onFinish?.Invoke(param);
            onFinish = null;
        }
Beispiel #3
0
        private async void btnLoginBulk_Click(object sender, EventArgs e)
        {
            if (OnProcessBegin != null)
            {
                OnProcessBegin.Invoke(sender, e);
            }

            CmLoginProxy.Activate();
            await LoginBulkAsync(CmLoginProxy);

            if (OnProcessEnd != null)
            {
                OnProcessEnd.Invoke(sender, e);
            }
        }
Beispiel #4
0
        /// <summary>
        /// Blocks thread until game is over.
        /// </summary>
        private void WaitForProcessToEnd()
        {
            ServerProcess.WaitForExit();

            Active        = false;
            ServerProcess = null;

            try
            {
                OnProcessEnd.Invoke(this, null);
            }
            catch
            {
            }
        }