From 8a421a05d9e9365d5bbfac54459794a497a2c4d5 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 10 Feb 2017 20:31:58 +0000 Subject: [PATCH 1/3] admin bans with custom ban messages should now be recognised by the server properly --- src/d_clisrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index f47f6637c..1b23ce95e 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2696,7 +2696,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum) // 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) + if (server && playernum && (msg == KICK_MSG_BANNED || msg == KICK_MSG_CUSTOM_BAN)) { if (I_Ban && !I_Ban(playernode[(INT32)pnum])) { From 7424df8180e4f7e69a79200e244bea7c902eaf92 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 20 Feb 2017 19:58:29 +0000 Subject: [PATCH 2/3] 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 --- src/d_clisrv.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 1b23ce95e..41c3ac342 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -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,7 +2539,8 @@ static void Command_Ban(void) } else { - Ban_Add(COM_Argv(2)); + 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) From 6efb15c6e8a9c48e2f0c739ecf166bf43558943a Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 20 Feb 2017 21:36:05 +0000 Subject: [PATCH 3/3] Fix Ban_Add usage for NONET --- src/d_clisrv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 41c3ac342..939d53dec 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2701,8 +2701,10 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum) { 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")); +#ifndef NONET else Ban_Add(reason); +#endif } switch (msg)