diff options
author | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2023-01-04 14:21:29 +0000 |
---|---|---|
committer | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2023-01-04 14:21:29 +0000 |
commit | 6c45c7e94634c340019d12615b7eae8f3c0f49b3 (patch) | |
tree | e3032bb037a241f7a74152b9b3d28c1d5c2fbcb1 /NorthstarDLL/serverauthentication.cpp | |
parent | df4a741c032f0ee0f19aac66cb3611b48c173486 (diff) | |
download | NorthstarLauncher-6c45c7e94634c340019d12615b7eae8f3c0f49b3.tar.gz NorthstarLauncher-6c45c7e94634c340019d12615b7eae8f3c0f49b3.zip |
commit all changes for merge
Diffstat (limited to 'NorthstarDLL/serverauthentication.cpp')
-rw-r--r-- | NorthstarDLL/serverauthentication.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/NorthstarDLL/serverauthentication.cpp b/NorthstarDLL/serverauthentication.cpp index 73b714ab..53892623 100644 --- a/NorthstarDLL/serverauthentication.cpp +++ b/NorthstarDLL/serverauthentication.cpp @@ -15,6 +15,7 @@ #include "r2engine.h" #include "r2client.h" #include "r2server.h" +#include "bots.h" #include "httplib.h" @@ -188,10 +189,6 @@ bool ServerAuthenticationManager::CheckAuthentication(R2::CBaseClient* pPlayer, void ServerAuthenticationManager::AuthenticatePlayer(R2::CBaseClient* pPlayer, uint64_t iUid, char* pAuthToken) { - // for bot players, generate a new uid - if (pPlayer->m_bFakePlayer) - iUid = 0; // is this a good way of doing things :clueless: - std::string sUid = std::to_string(iUid); // copy uuid @@ -316,7 +313,12 @@ bool,, (R2::CBaseClient* self, char* pName, void* pNetChannel, char bFakePlayer, pAuthenticationFailure = "Authentication Failed."; } else // need to copy name for bots still + { + // generate uid and token for bot + iNextPlayerUid = 0; + pNextPlayerToken = (char*)""; strncpy_s(pVerifiedName, pName, 63); + } if (pAuthenticationFailure) { @@ -333,6 +335,9 @@ bool,, (R2::CBaseClient* self, char* pName, void* pNetChannel, char bFakePlayer, // we already know this player's authentication data is legit, actually write it to them now g_pServerAuthentication->AuthenticatePlayer(self, iNextPlayerUid, pNextPlayerToken); + if (bFakePlayer) + g_pBots->SetupPlayer(self); + g_pServerAuthentication->AddPlayer(self, pNextPlayerToken); g_pServerLimits->AddPlayer(self); |