From 20b7592fcdd87618cc17531d3aa8d0f8f9118430 Mon Sep 17 00:00:00 2001 From: Kyle Sanderson Date: Thu, 13 Oct 2016 22:14:51 -0700 Subject: [PATCH] GetPlayerNetworkIDString isn't alone anymore, we have friends. (#551) * GetPlayerNetworkIDString isn't alone anymore, we have friends. Completely speculative CS:GO fix, 50/50, 60/40. * Preserve existing cycle-saving techniques. * Style. --- core/PlayerManager.cpp | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index 35f9dcac..f325d96f 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -2012,30 +2012,27 @@ void CPlayer::UpdateAuthIds() { return; } - - // First cache engine networkid + const char *authstr = engine->GetPlayerNetworkIDString(m_pEdict); - if (!authstr) + if (authstr) { - // engine doesn't have the client's auth string just yet, we can't do anything - return; + if (m_AuthID.compare(authstr) != 0) + { + m_AuthID = authstr; + } + else + { + return; + } } - - if (m_AuthID.compare(authstr) == 0) - { - return; - } - - m_AuthID = authstr; - // Then, cache SteamId if (IsFakeClient()) { m_SteamId = k_steamIDNil; } else { -#if SOURCE_ENGINE < SE_ORANGEBOX || SOURCE_ENGINE == SE_CSGO +#if SOURCE_ENGINE < SE_ORANGEBOX const char * pAuth = GetAuthString(); /* STEAM_0:1:123123 | STEAM_ID_LAN | STEAM_ID_PENDING */ if (pAuth && (strlen(pAuth) > 10) && pAuth[8] != '_') @@ -2047,7 +2044,14 @@ void CPlayer::UpdateAuthIds() const CSteamID *steamId = engine->GetClientSteamID(m_pEdict); if (steamId) { - m_SteamId = (*steamId); + if (m_SteamId != (*steamId)) + { + m_SteamId = (*steamId); + } + else + { + return; + } } #endif }