aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/masterserver.h
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-28 04:35:47 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-12-28 04:35:47 +0000
commite5684053f4127bd02681ef46e0bfeada83b2f63c (patch)
tree3898d6086d4d47f194c519103c34feecc0b18f16 /NorthstarDedicatedTest/masterserver.h
parentc27bf9979b7524672e5315fe04d05cc93f6ee6af (diff)
downloadNorthstarLauncher-e5684053f4127bd02681ef46e0bfeada83b2f63c.tar.gz
NorthstarLauncher-e5684053f4127bd02681ef46e0bfeada83b2f63c.zip
add retry logic to masterserver requests
Diffstat (limited to 'NorthstarDedicatedTest/masterserver.h')
-rw-r--r--NorthstarDedicatedTest/masterserver.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/masterserver.h b/NorthstarDedicatedTest/masterserver.h
index e51477a2..85237f23 100644
--- a/NorthstarDedicatedTest/masterserver.h
+++ b/NorthstarDedicatedTest/masterserver.h
@@ -1,5 +1,6 @@
#pragma once
#include "convar.h"
+#include "httplib.h"
#include <WinSock2.h>
struct RemoteModInfo
@@ -66,6 +67,7 @@ class MasterServerManager
private:
bool m_requestingServerList = false;
bool m_authenticatingWithGameServer = false;
+ httplib::Client* m_httpClient = nullptr;
public:
char m_ownServerId[33];
@@ -92,6 +94,18 @@ public:
bool m_bHasMainMenuPromoData = false;
MainMenuPromoData m_MainMenuPromoData;
+private:
+ void LazyCreateHttpClient();
+ bool RequestServerListThread();
+ bool RequestMainMenuPromosThread();
+ bool AuthenticateOriginWithMasterServerThread(std::string uidStr, std::string tokenStr);
+ bool AuthenticateWithOwnServerThread(char* uid, char* playerToken);
+ bool AuthenticateWithServerThread(char* uid, char* playerToken, char* serverId, char* password);
+ bool AddSelfToServerListThread(int port, int authPort, char* name, char* description, char* map, char* playlist, int maxPlayers, char* password);
+ bool UpdateServerMapAndPlaylistThread(char* map, char* playlist, int playerCount);
+ bool WritePlayerPersistentDataThread(std::string playerId, char* pdata, size_t pdataSize);
+ bool RemoveSelfFromServerListThread();
+
public:
void ClearServerList();
void RequestServerList();