Fixed bloated connection errors in logs;

Fixed that data update tasks runs after disconnect;
This commit is contained in:
Oleg Agafonov 2019-04-12 15:38:33 +04:00
parent f81142459d
commit fe9c3fbae8
3 changed files with 18 additions and 5 deletions

View file

@ -1416,11 +1416,11 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
// USER mode, e.g. user plays and got disconnect
LOGGER.info("Disconnected from user mode");
SwingUtilities.invokeLater(() -> {
SessionHandler.disconnect(false); // user already disconnected, can't do any online actions like quite chat
setConnectButtonText(NOT_CONNECTED_TEXT);
disableButtons();
hideGames();
hideTables();
SessionHandler.disconnect(false);
if (askToReconnect) {
UserRequestMessage message = new UserRequestMessage("Connection lost", "The connection to server was lost. Reconnect to " + MagePreferences.getLastServerAddress() + "?");
message.setButton1("No", null);

View file

@ -513,6 +513,7 @@ public class TablesPanel extends javax.swing.JPanel {
public void cleanUp() {
saveGuiSettings();
chatPanelMain.cleanUp();
stopTasks();
}
public void changeGUISize() {