-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathserverinfo.h
120 lines (106 loc) · 2.19 KB
/
serverinfo.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
#ifndef SERVERINFO
#define SERVERINFO
#include <QMainWindow>
#include <QHostAddress>
#include <QHash>
#include <QDateTime>
#include <QHostInfo>
#include "rcon.h"
#include "customitems.h"
class MainWindow;
enum QueryState
{
QueryRunning,
QueryFailed,
QuerySuccess,
QueryResolving,
QueryResolveFailed,
};
class PlayerLogInfo
{
public:
PlayerLogInfo()
{
time = QDateTime::currentMSecsSinceEpoch();
steamID = "";
userid = 0;
}
PlayerLogInfo(quint32 id, QString steam)
{
time = QDateTime::currentMSecsSinceEpoch();
steamID = steam;
userid = id;
}
qint64 time;
QString steamID;
quint32 userid;
};
class ServerInfo
{
public:
~ServerInfo()
{
if(this->rcon != NULL)
delete this->rcon;
}
ServerInfo(QString, QueryState, bool);
bool isEqual(ServerInfo *)const;
void cleanHashTable();
void GetCountryFlag();
public:
bool haveInfo;
qint8 protocol;
QString tags;
quint8 vac;
QString version;
QString os;
qint32 appId;
QString serverNameRich;
QString currentMap;
QString nextMap;
QString ff;
QString timelimit;
QString hostname;
QStringList mods;
QString playerCount;
QString gameName;
QString type;
QString serverID;
QHostAddress host;
quint16 port;
quint64 rawServerId;
//This name sucks... this is IP:PORT or HOSTNAME:PORT
QString hostPort;
QString rconPassword;
QStringList rconOutput;
QStringList logOutput;
QStringList chatOutput;
bool saveRcon;
RconQuery *rcon;
QHash<QString, PlayerLogInfo> logHashTable;
QList<int> pingList;
quint16 lastPing;
quint16 avgPing;
QImage countryFlag;
QueryState queryState;
quint8 currentPlayers;
quint8 maxPlayers;
};
class HostQueryResult : public QObject
{
Q_OBJECT
public slots:
void HostInfoResolved(QHostInfo);
public:
HostQueryResult(ServerInfo *p, MainWindow *main, ServerTableIndexItem *item)
{
info = p;
id = item;
mainWindow = main;
}
private:
MainWindow *mainWindow;
ServerTableIndexItem *id;
ServerInfo *info;
};
#endif // SERVERINFO