aboutsummaryrefslogtreecommitdiff
path: root/src/Settings/settingstructure.h
blob: b4801647ce82d4a443ed15e5b4ab3c961f1a8811 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
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