From 4d589300f4e66ed0f30ddfd91a801882f32c16c4 Mon Sep 17 00:00:00 2001 From: Hanicef Date: Mon, 15 Jan 2024 21:01:36 +0100 Subject: [PATCH] Fix bans by remote admins corrupting banlist --- src/netcode/d_clisrv.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/netcode/d_clisrv.c b/src/netcode/d_clisrv.c index f4251ef08..0d5d3fa90 100644 --- a/src/netcode/d_clisrv.c +++ b/src/netcode/d_clisrv.c @@ -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));