fixed a bug where player inputs were parsed too late for BanClient()

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401431
This commit is contained in:
David Anderson 2007-09-14 02:20:23 +00:00
parent f0202a67a5
commit c230444274

View File

@ -305,18 +305,10 @@ static cell_t BanClient(IPluginContext *pContext, const cell_t *params)
g_pOnBanClient->Execute(NULL);
}
if ((ban_flags & BANFLAG_NOKICK) != BANFLAG_NOKICK)
/* Sanitize the kick message */
if (kick_message[0] == '\0')
{
/* Build a kick message */
const char *kick_message = "";
pContext->LocalToString(params[5], (char **)&kick_message);
if (kick_message[0] == '\0')
{
kick_message = "Kicked";
}
/* Disconnect the client now */
pClient->Disconnect("%s", kick_message);
kick_message = "Kicked";
}
if ((ban_flags & BANFLAG_IP) == BANFLAG_IP)
@ -337,6 +329,12 @@ static cell_t BanClient(IPluginContext *pContext, const cell_t *params)
"addip %d %s\n",
ban_time,
ip);
/* Kick, then ban */
if ((ban_flags & BANFLAG_NOKICK) != BANFLAG_NOKICK)
{
pClient->Disconnect("%s", kick_message);
}
engine->ServerCommand(command);
/* Physically write the ban */
@ -355,6 +353,12 @@ static cell_t BanClient(IPluginContext *pContext, const cell_t *params)
"banid %d %s\n",
ban_time,
pPlayer->GetAuthString());
/* Kick, then ban */
if ((ban_flags & BANFLAG_NOKICK) != BANFLAG_NOKICK)
{
pClient->Disconnect("%s", kick_message);
}
engine->ServerCommand(command);
/* Physically write the ban if it's permanent */