aboutsummaryrefslogtreecommitdiff
path: root/src/Protocols/overrides.h
blob: eb6f8b2bdecaeb172527e7d95e2b6485758b34b7 (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
#ifndef OVERRIDES_H
#define OVERRIDES_H

#include <QHash>
#include <QString>
#include <QRegExp>

// parse to a valid key/value pair
QString overrideKey(const QString &rawKey);

// parse to a valid gamename
QString overrideGamename(const QString &gamenameIn);

// record of gamenames that need to be overridden
const QHash<QString, QString> _validGamenames
{
    {"JetFighter IV", "jetfighter4"},
    {"igi2"         , "projectigi2r"},
};

// record of query keys that need to be overridden
const QHash<QString, QString> _validKeys
{
    {"version",    "gamever"},
    {"mingamever", "minnetver"},
    {"admin",      "adminname"},
    {"adminname",  "adminname"},
    {"admin e-mail",   "adminemail"},
    {"friendly fire",  "friendlyfire"},
    {"friendly fire?", "friendlyfire"},
    {"mapfilename",    "mapname"},
    {"mapid",          "mapname"},
    {"skill",      "botskill"},
    {"num teams",  "maxteams"},
    {"time limit", "timelimit"},
    {"time_limit", "timelimit"},
    {"timetowin",  "timelimit"},
    {"roundtime",  "timelimit"},
    {"active_mods",    "mutators"},
    {"activemod",      "mutators"},
    {"Mutator",        "mutators"},
    {"Mutator101",     "mutators"},
    {"Mutator102",     "mutators"},
    {"Mutator103",     "mutators"},
    {"Mutator104",     "mutators"},
    {"playername",    "player"},
    {"teamname",      "team"},
    {"score",         "score"},
    {"kills",         "score"},
};

// some games do not (fully) support secure/validate
const QStringList _overrideValidateBeacon
{
    "deusex",
    "rune",
    "wot",
};

const QStringList _overrideValidateClient
{
  "deusex",
  "wot",
};

// matching regexes
// TODO: replace with QRegularExpression
const QRegExp _index_match{"^(\\w+)(_\\d+)$"};

#endif // OVERRIDES_H