aboutsummaryrefslogtreecommitdiff
path: root/src/Settings/settingstructure.h
diff options
context:
space:
mode:
authorDark1-dev <shansarkar272@gmail.com>2023-03-01 21:30:57 +0600
committerGitHub <noreply@github.com>2023-03-01 21:30:57 +0600
commit60a301a93b6057bb2c54ac04a7c38c38389037b3 (patch)
treeb09c5f8bc0045828c660654d8ed6744663856202 /src/Settings/settingstructure.h
parentc784240d1af68dbd8d0466822b34fd05d6ccdda1 (diff)
downloadMasterserver-Qt5-60a301a93b6057bb2c54ac04a7c38c38389037b3.tar.gz
Masterserver-Qt5-60a301a93b6057bb2c54ac04a7c38c38389037b3.zip
Add files via upload
Diffstat (limited to 'src/Settings/settingstructure.h')
-rw-r--r--src/Settings/settingstructure.h119
1 files changed, 119 insertions, 0 deletions
diff --git a/src/Settings/settingstructure.h b/src/Settings/settingstructure.h
new file mode 100644
index 0000000..b480164
--- /dev/null
+++ b/src/Settings/settingstructure.h
@@ -0,0 +1,119 @@
+#ifndef SETTINGSTRUCTURE_H
+#define SETTINGSTRUCTURE_H
+
+#include <QString>
+#include <QList>
+
+// masterservers sync options
+struct SyncServer
+{
+ // domain name string, not QHostAddress
+ QString remoteAddress;
+
+ // udp port
+ unsigned short int beaconPort = 27900;
+
+ // tcp port
+ unsigned short int listenPort = 28900;
+};
+
+// cascaded struct with setting structure
+struct SettingStructure
+{
+ // initialisation check
+ bool init = false;
+
+ // log settings
+ struct LoggingSettings
+ {
+ // never, yearly, monthly, weekly, daily
+ QString cycle = "weekly";
+
+ // suppress type: [timestamp][type] <message>
+ QString suppressLog = "debug udp tcp";
+ QString suppressDisplay = "debug udp tcp";
+ }
+ LoggingSettings;
+
+ // udp beacon server settings
+ struct BeaconServerSettings
+ {
+ // default port 27900
+ unsigned short int beaconPort = 27900;
+
+ // uplink settings enabled by default
+ bool doUplink = true;
+ }
+ BeaconServerSettings;
+
+ // tcp listen server settings
+ struct ListenServerSettings
+ {
+ // default port 28900
+ unsigned short int listenPort = 28900;
+
+ // server time to live for client list
+ int serverttl_s = 1800;
+ }
+ ListenServerSettings;
+
+ // synchronisation settings (works only with 333networks-compatible masterservers)
+ struct SyncerSettings
+ {
+ // syncer settings enabled by default
+ bool doSync = true;
+
+ // sync games (which games to sync)
+ QString syncGames = "all";
+
+ // list of servers to sync
+ QList<SyncServer> syncServers;
+
+ // sync event interval
+ int syncInterval_s = 1800;
+ }
+ SyncerSettings;
+
+ // checker settings (query all individual servers to determine their state)
+ struct CheckerSettings
+ {
+ // check individual remote servers?
+ bool doCheck = true;
+
+ // get information for the website too?
+ bool getExtendedInfo = true;
+
+ // time between servers (ticker)
+ int timeServerInterval_ms = 250;
+
+ // cycle time before a reset takes place
+ int timeCheckerReset_s = 900; // every 15 minutes
+ } CheckerSettings;
+
+ // maintenance settings
+ struct MaintenanceSettings
+ {
+ // do maintenance?
+ bool doMaintenance = true;
+
+ // interval
+ int timeMaintenanceInterval_s = 300; // every 5 minutes
+ }
+ MaintenanceSettings;
+
+ // contact information
+ struct PublicInformationSettings
+ {
+ // your website, domain name, brand name or identity
+ QString hostname = "";
+
+ // your (nick)name
+ QString adminName = "";
+
+ // your e-mailaddress (format not checked, TODO)
+ QString contact = "";
+ }
+ PublicInformationSettings;
+};
+
+#endif // SETTINGSTRUCTURE_H