aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCrystalwarrior <varsash@gmail.com>2020-08-25 12:18:49 +0300
committerCrystalwarrior <varsash@gmail.com>2020-08-25 12:18:49 +0300
commitfebfbeafc11ecad57d6e9a06575c28f1b13da8da (patch)
treeed3c8bef2b605cbd9caa00c03e7422d362a95d48 /include
parentf27f210efeb13a5ac29727fef271f8249e3e8c5d (diff)
Actually make use of the completely useless CHECK and CH keepalive timer and use them to determine the client's ping.
Display ping in the application window title. keepalive timer now fires every second instead of every minute Remove meme clock starting on set_widgets() implement get_ping() on w_courtroom
Diffstat (limited to 'include')
-rw-r--r--include/aoapplication.h3
-rw-r--r--include/courtroom.h10
2 files changed, 11 insertions, 2 deletions
diff --git a/include/aoapplication.h b/include/aoapplication.h
index 60d945ec..3f5767cf 100644
--- a/include/aoapplication.h
+++ b/include/aoapplication.h
@@ -61,6 +61,9 @@ public:
void call_settings_menu();
void call_announce_menu(Courtroom *court);
+ qint64 last_ping;
+ QString window_title;
+
/////////////////server metadata//////////////////
unsigned int s_decryptor = 5;
diff --git a/include/courtroom.h b/include/courtroom.h
index 1ff74f54..0daeb2b1 100644
--- a/include/courtroom.h
+++ b/include/courtroom.h
@@ -57,7 +57,7 @@
#include <QScrollBar>
#include <QTextBoundaryFinder>
#include <QTextCharFormat>
-//#include <QRandomGenerator>
+#include <QElapsedTimer>
#include <stack>
@@ -251,6 +251,8 @@ public:
void check_connection_received();
+ qint64 get_ping() { return ping_timer.elapsed(); }
+
~Courtroom();
private:
@@ -299,11 +301,15 @@ private:
QVector<chatlogpiece> ic_chatlog_history;
- // triggers ping_server() every 60 seconds
+ // triggers ping_server() every 1 second
QTimer *keepalive_timer;
// determines how fast messages tick onto screen
QTimer *chat_tick_timer;
+
+ // count up timer to check how long it took for us to get a response from ping_server()
+ QElapsedTimer ping_timer;
+
// int chat_tick_interval = 60;
// which tick position(character in chat message) we are at
int tick_pos = 0;