diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index 72b5b49d..7afc373d 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -443,7 +443,7 @@ void PlayerManager::RunAuthChecks() /* :TODO: handle the case of a player disconnecting in the middle */ m_clauth->PushCell(client); /* For legacy reasons, people are expecting the Steam2 id here if using Steam auth */ - m_clauth->PushString(steamId[0] ? steamId : authstr); + m_clauth->PushString(steamId ? steamId : authstr); m_clauth->Execute(NULL); } @@ -722,7 +722,7 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername const char *steamId = pPlayer->GetSteam2Id(); m_clauth->PushCell(client); /* For legacy reasons, people are expecting the Steam2 id here if using Steam auth */ - m_clauth->PushString(steamId[0] ? steamId : pPlayer->m_AuthID.c_str()); + m_clauth->PushString(steamId ? steamId : pPlayer->m_AuthID.c_str()); m_clauth->Execute(NULL); } pPlayer->Authorize_Post(); @@ -2155,7 +2155,7 @@ const CSteamID &CPlayer::GetSteamId(bool validated) const char *CPlayer::GetSteam2Id(bool validated) { - if (validated && !IsAuthStringValidated()) + if (!m_Steam2Id.length() || (validated && !IsAuthStringValidated())) { return NULL; } @@ -2165,7 +2165,7 @@ const char *CPlayer::GetSteam2Id(bool validated) const char *CPlayer::GetSteam3Id(bool validated) { - if (validated && !IsAuthStringValidated()) + if (!m_Steam2Id.length() || validated && !IsAuthStringValidated())) { return NULL; } diff --git a/public/IPlayerHelpers.h b/public/IPlayerHelpers.h index 4ae7316c..672cddb5 100644 --- a/public/IPlayerHelpers.h +++ b/public/IPlayerHelpers.h @@ -282,7 +282,7 @@ namespace SourceMod * * @param validated Check backend validation status. * - * @return True on success or false if not available. + * @return Steam2 Id on success or NULL if not available. */ virtual const char *GetSteam2Id(bool validated = true) =0; @@ -291,7 +291,7 @@ namespace SourceMod * * @param validated Check backend validation status. * - * @return True on success or false if not available. + * @return Steam3 Id on success or NULL if not available. */ virtual const char *GetSteam3Id(bool validated = true) =0; };