From 60a301a93b6057bb2c54ac04a7c38c38389037b3 Mon Sep 17 00:00:00 2001 From: Dark1-dev Date: Wed, 1 Mar 2023 21:30:57 +0600 Subject: Add files via upload --- src/Settings/settingstructure.h | 119 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 src/Settings/settingstructure.h (limited to 'src/Settings/settingstructure.h') 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 +#include + +// 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] + 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 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 -- cgit v1.2.3