Make sure I_Ban and Ban_Add are only used by the server

Also make sure the server actually uses Ban_Add if an admin banned someone
This commit is contained in:
Monster Iestyn 2017-02-20 19:58:29 +00:00
parent 8a421a05d9
commit 7424df8180

View file

@ -2531,7 +2531,7 @@ static void Command_Ban(void)
return;
else
WRITEUINT8(p, pn);
if (I_Ban && !I_Ban(node))
if (server && I_Ban && !I_Ban(node)) // only the server is allowed to do this right now
{
CONS_Alert(CONS_WARNING, M_GetText("Too many bans! Geez, that's a lot of people you're excluding...\n"));
WRITEUINT8(p, KICK_MSG_GO_AWAY);
@ -2539,6 +2539,7 @@ static void Command_Ban(void)
}
else
{
if (server) // only the server is allowed to do this right now
Ban_Add(COM_Argv(2));
if (COM_Argc() == 2)
@ -2699,9 +2700,9 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
if (server && playernum && (msg == KICK_MSG_BANNED || msg == KICK_MSG_CUSTOM_BAN))
{
if (I_Ban && !I_Ban(playernode[(INT32)pnum]))
{
CONS_Alert(CONS_WARNING, M_GetText("Too many bans! Geez, that's a lot of people you're excluding...\n"));
}
else
Ban_Add(reason);
}
switch (msg)