public void Close() { ListeningToConnection = false; if (connection != null && connection.Connected) { connection.Close(); } MiddleManAPI.CloseLobby(); }
public void Close() { ListeningToConnection = false; if (connection != null && connection.Connected) { SendMessage("DISCONNECT|"); connection.Close(); } MiddleManAPI.LeaveLobby(); }
public static void AttemptReconnect() { int attempts = 0; while (!MiddleManAPI.Connect() && attempts++ < 10) { Close(); } // raise can't connect to server }