From 89ac3a14ba1e0514dee6da89dc7b65a7f6544d5a Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 3 Jan 2008 19:40:55 +0000 Subject: [PATCH] added amb1341 - OnClientPostAdminFilter --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401837 --- core/PlayerManager.cpp | 6 ++++++ plugins/include/clients.inc | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index dcee273e..302f8603 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -51,6 +51,7 @@ PlayerManager g_Players; bool g_OnMapStarted = false; IForward *PreAdminCheck = NULL; IForward *PostAdminCheck = NULL; +IForward *PostAdminFilter = NULL; const unsigned int *g_NumPlayersToAuth = NULL; int lifestate_offset = -1; List target_processors; @@ -130,6 +131,7 @@ void PlayerManager::OnSourceModAllInitialized() PreAdminCheck = g_Forwards.CreateForward("OnClientPreAdminCheck", ET_Event, 1, p1); PostAdminCheck = g_Forwards.CreateForward("OnClientPostAdminCheck", ET_Ignore, 1, p1); + PostAdminFilter = g_Forwards.CreateForward("OnClientPostAdminFilter", ET_Ignore, 1, p1); } void PlayerManager::OnSourceModShutdown() @@ -155,6 +157,7 @@ void PlayerManager::OnSourceModShutdown() g_Forwards.ReleaseForward(PreAdminCheck); g_Forwards.ReleaseForward(PostAdminCheck); + g_Forwards.ReleaseForward(PostAdminFilter); delete [] m_Players; } @@ -1374,6 +1377,9 @@ void CPlayer::NotifyPostAdminChecks() pListener->OnClientPostAdminCheck(m_iIndex); } + PostAdminFilter->PushCell(m_iIndex); + PostAdminFilter->Execute(NULL); + PostAdminCheck->PushCell(m_iIndex); PostAdminCheck->Execute(NULL); } diff --git a/plugins/include/clients.inc b/plugins/include/clients.inc index 69d90587..29d6ac5b 100644 --- a/plugins/include/clients.inc +++ b/plugins/include/clients.inc @@ -136,6 +136,23 @@ forward OnClientAuthorized(client, const String:auth[]); */ forward Action:OnClientPreAdminCheck(client); +/** + * Called directly before OnClientPostAdminCheck() as a method to + * alter administrative permissions before plugins perform final + * post-connect operations. + * + * In general, do not use this function unless you are specifically + * attempting to change access permissions. Use OnClientPostAdminCheck() + * instead if you simply want to perform post-connect authorization + * routines. + * + * See OnClientPostAdminCheck() for more information. + * + * @param client Client index. + * @noreturn + */ +forward OnClientPostAdminFilter(client); + /** * Called once a client is authorized and fully in-game, and * after all post-connection authorizations have been performed.