diff options
author | Maya <malte.hoermeyer@web.de> | 2022-10-28 02:17:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-28 02:17:54 +0200 |
commit | 9df904da17dcf3f419ac9a2b5a9a4c5a4d303454 (patch) | |
tree | 43eccff74f7a0dc385fc7244d6da8c3510012331 /NorthstarDLL/serverauthentication.h | |
parent | 4c99e6f02d7063ccc2e6c09531abd48c5bf9c91e (diff) | |
download | NorthstarLauncher-9df904da17dcf3f419ac9a2b5a9a4c5a4d303454.tar.gz NorthstarLauncher-9df904da17dcf3f419ac9a2b5a9a4c5a4d303454.zip |
Improve authentication flow (#306)v1.10.2-rc1v1.10.2
* Check Name for Invalid Chars
Co-authored-by: Emma-Miler <27428383+emma-miler@users.noreply.github.com>
* Remove `m_bRequireClientAuth ` and add logging
* Format changes
* Remove debugging code
* Add return values for CBaseClient_Connect
* Update serverauthentication.cpp
* Format changes
* Fix singleplayer
* Add comment about singleplayer
* Format
* Update serverauthentication.cpp
* Update serverauthentication.cpp
* Update serverauthentication.cpp
Co-authored-by: RoyalBlue1 <realEmail@veryRealURL.com>
Co-authored-by: Emma-Miler <27428383+emma-miler@users.noreply.github.com>
Diffstat (limited to 'NorthstarDLL/serverauthentication.h')
-rw-r--r-- | NorthstarDLL/serverauthentication.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/NorthstarDLL/serverauthentication.h b/NorthstarDLL/serverauthentication.h index 08854ac0..65050d56 100644 --- a/NorthstarDLL/serverauthentication.h +++ b/NorthstarDLL/serverauthentication.h @@ -22,6 +22,9 @@ struct PlayerAuthenticationData bool needPersistenceWriteOnLeave = true; }; +typedef int64_t (*CBaseServer__RejectConnectionType)(void* a1, unsigned int a2, void* a3, const char* a4, ...); +extern CBaseServer__RejectConnectionType CBaseServer__RejectConnection; + class ServerAuthenticationManager { private: @@ -36,7 +39,6 @@ class ServerAuthenticationManager std::mutex m_AuthDataMutex; std::unordered_map<std::string, RemoteAuthData> m_RemoteAuthenticationData; std::unordered_map<R2::CBaseClient*, PlayerAuthenticationData> m_PlayerAuthenticationData; - bool m_bRequireClientAuth = true; bool m_bAllowDuplicateAccounts = false; bool m_bRunningPlayerAuthThread = false; bool m_bNeedLocalAuthForNewgame = false; @@ -49,7 +51,7 @@ class ServerAuthenticationManager void RemovePlayer(R2::CBaseClient* player); bool CheckDuplicateAccounts(R2::CBaseClient* player); bool AuthenticatePlayer(R2::CBaseClient* player, uint64_t uid, char* authToken); - void VerifyPlayerName(R2::CBaseClient* player, char* authToken, char* name); + bool VerifyPlayerName(const char* authToken, const char* name); bool RemovePlayerAuthData(R2::CBaseClient* player); void WritePersistentData(R2::CBaseClient* player); }; |