diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2023-01-04 00:36:51 +0000 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2023-01-04 14:59:34 +0100 |
commit | 2c4a25a0f2b28ba278a46c1755637374f90e9b35 (patch) | |
tree | 011a61c651a7f2244ffe828696fc3247012f15c6 /NorthstarDLL/server/auth/serverauthentication.h | |
parent | a7018f0178006f0271077863149283c9f3d95d64 (diff) | |
download | NorthstarLauncher-2c4a25a0f2b28ba278a46c1755637374f90e9b35.tar.gz NorthstarLauncher-2c4a25a0f2b28ba278a46c1755637374f90e9b35.zip |
generally cleanup authentication code and fix client state issues with rejection from local server (#360)v1.11.2-rc2
* generally cleanup authentication code and fix client state issues with
rejection from local server
* fix formatting
* fix formatting
* use client-provided uid for logging disconnect failure as it won't be
copied to player if authentication fails
* support loading savegame and use more reliable method for fixing
client rejection issues
* oops forgot to add rejectconnectionfixes.cpp
* fixup formatting
Diffstat (limited to 'NorthstarDLL/server/auth/serverauthentication.h')
-rw-r--r-- | NorthstarDLL/server/auth/serverauthentication.h | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/NorthstarDLL/server/auth/serverauthentication.h b/NorthstarDLL/server/auth/serverauthentication.h index 4ffbbfd6..2ca07a8a 100644 --- a/NorthstarDLL/server/auth/serverauthentication.h +++ b/NorthstarDLL/server/auth/serverauthentication.h @@ -33,27 +33,33 @@ class ServerAuthenticationManager public: ConVar* Cvar_ns_player_auth_port; ConVar* Cvar_ns_erase_auth_info; - ConVar* CVar_ns_auth_allow_insecure; - ConVar* CVar_ns_auth_allow_insecure_write; + ConVar* Cvar_ns_auth_allow_insecure; + ConVar* Cvar_ns_auth_allow_insecure_write; std::mutex m_AuthDataMutex; std::unordered_map<std::string, RemoteAuthData> m_RemoteAuthenticationData; std::unordered_map<R2::CBaseClient*, PlayerAuthenticationData> m_PlayerAuthenticationData; + bool m_bAllowDuplicateAccounts = false; bool m_bRunningPlayerAuthThread = false; bool m_bNeedLocalAuthForNewgame = false; bool m_bForceResetLocalPlayerPersistence = false; + bool m_bStartingLocalSPGame = false; public: void StartPlayerAuthServer(); void StopPlayerAuthServer(); - void AddPlayer(R2::CBaseClient* player, const char* pToken); - void RemovePlayer(R2::CBaseClient* player); - bool CheckDuplicateAccounts(R2::CBaseClient* player); - bool AuthenticatePlayer(R2::CBaseClient* player, uint64_t uid, char* authToken); - bool VerifyPlayerName(const char* authToken, const char* name); - bool RemovePlayerAuthData(R2::CBaseClient* player); - void WritePersistentData(R2::CBaseClient* player); + + void AddPlayer(R2::CBaseClient* pPlayer, const char* pAuthToken); + void RemovePlayer(R2::CBaseClient* pPlayer); + + bool VerifyPlayerName(const char* pAuthToken, const char* pName, char pOutVerifiedName[64]); + bool IsDuplicateAccount(R2::CBaseClient* pPlayer, const char* pUid); + bool CheckAuthentication(R2::CBaseClient* pPlayer, uint64_t iUid, char* pAuthToken); + + void AuthenticatePlayer(R2::CBaseClient* pPlayer, uint64_t iUid, char* pAuthToken); + bool RemovePlayerAuthData(R2::CBaseClient* pPlayer); + void WritePersistentData(R2::CBaseClient* pPlayer); }; extern ServerAuthenticationManager* g_pServerAuthentication; |