From f1107aeac51658a0525d4231b2f1f39131acbcb5 Mon Sep 17 00:00:00 2001 From: oldmud0 Date: Sat, 18 Dec 2021 20:29:55 -0600 Subject: Finish out feature - Add periodic timer for heartbeat - Add option to settings for opting out from heartbeat/player metrics - Change base URL to permanent URL --- include/aoapplication.h | 3 +++ include/aooptionsdialog.h | 2 ++ include/networkmanager.h | 6 ++++-- 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/aoapplication.h b/include/aoapplication.h index d0d5121e..1cdcbc54 100644 --- a/include/aoapplication.h +++ b/include/aoapplication.h @@ -491,6 +491,9 @@ public: // Get the default scaling method QString get_default_scaling(); + // Get whether to opt out of player count metrics sent to the master server + bool get_player_count_optout(); + // Currently defined subtheme QString subtheme; diff --git a/include/aooptionsdialog.h b/include/aooptionsdialog.h index de1a3b5c..d8ef49f5 100644 --- a/include/aooptionsdialog.h +++ b/include/aooptionsdialog.h @@ -177,6 +177,8 @@ private: QWidget *ui_privacy_tab; QVBoxLayout *ui_privacy_layout; + QCheckBox *ui_privacy_optout_cb; + QFrame *ui_privacy_separator; QTextBrowser *ui_privacy_policy; bool needs_default_audiodev(); diff --git a/include/networkmanager.h b/include/networkmanager.h index a05c5510..ebee4810 100644 --- a/include/networkmanager.h +++ b/include/networkmanager.h @@ -28,10 +28,12 @@ public: AOApplication *ao_app; QNetworkAccessManager *http; QTcpSocket *server_socket; + QTimer *heartbeat_timer; - QString ms_baseurl = "https://ms3.oldmud0.workers.dev"; + QString ms_baseurl = "https://servers.aceattorneyonline.com"; const int timeout_milliseconds = 5000; + const int heartbeat_interval = 60 * 5; bool partial_packet = false; QString temp_packet = ""; @@ -47,8 +49,8 @@ public slots: void request_document(MSDocumentType document_type, const std::function &cb); + void send_heartbeat(); private slots: - void heartbeat_playing(); void ms_request_finished(QNetworkReply *reply, const std::function &cb); -- cgit