diff options
author | GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> | 2022-05-13 01:50:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-13 01:50:20 +0200 |
commit | 0c8994686185fe04e6a6748e5808df17aa9214a4 (patch) | |
tree | 1a76650dbfad9144b1925608c2cceae8d8d94768 | |
parent | 0bd42559b53e1a0d210b0542803d76d5f8803070 (diff) | |
download | NorthstarLauncher-0c8994686185fe04e6a6748e5808df17aa9214a4.tar.gz NorthstarLauncher-0c8994686185fe04e6a6748e5808df17aa9214a4.zip |
Log UID in a variety of places during auth process (#174)
* Log UID in a variety of places during auth process
* Log UID in CBaseClient__ActivatePlayerHook
-rw-r--r-- | NorthstarDedicatedTest/serverauthentication.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/serverauthentication.cpp b/NorthstarDedicatedTest/serverauthentication.cpp index b116c6e3..f00f5129 100644 --- a/NorthstarDedicatedTest/serverauthentication.cpp +++ b/NorthstarDedicatedTest/serverauthentication.cpp @@ -129,6 +129,12 @@ void ServerAuthenticationManager::StartPlayerAuthServer() return; } + // Log playername and UID from request + spdlog::info( + "Player \"{}\" with UID \"{}\" requested to join", + request.get_param_value("username").c_str(), + request.get_param_value("id").c_str()); + AuthData newAuthData {}; strncpy(newAuthData.uid, request.get_param_value("id").c_str(), sizeof(newAuthData.uid)); newAuthData.uid[sizeof(newAuthData.uid) - 1] = 0; @@ -196,6 +202,9 @@ bool ServerAuthenticationManager::AuthenticatePlayer(void* player, int64_t uid, // use stored auth data AuthData authData = m_authData[authToken]; + // Log playnername and UID from request + spdlog::info("Comparing connecting UID \"{}\" against stored UID from ms auth reguest \"{}\"", strUid.c_str(), authData.uid); + if (!strcmp(strUid.c_str(), authData.uid)) // connecting client's uid is the same as auth's uid { authFail = false; @@ -280,6 +289,8 @@ bool ServerAuthenticationManager::RemovePlayerAuthData(void* player) { if (!strcmp((char*)player + 0xF500, auth.second.uid)) { + // Log UID + spdlog::info("Erasing auth data from UID \"{}\"", auth.second.uid); // pretty sure this is fine, since we don't iterate after the erase // i think if we iterated after it'd be undefined behaviour tho std::lock_guard<std::mutex> guard(m_authDataMutex); @@ -352,6 +363,9 @@ void* CBaseServer__ConnectClientHook( nextPlayerToken = serverFilter; nextPlayerUid = uid; + // Random UID log + spdlog::info("CBaseServer__ConnectClientHook says UID \"{}\"", uid); + return CBaseServer__ConnectClient(server, a2, a3, a4, a5, a6, a7, a8, serverFilter, a10, a11, a12, a13, a14, uid, a16, a17); } @@ -364,6 +378,9 @@ bool CBaseClient__ConnectHook(void* self, char* name, __int64 netchan_ptr_arg, c // we connect irregardless of auth, because returning bad from this function can fuck client state p bad bool ret = CBaseClient__Connect(self, name, netchan_ptr_arg, b_fake_player_arg, a5, Buffer, a7); + // Another UID log + spdlog::info("CBaseClient__ConnectHook says UID \"{}\"", nextPlayerUid); + if (!ret) return ret; @@ -420,6 +437,8 @@ void CBaseClient__ActivatePlayerHook(void* self) g_ServerAuthenticationManager->WritePersistentData(self); g_MasterServerManager->UpdateServerPlayerCount(g_ServerAuthenticationManager->m_additionalPlayerData.size()); } + // Log UID + spdlog::info("In CBaseClient__ActivatePlayerHook, activating UID \"{}\"", (char*)self + 0xF500); CBaseClient__ActivatePlayer(self); } |