/// <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 }
/// <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(); } }
private void BtnLogout_LeftClick(object sender, EventArgs e) { if (isInGameRoom) { topBar.SwitchToPrimary(); return; } if (connectionManager.IsConnected && !UserINISettings.Instance.PersistentMode) { connectionManager.Disconnect(); } topBar.SwitchToPrimary(); }
private void BtnLogout_LeftClick(object sender, EventArgs e) { connectionManager.Disconnect(); SwitchToPrimary(); }