aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Skoland <davidskoland@gmail.com>2017-02-14 10:57:37 +0100
committerDavid Skoland <davidskoland@gmail.com>2017-02-14 10:57:37 +0100
commit8be53e96f7c6dd69b9e1530abeece177f494b440 (patch)
treed4a14bd27c8c295075c8088c2fd5f85e638b3a66
parentfd1ece1ac196e4584e78b981ba7b3dc7197a7d20 (diff)
added message when server closes the connection and incremented version to 2.1.3
-rw-r--r--Attorney_Online_remake.pro2
-rw-r--r--aoapplication.cpp11
-rw-r--r--aoapplication.h3
-rw-r--r--networkmanager.cpp1
4 files changed, 15 insertions, 2 deletions
diff --git a/Attorney_Online_remake.pro b/Attorney_Online_remake.pro
index d8c22a81..df3ef9cb 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 876d9340..179732da 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 <QDebug>
#include <QRect>
@@ -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 6a10ff5e..d1c3959b 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<server_type> favorite_list;
public slots:
+ void server_disconnected();
void loading_cancelled();
};
diff --git a/networkmanager.cpp b/networkmanager.cpp
index e0967f0b..406c957a 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()