public void Disconnect() { Message("Loader.Disconnect() called"); State = GameState.StoppingGameWindow; ConnectionLoop.Disconnect(); ConnectionLoop = null; State = GameState.InLoader; Message("Loader.Disconnect() completed"); }
public void InitiateConnectionThread() { try { Message("InitiateConnectionThread() Thread started, connecting."); ConnectionLoop = new ConnectionLoop(this); ConnectionLoop.StartConnect(_hostname, 4100, _username, _password); ConnectionLoop.Disconnect(); //ConnectionLoop = null; Message("InitiateConnectionThread() stopped after Run()"); } catch (ThreadAbortException ex) { Console.WriteLine(ex.ToString()); throw ex; } catch (Exception ex) { Console.WriteLine(ex.ToString()); if (ConnectionLoop != null) { ConnectionLoop.Disconnect(); ConnectionLoop = null; } // TODO: FixMe } Message("InitiateConnectionThread() at end"); }