From 60e21381abfe2652fd417aeed8760acffc62e138 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 5 Jul 2017 16:20:23 +0100 Subject: [PATCH 1/6] Don't kick Tails! Also, a movement for the WRITESINT8 to prevent modification to buf if the function bails early. --- src/d_clisrv.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 312a308a1..5021f9a70 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2587,6 +2587,9 @@ static void Command_Kick(void) XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH]; UINT8 *p = buf; + if (!netgame) // Don't kick Tails in splitscreen! + return; + if (COM_Argc() == 1) { CONS_Printf(M_GetText("kick : kick a player\n")); @@ -2596,9 +2599,10 @@ static void Command_Kick(void) if (server || adminplayer == consoleplayer) { const SINT8 pn = nametonum(COM_Argv(1)); - WRITESINT8(p, pn); + if (pn == -1 || pn == 0) return; + // Special case if we are trying to kick a player who is downloading the game state: // trigger a timeout instead of kicking them, because a kick would only // take effect after they have finished downloading @@ -2607,6 +2611,9 @@ static void Command_Kick(void) Net_ConnectionTimeout(playernode[pn]); return; } + + WRITESINT8(p, pn); + if (COM_Argc() == 2) { WRITEUINT8(p, KICK_MSG_GO_AWAY); From 9a1e1180ff8479b59dff12cc77159b92d52d0bf1 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 5 Jul 2017 16:29:21 +0100 Subject: [PATCH 2/6] Also account for bans, pff. --- src/d_clisrv.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 5021f9a70..3fdd96522 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2525,6 +2525,9 @@ static void Command_Nodes(void) static void Command_Ban(void) { + if (!netgame) // Don't kick Tails in splitscreen! + return; + if (COM_Argc() == 1) { CONS_Printf(M_GetText("Ban : ban and kick a player\n")); @@ -2540,8 +2543,9 @@ static void Command_Ban(void) if (pn == -1 || pn == 0) return; - else - WRITEUINT8(p, pn); + + WRITEUINT8(p, pn); + 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")); From aca7a574f82ceacb8a3be63b2267867a8e15c324 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 5 Jul 2017 17:05:39 +0100 Subject: [PATCH 3/6] Copy+paste st_stuff.c functions and macros to accurately draw SCORE/TIME on the tally screen like they are when actually playing the level --- src/y_inter.c | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 2fd37ff33..ff4b798f0 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -159,6 +159,20 @@ static void Y_CalculateMatchWinners(void); static void Y_FollowIntermission(void); static void Y_UnloadData(void); +// Stuff copy+pasted from st_stuff.c +static INT32 SCX(INT32 x) +{ + return FixedInt(FixedMul(x< Date: Wed, 5 Jul 2017 19:25:11 +0100 Subject: [PATCH 4/6] Display minutes in full, so 60:00 for instance displays as 60:00 and not 0:00 The normal HUD display while playing a level doesn't do this, only the tally screen does it for some reason --- src/y_inter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/y_inter.c b/src/y_inter.c index ff4b798f0..bfcb0f5b0 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -230,7 +230,7 @@ void Y_IntermissionDrawer(void) INT32 seconds, minutes, tictrn; seconds = G_TicsToSeconds(data.coop.tics); - minutes = G_TicsToMinutes(data.coop.tics, false); + minutes = G_TicsToMinutes(data.coop.tics, true); tictrn = G_TicsToCentiseconds(data.coop.tics); ST_DrawNumFromHud(HUD_MINUTES, minutes); // Minutes From e8df99c632ecdb91489b601d09e486870b38750f Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 5 Jul 2017 22:30:18 +0100 Subject: [PATCH 5/6] They didn't use V_HUDTRANS before and they probably shouldn't, my fault here --- src/y_inter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index bfcb0f5b0..acf1c6f2f 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -169,9 +169,9 @@ static INT32 SCY(INT32 z) return FixedInt(FixedMul(z< Date: Fri, 7 Jul 2017 22:40:00 +0100 Subject: [PATCH 6/6] Some more tweaks of my own: *Add CONS_Printf messages for !netgame checks *Arg count is checked first regardless of netgame status for both kick and ban, < 2 is checked instead of == 1 just in case these weren't called from console for some stupid reason? *Moved Command_Kick's buffer vars to within the code that actually does kicking stuff --- src/d_clisrv.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 3fdd96522..7c21d79fc 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2525,15 +2525,18 @@ static void Command_Nodes(void) static void Command_Ban(void) { - if (!netgame) // Don't kick Tails in splitscreen! - return; - - if (COM_Argc() == 1) + if (COM_Argc() < 2) { CONS_Printf(M_GetText("Ban : ban and kick a player\n")); return; } + if (!netgame) // Don't kick Tails in splitscreen! + { + CONS_Printf(M_GetText("This only works in a netgame.\n")); + return; + } + if (server || adminplayer == consoleplayer) { XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH]; @@ -2588,20 +2591,22 @@ static void Command_Ban(void) static void Command_Kick(void) { - XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH]; - UINT8 *p = buf; - - if (!netgame) // Don't kick Tails in splitscreen! - return; - - if (COM_Argc() == 1) + if (COM_Argc() < 2) { CONS_Printf(M_GetText("kick : kick a player\n")); return; } + if (!netgame) // Don't kick Tails in splitscreen! + { + CONS_Printf(M_GetText("This only works in a netgame.\n")); + return; + } + if (server || adminplayer == consoleplayer) { + XBOXSTATIC UINT8 buf[3 + MAX_REASONLENGTH]; + UINT8 *p = buf; const SINT8 pn = nametonum(COM_Argv(1)); if (pn == -1 || pn == 0)