Make OnClientAuthorized use Steam2 ids where available
This commit is contained in:
parent
acdd9e12ea
commit
9e6fcc7673
@ -439,9 +439,11 @@ void PlayerManager::RunAuthChecks()
|
|||||||
/* Send to plugins if player is still connected */
|
/* Send to plugins if player is still connected */
|
||||||
if (pPlayer->IsConnected() && m_clauth->GetFunctionCount())
|
if (pPlayer->IsConnected() && m_clauth->GetFunctionCount())
|
||||||
{
|
{
|
||||||
|
const char *steamId = pPlayer->GetSteam2Id();
|
||||||
/* :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);
|
||||||
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);
|
m_clauth->Execute(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -717,8 +719,10 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
|
|||||||
/* Finally, tell plugins */
|
/* Finally, tell plugins */
|
||||||
if (m_clauth->GetFunctionCount())
|
if (m_clauth->GetFunctionCount())
|
||||||
{
|
{
|
||||||
|
const char *steamId = pPlayer->GetSteam2Id();
|
||||||
m_clauth->PushCell(client);
|
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);
|
m_clauth->Execute(NULL);
|
||||||
}
|
}
|
||||||
pPlayer->Authorize_Post();
|
pPlayer->Authorize_Post();
|
||||||
|
@ -394,7 +394,9 @@ void ClientPrefs::CatchLateLoadClients()
|
|||||||
continue;
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user