fixed amb1305 by making OnClientPostAdminCheck() always occur after OnClientPutInServer(). this is now GUARANTEED. it was undefined before, however the usual case was opposite. if plugins were relying on this, they were written poorly and shouldn't have worked in the first place, especially with the threaded SQL plugin.
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401819
This commit is contained in:
parent
ad5ef39cb4
commit
a079a87f68
@ -489,6 +489,11 @@ void PlayerManager::OnClientPutInServer(edict_t *pEntity, const char *playername
|
||||
|
||||
m_clputinserver->PushCell(client);
|
||||
m_clputinserver->Execute(&res, NULL);
|
||||
|
||||
if (m_Players[client].IsAuthorized())
|
||||
{
|
||||
m_Players[client].DoPostConnectAuthorization();
|
||||
}
|
||||
}
|
||||
|
||||
void PlayerManager::OnSourceModLevelEnd()
|
||||
@ -1144,13 +1149,10 @@ void CPlayer::Connect()
|
||||
{
|
||||
const char *pass = engine->GetClientConVarValue(client, var);
|
||||
m_LastPassword.assign(pass ? pass : "");
|
||||
} else {
|
||||
m_LastPassword.assign("");
|
||||
}
|
||||
|
||||
if (m_IsAuthorized)
|
||||
else
|
||||
{
|
||||
DoPostConnectAuthorization();
|
||||
m_LastPassword.assign("");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,10 +56,15 @@ enum NetFlow
|
||||
forward bool:OnClientConnect(client, String:rejectmsg[], maxlen);
|
||||
|
||||
/**
|
||||
* Called when a client is entering to the game.
|
||||
* Called when a client is entering the game.
|
||||
*
|
||||
* @note Whether a client has a steamid is undefined until OnClientAuthorized
|
||||
* Whether a client has a steamid is undefined until OnClientAuthorized
|
||||
* is called, which may occur either before or after OnClientPutInServer.
|
||||
* Similarly, use OnClientPostAdminCheck() if you need to verify whether
|
||||
* connecting players are admins.
|
||||
*
|
||||
* GetClientCount() will include clients as they are passed through this
|
||||
* function, as clients are already in game at this point.
|
||||
*
|
||||
* @param client Client index.
|
||||
* @noreturn
|
||||
@ -100,9 +105,11 @@ forward Action:OnClientCommand(client, args);
|
||||
forward OnClientSettingsChanged(client);
|
||||
|
||||
/**
|
||||
* Called when a client receives a Steam ID.
|
||||
|
||||
* Admin properties are not assigned here, but on OnClientPostAdminCheck().
|
||||
* Called when a client receives a Steam ID. The state of a client's
|
||||
* authorization via Steam or as an admin is not guaranteed here.
|
||||
* Use OnClientAuthorized() or OnClientPostAdminCheck() for those,
|
||||
* respectively.
|
||||
*
|
||||
* This is called by bots, but the ID will be "BOT".
|
||||
*
|
||||
* @param client Client index.
|
||||
@ -114,11 +121,16 @@ forward OnClientAuthorized(client, const String:auth[]);
|
||||
/**
|
||||
* Called once a client is authorized and fully in-game, but
|
||||
* before admin checks are done. This can be used to override
|
||||
* the default admin checks for a client.
|
||||
* the default admin checks for a client. You should only use
|
||||
* this for overriding; use OnClientPostAdminCheck() instead
|
||||
* if you want notification.
|
||||
*
|
||||
* Note: If handled/blocked, PostAdminCheck must be signalled
|
||||
* manually via NotifyPostAdminCheck().
|
||||
*
|
||||
* This callback is gauranteed to occur on all clients, and always
|
||||
* after each OnClientPutInServer() call.
|
||||
*
|
||||
* @param client Client index.
|
||||
* @return Plugin_Handled to block admin checks.
|
||||
*/
|
||||
@ -128,6 +140,9 @@ forward Action:OnClientPreAdminCheck(client);
|
||||
* Called once a client is authorized and fully in-game, and
|
||||
* after all post-connection authorizations have been performed.
|
||||
*
|
||||
* This callback is gauranteed to occur on all clients, and always
|
||||
* after each OnClientPutInServer() call.
|
||||
*
|
||||
* @param client Client index.
|
||||
* @noreturn
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user