diff options
| author | oldmud0 <oldmud0@users.noreply.github.com> | 2021-12-18 20:29:55 -0600 |
|---|---|---|
| committer | oldmud0 <oldmud0@users.noreply.github.com> | 2021-12-18 20:29:55 -0600 |
| commit | f1107aeac51658a0525d4231b2f1f39131acbcb5 (patch) | |
| tree | 02d5feabb5fe171c72b97276dd2e250d95db03e1 /include | |
| parent | b682d69e494acdbf5fc97a81109faa667ad1918f (diff) | |
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
Diffstat (limited to 'include')
| -rw-r--r-- | include/aoapplication.h | 3 | ||||
| -rw-r--r-- | include/aooptionsdialog.h | 2 | ||||
| -rw-r--r-- | include/networkmanager.h | 6 |
3 files changed, 9 insertions, 2 deletions
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<void(QString)> &cb); + void send_heartbeat(); private slots: - void heartbeat_playing(); void ms_request_finished(QNetworkReply *reply, const std::function<void()> &cb); |
