diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-08-05 03:17:54 +0100 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-08-05 03:17:54 +0100 |
commit | 02e422166baa12bbdc8af8806376cb2340fef896 (patch) | |
tree | 0ec856650684f0ee6644446d8e865ad1f6ec8859 /NorthstarDedicatedTest/masterserver.h | |
parent | bf176fe728400b93295118e8d256c346c8c52d41 (diff) | |
download | NorthstarLauncher-02e422166baa12bbdc8af8806376cb2340fef896.tar.gz NorthstarLauncher-02e422166baa12bbdc8af8806376cb2340fef896.zip |
add support for requesting server list from masterserver
Diffstat (limited to 'NorthstarDedicatedTest/masterserver.h')
-rw-r--r-- | NorthstarDedicatedTest/masterserver.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/masterserver.h b/NorthstarDedicatedTest/masterserver.h new file mode 100644 index 00000000..1cbc37a5 --- /dev/null +++ b/NorthstarDedicatedTest/masterserver.h @@ -0,0 +1,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;
\ No newline at end of file |