aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/server/auth/serverauthentication.h
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2023-01-04 00:36:51 +0000
committerGitHub <noreply@github.com>2023-01-04 00:36:51 +0000
commit4fb1ae07d8f078e7abde99900c6a8286148a380a (patch)
tree56014eed36f16df79aab2c5cee527303dd70662d /NorthstarDLL/server/auth/serverauthentication.h
parenta4aab8da64eded240867fbe51d272aa44a180a26 (diff)
downloadNorthstarLauncher-4fb1ae07d8f078e7abde99900c6a8286148a380a.tar.gz
NorthstarLauncher-4fb1ae07d8f078e7abde99900c6a8286148a380a.zip
generally cleanup authentication code and fix client state issues with rejection from local server (#360)
* 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.h24
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;