diff --git a/Attorney_Online_remake.pro b/Attorney_Online_remake.pro index d8c22a8..df3ef9c 100644 --- a/Attorney_Online_remake.pro +++ b/Attorney_Online_remake.pro @@ -13,7 +13,7 @@ RC_ICONS = logo.ico TARGET = Attorney_Online_remake TEMPLATE = app -VERSION = 2.1.2.0 +VERSION = 2.1.3.0 SOURCES += main.cpp\ lobby.cpp \ diff --git a/aoapplication.cpp b/aoapplication.cpp index 876d934..179732d 100644 --- a/aoapplication.cpp +++ b/aoapplication.cpp @@ -3,6 +3,7 @@ #include "lobby.h" #include "courtroom.h" #include "networkmanager.h" +#include "debug_functions.h" #include #include @@ -117,6 +118,16 @@ void AOApplication::add_favorite_server(int p_server) write_to_serverlist_txt(server_line); } +void AOApplication::server_disconnected() +{ + if (courtroom_constructed) + { + call_notice("Disconnected from server."); + construct_lobby(); + destruct_courtroom(); + } +} + void AOApplication::loading_cancelled() { destruct_courtroom(); diff --git a/aoapplication.h b/aoapplication.h index 6a10ff5..d1c3959 100644 --- a/aoapplication.h +++ b/aoapplication.h @@ -117,7 +117,7 @@ public: private: const int RELEASE = 2; const int MAJOR_VERSION = 1; - const int MINOR_VERSION = 2; + const int MINOR_VERSION = 3; QString user_theme = "default"; @@ -125,6 +125,7 @@ private: QVector favorite_list; public slots: + void server_disconnected(); void loading_cancelled(); }; diff --git a/networkmanager.cpp b/networkmanager.cpp index e0967f0..406c957 100644 --- a/networkmanager.cpp +++ b/networkmanager.cpp @@ -14,6 +14,7 @@ NetworkManager::NetworkManager(AOApplication *parent) : QObject(parent) QObject::connect(ms_socket, SIGNAL(readyRead()), this, SLOT(handle_ms_packet())); QObject::connect(server_socket, SIGNAL(readyRead()), this, SLOT(handle_server_packet())); + QObject::connect(server_socket, SIGNAL(disconnected()), ao_app, SLOT(server_disconnected())); } NetworkManager::~NetworkManager()