private void Logout(bool closeAllegiance) { MainForm.SetStatusBar("Logged out"); //Stop timer CheckInTimer.Stop(); //Close Allegiance if (closeAllegiance) { AllegianceLoader.ExitAllegiance(); } //Tell the server you are logging out SessionNegotiator.Logout(false); SetLoggedIn(false); }
private static void StartMainForm() { try { do { Application.Run(new MainForm()); if (MainForm.Restart == true) { if (!ServiceHandler.CheckLogin()) { using (var loginForm = new LoginForm()) { if (loginForm.ShowDialog() != DialogResult.OK) { return; } //launcherSignInStatus = loginForm.LauncherSignInStatus; } } } } while (MainForm.Restart == true); } catch (Exception ex) { File.WriteAllText("ExceptionLog.txt", ex.ToString()); throw; } finally { if (MainForm.LoggedIn) { SessionNegotiator.Logout(true); } SystemWatcher.Close(); AllegianceLoader.ExitAllegiance(); } }