Ejemplo n.º 1
0
        /// <summary>
        /// Attemps to "clean" the client session in a nice way if the user closes the game.
        /// </summary>
        private void Clean()
        {
            CUpdater.FileIdentifiersUpdated -= CUpdater_FileIdentifiersUpdated;

            if (cncnetPlayerCountCancellationSource != null)
            {
                cncnetPlayerCountCancellationSource.Cancel();
            }
            topBar.Clean();
            if (updateInProgress)
            {
                CUpdater.TerminateUpdate = true;
            }

            if (connectionManager.IsConnected)
            {
                connectionManager.Disconnect();
            }

#if YR
            try
            {
                System.IO.File.Delete(ProgramConstants.GamePath + "ddraw.dll");
            }
            catch
            {
                Logger.Log("MainMenu ** Failed to remove ddraw.dll");
            }
#endif
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Attemps to "clean" the client session in a nice way if the user closes the game.
        /// </summary>
        private void Clean()
        {
            CUpdater.FileIdentifiersUpdated -= CUpdater_FileIdentifiersUpdated;

            cncnetPlayerCountCancellationSource.Cancel();
            if (updateInProgress)
            {
                CUpdater.TerminateUpdate = true;
            }

            if (connectionManager.IsConnected)
            {
                connectionManager.Disconnect();
            }
        }
Ejemplo n.º 3
0
        private void BtnLogout_LeftClick(object sender, EventArgs e)
        {
            if (isInGameRoom)
            {
                topBar.SwitchToPrimary();
                return;
            }

            if (connectionManager.IsConnected &&
                !UserINISettings.Instance.PersistentMode)
            {
                connectionManager.Disconnect();
            }

            topBar.SwitchToPrimary();
        }
Ejemplo n.º 4
0
 private void BtnLogout_LeftClick(object sender, EventArgs e)
 {
     connectionManager.Disconnect();
     SwitchToPrimary();
 }