aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authoroldmud0 <oldmud0@users.noreply.github.com>2021-01-09 01:18:19 -0600
committeroldmud0 <oldmud0@users.noreply.github.com>2021-01-09 01:18:19 -0600
commitde3533fbf2615a40efc60c9ed2e96f1a3b5da3c1 (patch)
tree484c45a32b32a87cfa8874d53b17f00c030bab6c /include
parent610510eb7b13475f0625d69e9a8e2b1d14669198 (diff)
Rework timer and ping logic
The timer's time as received by the server is clarified to be the actual numerical time, in milliseconds, to be shown on the clock.
Diffstat (limited to 'include')
-rw-r--r--include/aoapplication.h3
-rw-r--r--include/aoclocklabel.h2
-rw-r--r--include/courtroom.h5
3 files changed, 6 insertions, 4 deletions
diff --git a/include/aoapplication.h b/include/aoapplication.h
index 3f5767c..458a884 100644
--- a/include/aoapplication.h
+++ b/include/aoapplication.h
@@ -26,6 +26,7 @@
#include <QScreen>
#include <QStringList>
#include <QTextStream>
+#include <QTime>
class NetworkManager;
class Lobby;
@@ -61,7 +62,7 @@ public:
void call_settings_menu();
void call_announce_menu(Courtroom *court);
- qint64 last_ping;
+ qint64 latency = 0;
QString window_title;
/////////////////server metadata//////////////////
diff --git a/include/aoclocklabel.h b/include/aoclocklabel.h
index b948330..b5d0794 100644
--- a/include/aoclocklabel.h
+++ b/include/aoclocklabel.h
@@ -14,7 +14,7 @@ public:
AOClockLabel(QWidget *parent);
void start();
void start(int msecs);
- void set(int msecs, bool update_text=false);
+ void set(int msecs, bool update_text = false);
void pause();
void stop();
diff --git a/include/courtroom.h b/include/courtroom.h
index 4835b0a..72b4989 100644
--- a/include/courtroom.h
+++ b/include/courtroom.h
@@ -256,11 +256,11 @@ public:
void set_clock(qint64 msecs);
void pause_clock();
void stop_clock();
+ void set_clock_visibility(bool visible);
- qint64 get_ping() { return ping_timer.elapsed(); }
+ qint64 pong();
~Courtroom();
-
private:
AOApplication *ao_app;
@@ -315,6 +315,7 @@ private:
// count up timer to check how long it took for us to get a response from ping_server()
QElapsedTimer ping_timer;
+ bool is_pinging = false;
// int chat_tick_interval = 60;
// which tick position(character in chat message) we are at