Make OnClientAuthorized use Steam2 ids where available

This commit is contained in:
Nicholas Hastings 2014-09-09 17:43:01 -07:00
parent acdd9e12ea
commit 9e6fcc7673
2 changed files with 9 additions and 3 deletions

View File

@ -439,9 +439,11 @@ void PlayerManager::RunAuthChecks()
/* Send to plugins if player is still connected */
if (pPlayer->IsConnected() && m_clauth->GetFunctionCount())
{
const char *steamId = pPlayer->GetSteam2Id();
/* :TODO: handle the case of a player disconnecting in the middle */
m_clauth->PushCell(client);
m_clauth->PushString(authstr);
/* For legacy reasons, people are expecting the Steam2 id here if using Steam auth */
m_clauth->PushString(steamId[0] ? steamId : authstr);
m_clauth->Execute(NULL);
}
@ -717,8 +719,10 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
/* Finally, tell plugins */
if (m_clauth->GetFunctionCount())
{
const char *steamId = pPlayer->GetSteam2Id();
m_clauth->PushCell(client);
m_clauth->PushString(pPlayer->m_AuthID.c_str());
/* 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->Execute(NULL);
}
pPlayer->Authorize_Post();

View File

@ -394,7 +394,9 @@ void ClientPrefs::CatchLateLoadClients()
continue;
}
g_CookieManager.OnClientAuthorized(i, pPlayer->GetAuthString());
/* For legacy reasons, OnClientAuthorized gives the Steam2 id here if using Steam auth */
const char *steamId = pPlayer->GetSteam2Id();
g_CookieManager.OnClientAuthorized(i, steamId[0] ? steamId : pPlayer->GetAuthString());
}
}