-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcfg.h
304 lines (251 loc) · 7.71 KB
/
cfg.h
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
#ifndef CFG
#define CFG
#include <QStringList>
#include <QDataStream>
#include <QDateTime>
namespace Ui {
class launcher;
}
// Структура данных Избранного сервера
struct favServer{
// Параметры сервера
QString serverName;
QString serverIP;
QString serverPort;
QString serverPass;
QStringList serverAddons;
bool check_name;
QString name;
// Онлайн информация о сервере
QString ping;
QString GameVersion;
QString HostName;
QString MapName;
QString GameType;
QString NumPlayers;
QString NumTeam;
QString MaxPlayers;
QString GameMode;
QString TimeLimit;
QString Password;
QString CurrentVersion;
QString RequiredVersion;
QString Mod;
QString BattleEye;
QString Longitude;
QString Latitude;
QString Mission;
int State;
// Конструктор сервера
favServer() {
serverName = "Новый сервер";
serverIP = "127.0.0.1";
serverPort = "2302";
check_name = false;
name = "";
noResponse();
}
favServer& operator=(const favServer& other) {
serverName = other.serverName;
serverIP = other.serverIP;
serverPort = other.serverPort;
serverPass = other.serverPass;
serverAddons = other.serverAddons;
check_name = other.check_name;
name = other.name;
return *this;
}
// Если нет ответа от сервера
void noResponse() {
ping.clear();
GameVersion.clear();
HostName.clear();
MapName.clear();
GameType.clear();
NumPlayers.clear();
NumTeam.clear();
MaxPlayers.clear();
GameMode.clear();
TimeLimit.clear();
Password.clear();
CurrentVersion.clear();
RequiredVersion.clear();
Mod.clear();
BattleEye.clear();
Longitude.clear();
Latitude.clear();
Mission.clear();
State = -1;
}
};
// Структура данных параметров аддона
struct addon {
QString addonName;
QString addonDir;
QString addonPath;
addon (QString aN, QString aD, QString aP) {
addonName = aN;
addonDir = aD;
addonPath = aP;
}
};
// Переменные настроек игры
struct param {
// Дополнительные параметры
QString addParam;
// Настройки игры
bool check_name;
QString name;
bool window;
bool noPause;
bool showScriptErrors;
bool noFilePatching;
bool battlEye;
// Настройки производительности
int priorityLaunch;
bool check_maxMem;
QString maxMem;
bool check_maxVRAM;
QString maxVRAM;
bool check_cpuCount;
QString cpuCount;
bool check_exThreads;
QString exThreads;
bool check_malloc;
QString malloc;
bool enableHT;
bool winxp;
bool noCB;
bool nosplash;
bool skipIntro;
bool worldEmpty;
bool noLogs;
};
// Структура данных диагностики DirectX
struct dxdiag {
/*
* SystemInformation
*/
QString OperatingSystem;
QString Processor;
QString Memory;
QString DirectXVersion;
/*
* DisplayDevice
*/
QString CardName;
QString SharedMemory;
};
// Структура репозитория
struct Repository {
QString name;
QString url;
int type;
Repository() {
name = "Новый репозиторий";
url = "";
type = 0;
}
};
// Настройки лаунчера
struct Settings {
// Стиль
int style;
bool documentMode;
// Запуск
int launch;
// Слежение за сервером
int updateTime;
int state;
// Обновления
bool checkUpdateAfterStart;
// Уведомления
bool notification;
// API Key Чат клиента Тушино
QString tushinoApiKey;
Settings() {
style = 0;
documentMode = false;
launch = 0;
updateTime = 3000;
state = 0;
checkUpdateAfterStart = true;
notification = true;
}
};
struct YomaFileInfo {
QString fileName;
qint64 fileSize;
QDateTime fileEditDate;
QString fileMD5;
bool operator==(const YomaFileInfo& other) {
return fileName == other.fileName;
}
};
struct SyncFileInfo {
QString fileName;
qint64 fileSize;
QDateTime fileEditDate;
QString fileSHA1;
bool operator==(const SyncFileInfo& other) {
return fileName == other.fileName;
}
};
/*
* Перегрузка операций добавления\изъятия данных потока.
*/
inline QDataStream & operator << ( QDataStream & out, const favServer & info ) {
out << info.serverName << info.serverIP << info.serverPort << info.serverPass << info.serverAddons << info.check_name << info.name;
return out;
}
inline QDataStream & operator >> (QDataStream &in, favServer &info) {
in >> info.serverName >> info.serverIP >> info.serverPort >> info.serverPass >> info.serverAddons >> info.check_name >> info.name;
return in;
}
inline QDataStream & operator << ( QDataStream & out, const param & info ) {
out << info.check_name << info.name << info.window << info.noPause << info.showScriptErrors << info.noFilePatching << info.priorityLaunch <<
info.check_maxMem << info.maxMem << info.check_maxVRAM << info.maxVRAM << info.check_cpuCount << info.cpuCount << info.check_exThreads <<
info.exThreads << info.check_malloc << info.malloc << info.enableHT << info.winxp << info.noCB << info.nosplash << info.skipIntro <<
info.worldEmpty << info.noLogs << info.battlEye << info.addParam;
return out;
}
inline QDataStream & operator >> (QDataStream &in, param &info) {
in >> info.check_name >> info.name >> info.window >> info.noPause >> info.showScriptErrors >> info.noFilePatching >> info.priorityLaunch >>
info.check_maxMem >> info.maxMem >> info.check_maxVRAM >> info.maxVRAM >> info.check_cpuCount >> info.cpuCount >> info.check_exThreads >>
info.exThreads >> info.check_malloc >> info.malloc >> info.enableHT >> info.winxp >> info.noCB >> info.nosplash >> info.skipIntro >>
info.worldEmpty >> info.noLogs >> info.battlEye >> info.addParam;
return in;
}
inline QDataStream & operator << ( QDataStream & out, const Repository & info ) {
out << info.name << info.url << info.type;
return out;
}
inline QDataStream & operator >> (QDataStream &in, Repository &info) {
in >> info.name >> info.url >> info.type;
return in;
}
inline QDataStream & operator << ( QDataStream & out, const Settings & info ) {
out << info.style << info.documentMode << info.launch;
return out;
}
inline QDataStream & operator >> (QDataStream &in, Settings &info) {
in >> info.style >> info.documentMode >> info.launch;
return in;
}
inline QDataStream & operator << ( QDataStream & out, const YomaFileInfo & info ) {
out << info.fileName << info.fileSize << info.fileEditDate << info.fileMD5;
return out;
}
inline QDataStream & operator >> (QDataStream &in, YomaFileInfo &info) {
in >> info.fileName >> info.fileSize >> info.fileEditDate >> info.fileMD5;
return in;
}
inline QDataStream & operator << ( QDataStream & out, const SyncFileInfo & info ) {
out << info.fileName << info.fileSize << info.fileEditDate << info.fileSHA1;
return out;
}
inline QDataStream & operator >> (QDataStream &in, SyncFileInfo &info) {
in >> info.fileName >> info.fileSize >> info.fileEditDate >> info.fileSHA1;
return in;
}
#endif // CFG