aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/serverauthentication.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-08-25 04:53:17 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-08-25 04:53:17 +0100
commit9c9afa37b9a410ea14b960c203a91bd8d8c767ca (patch)
tree1169321b84da266da382c15a2a14ea9ce38940c9 /NorthstarDedicatedTest/serverauthentication.cpp
parentcd727a453a7d42a61bd161ea0c9947aee644e4f1 (diff)
downloadNorthstarLauncher-9c9afa37b9a410ea14b960c203a91bd8d8c767ca.tar.gz
NorthstarLauncher-9c9afa37b9a410ea14b960c203a91bd8d8c767ca.zip
deprecate clc_SetPlaylistVarOverride
Diffstat (limited to 'NorthstarDedicatedTest/serverauthentication.cpp')
-rw-r--r--NorthstarDedicatedTest/serverauthentication.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/NorthstarDedicatedTest/serverauthentication.cpp b/NorthstarDedicatedTest/serverauthentication.cpp
index 6dd44284..77990d24 100644
--- a/NorthstarDedicatedTest/serverauthentication.cpp
+++ b/NorthstarDedicatedTest/serverauthentication.cpp
@@ -98,23 +98,28 @@ bool ServerAuthenticationManager::AuthenticatePlayer(void* player, int64_t uid,
std::string strUid = std::to_string(uid);
std::lock_guard<std::mutex> guard(m_authDataMutex);
+
+ bool authFail = true;
if (!m_authData.empty() && m_authData.count(std::string(authToken)))
{
// use stored auth data
AuthData authData = m_authData[authToken];
- if (strcmp(strUid.c_str(), authData.uid)) // connecting client's uid is different from auth's uid
- return false;
-
- // uuid
- strcpy((char*)player + 0xF500, strUid.c_str());
+ if (!strcmp(strUid.c_str(), authData.uid)) // connecting client's uid is different from auth's uid
+ {
+ authFail = false;
+ // uuid
+ strcpy((char*)player + 0xF500, strUid.c_str());
- // copy pdata into buffer
- memcpy((char*)player + 0x4FA, authData.pdata, authData.pdataSize);
+ // copy pdata into buffer
+ memcpy((char*)player + 0x4FA, authData.pdata, authData.pdataSize);
- // set persistent data as ready, we use 0x4 internally to mark the client as using remote persistence
- *((char*)player + 0x4a0) = (char)0x4;
+ // set persistent data as ready, we use 0x4 internally to mark the client as using remote persistence
+ *((char*)player + 0x4a0) = (char)0x4;
+ }
}
- else
+
+
+ if (authFail)
{
if (!CVar_ns_auth_allow_insecure->m_nValue) // no auth data and insecure connections aren't allowed, so dc the client
return false;