Unify Player::GetSteamXId returns, clarify doc, and fix checks

This commit is contained in:
Nicholas Hastings 2014-09-09 17:57:54 -07:00
parent 775a35c5ab
commit 96fbb7ecda
2 changed files with 6 additions and 6 deletions

View File

@ -443,7 +443,7 @@ void PlayerManager::RunAuthChecks()
/* :TODO: handle the case of a player disconnecting in the middle */ /* :TODO: handle the case of a player disconnecting in the middle */
m_clauth->PushCell(client); m_clauth->PushCell(client);
/* For legacy reasons, people are expecting the Steam2 id here if using Steam auth */ /* 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); m_clauth->Execute(NULL);
} }
@ -722,7 +722,7 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
const char *steamId = pPlayer->GetSteam2Id(); const char *steamId = pPlayer->GetSteam2Id();
m_clauth->PushCell(client); m_clauth->PushCell(client);
/* For legacy reasons, people are expecting the Steam2 id here if using Steam auth */ /* 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); m_clauth->Execute(NULL);
} }
pPlayer->Authorize_Post(); pPlayer->Authorize_Post();
@ -2155,7 +2155,7 @@ const CSteamID &CPlayer::GetSteamId(bool validated)
const char *CPlayer::GetSteam2Id(bool validated) const char *CPlayer::GetSteam2Id(bool validated)
{ {
if (validated && !IsAuthStringValidated()) if (!m_Steam2Id.length() || (validated && !IsAuthStringValidated()))
{ {
return NULL; return NULL;
} }
@ -2165,7 +2165,7 @@ const char *CPlayer::GetSteam2Id(bool validated)
const char *CPlayer::GetSteam3Id(bool validated) const char *CPlayer::GetSteam3Id(bool validated)
{ {
if (validated && !IsAuthStringValidated()) if (!m_Steam2Id.length() || validated && !IsAuthStringValidated()))
{ {
return NULL; return NULL;
} }

View File

@ -282,7 +282,7 @@ namespace SourceMod
* *
* @param validated Check backend validation status. * @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; virtual const char *GetSteam2Id(bool validated = true) =0;
@ -291,7 +291,7 @@ namespace SourceMod
* *
* @param validated Check backend validation status. * @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; virtual const char *GetSteam3Id(bool validated = true) =0;
}; };