Fix bans by remote admins corrupting banlist

This commit is contained in:
Hanicef 2024-01-15 21:01:36 +01:00
parent c5bf6d07ed
commit 4d589300f4

View file

@ -415,16 +415,6 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
//CONS_Printf("\x82%s ", player_names[pnum]);
// If a verified admin banned someone, the server needs to know about it.
// If the playernum isn't zero (the server) then the server needs to record the ban.
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)
{
case KICK_MSG_GO_AWAY:
@ -500,6 +490,16 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
break;
}
// If a verified admin banned someone, the server needs to know about it.
// If the playernum isn't zero (the server) then the server needs to record the ban.
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(msg == KICK_MSG_CUSTOM_BAN ? reason : NULL);
}
if (pnum == consoleplayer)
{
LUA_HookBool(false, HOOK(GameQuit));