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:
parent
f0202a67a5
commit
c230444274
@ -305,20 +305,12 @@ static cell_t BanClient(IPluginContext *pContext, const cell_t *params)
|
|||||||
g_pOnBanClient->Execute(NULL);
|
g_pOnBanClient->Execute(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((ban_flags & BANFLAG_NOKICK) != BANFLAG_NOKICK)
|
/* Sanitize the kick message */
|
||||||
{
|
|
||||||
/* Build a kick message */
|
|
||||||
const char *kick_message = "";
|
|
||||||
pContext->LocalToString(params[5], (char **)&kick_message);
|
|
||||||
if (kick_message[0] == '\0')
|
if (kick_message[0] == '\0')
|
||||||
{
|
{
|
||||||
kick_message = "Kicked";
|
kick_message = "Kicked";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Disconnect the client now */
|
|
||||||
pClient->Disconnect("%s", kick_message);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((ban_flags & BANFLAG_IP) == BANFLAG_IP)
|
if ((ban_flags & BANFLAG_IP) == BANFLAG_IP)
|
||||||
{
|
{
|
||||||
/* Get the IP address and strip the port */
|
/* Get the IP address and strip the port */
|
||||||
@ -337,6 +329,12 @@ static cell_t BanClient(IPluginContext *pContext, const cell_t *params)
|
|||||||
"addip %d %s\n",
|
"addip %d %s\n",
|
||||||
ban_time,
|
ban_time,
|
||||||
ip);
|
ip);
|
||||||
|
|
||||||
|
/* Kick, then ban */
|
||||||
|
if ((ban_flags & BANFLAG_NOKICK) != BANFLAG_NOKICK)
|
||||||
|
{
|
||||||
|
pClient->Disconnect("%s", kick_message);
|
||||||
|
}
|
||||||
engine->ServerCommand(command);
|
engine->ServerCommand(command);
|
||||||
|
|
||||||
/* Physically write the ban */
|
/* Physically write the ban */
|
||||||
@ -355,6 +353,12 @@ static cell_t BanClient(IPluginContext *pContext, const cell_t *params)
|
|||||||
"banid %d %s\n",
|
"banid %d %s\n",
|
||||||
ban_time,
|
ban_time,
|
||||||
pPlayer->GetAuthString());
|
pPlayer->GetAuthString());
|
||||||
|
|
||||||
|
/* Kick, then ban */
|
||||||
|
if ((ban_flags & BANFLAG_NOKICK) != BANFLAG_NOKICK)
|
||||||
|
{
|
||||||
|
pClient->Disconnect("%s", kick_message);
|
||||||
|
}
|
||||||
engine->ServerCommand(command);
|
engine->ServerCommand(command);
|
||||||
|
|
||||||
/* Physically write the ban if it's permanent */
|
/* Physically write the ban if it's permanent */
|
||||||
|
Loading…
Reference in New Issue
Block a user