aboutsummaryrefslogtreecommitdiff
path: root/include/aoapplication.h
diff options
context:
space:
mode:
authorCerapter <43446478+Cerapter@users.noreply.github.com>2024-05-15 17:19:03 +0200
committerGitHub <noreply@github.com>2024-05-15 10:19:03 -0500
commit4fb61b7afd9f234492451ed34ee22c9a5ece0b7e (patch)
tree5dfa2102256149b98814d085839fdf4e894618b1 /include/aoapplication.h
parentc9eabf35dafa22f7ad7f012c23f63f1605a47668 (diff)
Lift out most server-related data into its own class (#955)
* Lift out most server-related data into its own class * Fix missing negation in the auth packet support check * Update `get_feature(BASE_FEATURE_SET)`'s documentation * Make the version numbers public * Add support for custom blips --------- Co-authored-by: in1tiate <32779090+in1tiate@users.noreply.github.com>
Diffstat (limited to 'include/aoapplication.h')
-rw-r--r--include/aoapplication.h65
1 files changed, 16 insertions, 49 deletions
diff --git a/include/aoapplication.h b/include/aoapplication.h
index 43ed559e..2b79f6ef 100644
--- a/include/aoapplication.h
+++ b/include/aoapplication.h
@@ -1,11 +1,12 @@
#ifndef AOAPPLICATION_H
#define AOAPPLICATION_H
-#include "widgets/aooptionsdialog.h"
#include "aopacket.h"
#include "datatypes.h"
#include "demoserver.h"
#include "discord_rich_presence.h"
+#include "serverdata.h"
+#include "widgets/aooptionsdialog.h"
#include "bass.h"
@@ -87,51 +88,31 @@ public:
qint64 latency = 0;
QString window_title;
- /////////////////server metadata//////////////////
-
- bool yellow_text_supported = false;
- bool prezoom_supported = false;
- bool flipping_supported = false;
- bool custom_objection_supported = false;
- bool desk_mod_supported = false;
- bool evidence_supported = false;
- bool cccc_ic_supported = false;
- bool arup_supported = false;
- bool casing_alerts_supported = false;
- bool modcall_reason_supported = false;
- bool looping_sfx_supported = false;
- bool additive_supported = false;
- bool effects_supported = false;
- bool y_offset_supported = false;
- bool expanded_desk_mods_supported = false;
- bool auth_packet_supported = false;
- bool custom_blips_supported = false;
+ /// Stores everything related to the server the client is connected to, if
+ /// any.
+ server::ServerData m_serverdata;
///////////////loading info///////////////////
// client ID. Not useful, to be removed eventually
int client_id = 0;
- QString server_software = "";
-
- int char_list_size = 0;
- int loaded_chars = 0;
+ /// Used for a fancy loading bar upon joining a server.
int generated_chars = 0;
- int evidence_list_size = 0;
- int loaded_evidence = 0;
- int music_list_size = 0;
- int loaded_music = 0;
bool courtroom_loaded = false;
- //////////////////versioning///////////////
-
- int get_release() const { return RELEASE; }
- int get_major_version() const { return MAJOR_VERSION; }
- int get_minor_version() const { return MINOR_VERSION; }
- QString get_version_string();
+ /**
+ * @brief Returns the version string of the software.
+ *
+ * @return The string "X.Y.Z", where X is the release of the software (usually
+ * '2'), Y is the major version, and Z is the minor version.
+ */
+ static QString get_version_string();
- ///////////////////////////////////////////
+ static const int RELEASE = 2;
+ static const int MAJOR_VERSION = 10;
+ static const int MINOR_VERSION = 1;
// Adds the server to favorite_servers.ini
void add_favorite_server(int p_server);
@@ -365,16 +346,6 @@ public:
// The file name of the log file in base/logs.
QString log_filename;
- /**
- * @brief A QString of an URL that defines the content repository
- * send by the server.
- *
- * @details Introduced in Version 2.9.2.
- * Addresses the issue of contenturl devlivery for WebAO
- * without relying on someone adding the link manually.
- */
- QString asset_url;
-
void initBASS();
static void load_bass_plugins();
static void CALLBACK BASSreset(HSTREAM handle, DWORD channel, DWORD data,
@@ -385,10 +356,6 @@ public:
DemoServer* demo_server = nullptr;
private:
- const int RELEASE = 2;
- const int MAJOR_VERSION = 10;
- const int MINOR_VERSION = 1;
-
QVector<server_type> server_list;
QHash<uint, QString> asset_lookup_cache;
QHash<uint, QString> dir_listing_cache;