From 4d0e4679d05b146e5e43a1a707708c6451099c54 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Fri, 6 Aug 2021 05:25:47 +0100 Subject: add support for connecting to servers from masterserver --- NorthstarDedicatedTest/masterserver.h | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'NorthstarDedicatedTest/masterserver.h') diff --git a/NorthstarDedicatedTest/masterserver.h b/NorthstarDedicatedTest/masterserver.h index 1cbc37a5..76e19b48 100644 --- a/NorthstarDedicatedTest/masterserver.h +++ b/NorthstarDedicatedTest/masterserver.h @@ -9,7 +9,7 @@ public: // server info char name[64]; - char* description; + std::string description; char map[32]; char playlist[16]; @@ -24,22 +24,39 @@ public: 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(); +}; + +struct RemoteServerConnectionInfo +{ +public: + char authToken[32]; + + in_addr ip; + int port; }; class MasterServerManager { private: - bool m_requestingServerList; + bool m_requestingServerList = false; + bool m_authenticatingWithGameServer = false; public: - bool m_scriptRequestingServerList; + bool m_scriptRequestingServerList = false; bool m_successfullyConnected = true; - std::list m_remoteServers; + + bool m_scriptAuthenticatingWithGameServer = false; + bool m_successfullyAuthenticatedWithGameServer = false; + + bool m_hasPendingConnectionInfo = false; + RemoteServerConnectionInfo m_pendingConnectionInfo; + + std::vector m_remoteServers; public: void ClearServerList(); void RequestServerList(); + void TryAuthenticateWithServer(char* serverId, char* password); }; void InitialiseSharedMasterServer(HMODULE baseAddress); -- cgit v1.2.3