diff options
Diffstat (limited to 'NorthstarDedicatedTest/serverauthentication.h')
-rw-r--r-- | NorthstarDedicatedTest/serverauthentication.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/NorthstarDedicatedTest/serverauthentication.h b/NorthstarDedicatedTest/serverauthentication.h index e9aae4f0..b26ce2b2 100644 --- a/NorthstarDedicatedTest/serverauthentication.h +++ b/NorthstarDedicatedTest/serverauthentication.h @@ -1,10 +1,12 @@ #pragma once +#include "convar.h" +#include "httplib.h" #include <unordered_map> #include <string> struct AuthData { - char* uid; + char uid[33]; // pdata char* pdata; @@ -13,13 +15,17 @@ struct AuthData class ServerAuthenticationManager { +private: + httplib::Server m_playerAuthServer; + public: - std::unordered_map<std::string, AuthData*> m_authData; + std::mutex m_authDataMutex; + std::unordered_map<std::string, AuthData> m_authData; bool m_runningPlayerAuthThread = false; public: void StartPlayerAuthServer(); - void AddPlayerAuthData(char* authToken, char* uid, char* pdata, size_t pdataSize); + void StopPlayerAuthServer(); bool AuthenticatePlayer(void* player, int64_t uid, char* authToken); bool RemovePlayerAuthData(void* player); void WritePersistentData(void* player); |