added message when server closes the connection and incremented version to 2.1.3

This commit is contained in:
David Skoland 2017-02-14 10:57:37 +01:00
parent fd1ece1ac1
commit 8be53e96f7
4 changed files with 15 additions and 2 deletions

View File

@ -13,7 +13,7 @@ RC_ICONS = logo.ico
TARGET = Attorney_Online_remake TARGET = Attorney_Online_remake
TEMPLATE = app TEMPLATE = app
VERSION = 2.1.2.0 VERSION = 2.1.3.0
SOURCES += main.cpp\ SOURCES += main.cpp\
lobby.cpp \ lobby.cpp \

View File

@ -3,6 +3,7 @@
#include "lobby.h" #include "lobby.h"
#include "courtroom.h" #include "courtroom.h"
#include "networkmanager.h" #include "networkmanager.h"
#include "debug_functions.h"
#include <QDebug> #include <QDebug>
#include <QRect> #include <QRect>
@ -117,6 +118,16 @@ void AOApplication::add_favorite_server(int p_server)
write_to_serverlist_txt(server_line); 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() void AOApplication::loading_cancelled()
{ {
destruct_courtroom(); destruct_courtroom();

View File

@ -117,7 +117,7 @@ public:
private: private:
const int RELEASE = 2; const int RELEASE = 2;
const int MAJOR_VERSION = 1; const int MAJOR_VERSION = 1;
const int MINOR_VERSION = 2; const int MINOR_VERSION = 3;
QString user_theme = "default"; QString user_theme = "default";
@ -125,6 +125,7 @@ private:
QVector<server_type> favorite_list; QVector<server_type> favorite_list;
public slots: public slots:
void server_disconnected();
void loading_cancelled(); void loading_cancelled();
}; };

View File

@ -14,6 +14,7 @@ NetworkManager::NetworkManager(AOApplication *parent) : QObject(parent)
QObject::connect(ms_socket, SIGNAL(readyRead()), this, SLOT(handle_ms_packet())); 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(readyRead()), this, SLOT(handle_server_packet()));
QObject::connect(server_socket, SIGNAL(disconnected()), ao_app, SLOT(server_disconnected()));
} }
NetworkManager::~NetworkManager() NetworkManager::~NetworkManager()