mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-26 12:21:19 +00:00
Merge branch 'admin-ban-fix' into 'next'
Admin ban fix Okay, THIS time admin bans should work properly. Turns out the relevant code for banning did not properly consider the case of admins doing the banning, at least until now. Unlike my last attempt at fixing admin bans (!165), this one would require both host and admin to have the fix exe assuming everyone else would be using 2.1.17, so I'm merging to next instead of master. See merge request !167
This commit is contained in:
commit
18fa73ba05
1 changed files with 8 additions and 5 deletions
|
@ -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)
|
||||
|
@ -2696,12 +2697,14 @@ 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]))
|
||||
{
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue