Fix client listener OnClientAuthorized to match new doc

This commit is contained in:
Nicholas Hastings
2014-09-09 18:20:52 -07:00
parent e0c25cfe08
commit 8a1c6bd833
+6 -4
View File
@@ -423,13 +423,15 @@ void PlayerManager::RunAuthChecks()
m_AuthQueue[i] = 0;
removed++;
const char *steamId = pPlayer->GetSteam2Id();
/* Send to extensions */
List<IClientListener *>::iterator iter;
IClientListener *pListener;
for (iter=m_hooks.begin(); iter!=m_hooks.end(); iter++)
{
pListener = (*iter);
pListener->OnClientAuthorized(client, authstr);
pListener->OnClientAuthorized(client, steamId ? steamId : authstr);
if (!pPlayer->IsConnected())
{
break;
@@ -439,7 +441,6 @@ 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);
/* For legacy reasons, people are expecting the Steam2 id here if using Steam auth */
@@ -710,16 +711,17 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
m_clconnect_post->PushCell(client);
m_clconnect_post->Execute(&res, NULL);
const char *steamId = pPlayer->GetSteam2Id();
/* Now do authorization */
for (iter=m_hooks.begin(); iter!=m_hooks.end(); iter++)
{
pListener = (*iter);
pListener->OnClientAuthorized(client, pPlayer->m_AuthID.c_str());
pListener->OnClientAuthorized(client, steamId ? steamId : pPlayer->m_AuthID.c_str());
}
/* Finally, tell plugins */
if (m_clauth->GetFunctionCount())
{
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 ? steamId : pPlayer->m_AuthID.c_str());