fixed a potential bug with kicking players during authorization

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40653
This commit is contained in:
David Anderson 2007-03-19 01:44:09 +00:00
parent c6375166a1
commit c6c4de1f75

View File

@ -118,6 +118,10 @@ void PlayerManager::RunAuthChecks()
pPlayer->m_AuthID.assign(authstr);
pPlayer->m_IsAuthorized = true;
/* Mark as removed from queue */
m_AuthQueue[i] = 0;
removed++;
/* Send to extensions */
List<IClientListener *>::iterator iter;
IClientListener *pListener;
@ -125,19 +129,20 @@ void PlayerManager::RunAuthChecks()
{
pListener = (*iter);
pListener->OnClientAuthorized(m_AuthQueue[i], authstr);
if (!pPlayer->IsConnected())
{
break;
}
}
/* Send to plugins */
if (m_clauth->GetFunctionCount())
/* Send to plugins if player is still connected */
if (pPlayer->IsConnected() && m_clauth->GetFunctionCount())
{
/* :TODO: handle the case of a player disconnecting in the middle */
m_clauth->PushCell(m_AuthQueue[i]);
m_clauth->PushString(authstr);
m_clauth->Execute(NULL);
}
/* Mark as removed from queue */
m_AuthQueue[i] = 0;
removed++;
}
}