From 8a1c6bd8336884f6b3d9cb026c83ef9cc37ed351 Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Tue, 9 Sep 2014 18:20:52 -0700 Subject: [PATCH] Fix client listener OnClientAuthorized to match new doc --- core/PlayerManager.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index ecbf9069..b0c4383f 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -422,6 +422,8 @@ void PlayerManager::RunAuthChecks() unsigned int client = m_AuthQueue[i]; m_AuthQueue[i] = 0; removed++; + + const char *steamId = pPlayer->GetSteam2Id(); /* Send to extensions */ List::iterator iter; @@ -429,7 +431,7 @@ void PlayerManager::RunAuthChecks() 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 */ @@ -709,17 +710,18 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername cell_t res; 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());