aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/masterserver.h
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-08-06 05:25:47 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-08-06 05:25:47 +0100
commit4d0e4679d05b146e5e43a1a707708c6451099c54 (patch)
tree111c18c310feeaf2096855e4072dea46f8f20eb6 /NorthstarDedicatedTest/masterserver.h
parent02e422166baa12bbdc8af8806376cb2340fef896 (diff)
downloadNorthstarLauncher-4d0e4679d05b146e5e43a1a707708c6451099c54.tar.gz
NorthstarLauncher-4d0e4679d05b146e5e43a1a707708c6451099c54.zip
add support for connecting to servers from masterserver
Diffstat (limited to 'NorthstarDedicatedTest/masterserver.h')
-rw-r--r--NorthstarDedicatedTest/masterserver.h27
1 files changed, 22 insertions, 5 deletions
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<RemoteServerInfo> m_remoteServers;
+
+ bool m_scriptAuthenticatingWithGameServer = false;
+ bool m_successfullyAuthenticatedWithGameServer = false;
+
+ bool m_hasPendingConnectionInfo = false;
+ RemoteServerConnectionInfo m_pendingConnectionInfo;
+
+ std::vector<RemoteServerInfo> m_remoteServers;
public:
void ClearServerList();
void RequestServerList();
+ void TryAuthenticateWithServer(char* serverId, char* password);
};
void InitialiseSharedMasterServer(HMODULE baseAddress);