aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/masterserver.h
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDedicatedTest/masterserver.h')
-rw-r--r--NorthstarDedicatedTest/masterserver.h47
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