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
|
#pragma once
#include "convar.h"
#include <WinSock2.h>
class RemoteServerInfo
{
public:
char id[32];
// server info
char name[64];
char* description;
char map[32];
char playlist[16];
int playerCount;
int maxPlayers;
// connection stuff
bool requiresPassword;
in_addr ip;
int port;
public:
RemoteServerInfo(const char* newId, const char* newName, const char* newDescription, const char* newMap, const char* newPlaylist, int newPlayerCount, int newMaxPlayers);
RemoteServerInfo(const char* newId, const char* newName, const char* newDescription, const char* newMap, const char* newPlaylist, int newPlayerCount, int newMaxPlayers, in_addr newIp, int newPort);
~RemoteServerInfo();
};
class MasterServerManager
{
private:
bool m_requestingServerList;
public:
bool m_scriptRequestingServerList;
bool m_successfullyConnected = true;
std::list<RemoteServerInfo> m_remoteServers;
public:
void ClearServerList();
void RequestServerList();
};
void InitialiseSharedMasterServer(HMODULE baseAddress);
extern MasterServerManager* g_MasterServerManager;
|