From f9bc6e5ce6b5cb603a17f0e1598c48722a0eacd7 Mon Sep 17 00:00:00 2001
From: Yukita Mayako <catgirl@goddess.moe>
Date: Mon, 22 Feb 2016 03:12:46 -0500
Subject: [PATCH] Removed newping and dumpconsistency, changed kick messages.

No more consistency failures.
---
 src/command.c  |   2 +-
 src/d_clisrv.c | 212 ++-----------------------------------------------
 src/d_clisrv.h |  38 ++++-----
 src/d_netcmd.c |  40 ++++------
 src/d_netcmd.h |   4 -
 src/doomdef.h  |   6 --
 src/hu_stuff.c |   4 +-
 7 files changed, 44 insertions(+), 262 deletions(-)

diff --git a/src/command.c b/src/command.c
index e10787f1b8..2813ff3f8e 100644
--- a/src/command.c
+++ b/src/command.c
@@ -1225,7 +1225,7 @@ static void Got_NetVar(UINT8 **p, INT32 playernum)
 			XBOXSTATIC UINT8 buf[2];
 
 			buf[0] = (UINT8)playernum;
-			buf[1] = KICK_MSG_CON_FAIL;
+			buf[1] = KICK_MSG_STOP_HACKING;
 			SendNetXCmd(XD_KICK, &buf, 2);
 		}
 		return;
diff --git a/src/d_clisrv.c b/src/d_clisrv.c
index 5b1fd6fce9..c45b252e1d 100644
--- a/src/d_clisrv.c
+++ b/src/d_clisrv.c
@@ -70,11 +70,6 @@ char motd[254], server_context[8]; // Message of the Day, Unique Context (even w
 // server specific vars
 UINT8 playernode[MAXPLAYERS];
 
-#ifdef NEWPING
-UINT16 pingmeasurecount = 1;
-UINT32 realpingtable[MAXPLAYERS]; //the base table of ping where an average will be sent to everyone.
-UINT32 playerpingtable[MAXPLAYERS]; //table of player latency values.
-#endif
 SINT8 nodetoplayer[MAXNETNODES];
 SINT8 nodetoplayer2[MAXNETNODES]; // say the numplayer for this node if any (splitscreen)
 UINT8 playerpernode[MAXNETNODES]; // used specialy for scplitscreen
@@ -340,7 +335,7 @@ static void ExtraDataTicker(void)
 							XBOXSTATIC UINT8 buf[3];
 
 							buf[0] = (UINT8)i;
-							buf[1] = KICK_MSG_CON_FAIL;
+							buf[1] = KICK_MSG_STOP_HACKING;
 							SendNetXCmd(XD_KICK, &buf, 2);
 							DEBFILE(va("player %d kicked [gametic=%u] reason as follows:\n", i, gametic));
 						}
@@ -829,49 +824,6 @@ static void SV_SendSaveGame(INT32 node)
 	save_p = NULL;
 }
 
-#ifdef DUMPCONSISTENCY
-#define TMPSAVENAME "badmath.sav"
-static consvar_t cv_dumpconsistency = {"dumpconsistency", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
-
-static void SV_SavedGame(void)
-{
-	size_t length;
-	UINT8 *savebuffer;
-	XBOXSTATIC char tmpsave[256];
-
-	if (!cv_dumpconsistency.value)
-		return;
-
-	sprintf(tmpsave, "%s" PATHSEP TMPSAVENAME, srb2home);
-
-	// first save it in a malloced buffer
-	save_p = savebuffer = (UINT8 *)malloc(SAVEGAMESIZE);
-	if (!save_p)
-	{
-		CONS_Alert(CONS_ERROR, M_GetText("No more free memory for savegame\n"));
-		return;
-	}
-
-	P_SaveNetGame();
-
-	length = save_p - savebuffer;
-	if (length > SAVEGAMESIZE)
-	{
-		free(savebuffer);
-		save_p = NULL;
-		I_Error("Savegame buffer overrun");
-	}
-
-	// then save it!
-	if (!FIL_WriteFile(tmpsave, savebuffer, length))
-		CONS_Printf(M_GetText("Didn't save %s for netgame"), tmpsave);
-
-	free(savebuffer);
-	save_p = NULL;
-}
-
-#undef  TMPSAVENAME
-#endif
 #define TMPSAVENAME "$$$.sav"
 
 
@@ -1965,7 +1917,7 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
 				nodetoplayer2[playernode[pnum]]);
 */
 		pnum = playernum;
-		msg = KICK_MSG_CON_FAIL;
+		msg = KICK_MSG_STOP_HACKING;
 	}
 
 	CONS_Printf("\x82%s ", player_names[pnum]);
@@ -1985,46 +1937,11 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
 		case KICK_MSG_GO_AWAY:
 			CONS_Printf(M_GetText("has been kicked (Go away)\n"));
 			break;
-#ifdef NEWPING
 		case KICK_MSG_PING_HIGH:
 			CONS_Printf(M_GetText("left the game (Broke ping limit)\n"));
 			break;
-#endif
-		case KICK_MSG_CON_FAIL:
-			CONS_Printf(M_GetText("left the game (Synch failure)\n"));
-
-			if (M_CheckParm("-consisdump")) // Helps debugging some problems
-			{
-				INT32 i;
-
-				CONS_Printf(M_GetText("Player kicked is #%d, dumping consistency...\n"), pnum);
-
-				for (i = 0; i < MAXPLAYERS; i++)
-				{
-					if (!playeringame[i])
-						continue;
-					CONS_Printf("-------------------------------------\n");
-					CONS_Printf("Player %d: %s\n", i, player_names[i]);
-					CONS_Printf("Skin: %d\n", players[i].skin);
-					CONS_Printf("Color: %d\n", players[i].skincolor);
-					CONS_Printf("Speed: %d\n",players[i].speed>>FRACBITS);
-					if (players[i].mo)
-					{
-						if (!players[i].mo->skin)
-							CONS_Printf("Mobj skin: NULL!\n");
-						else
-							CONS_Printf("Mobj skin: %s\n", ((skin_t *)players[i].mo->skin)->name);
-						CONS_Printf("Position: %d, %d, %d\n", players[i].mo->x, players[i].mo->y, players[i].mo->z);
-						if (!players[i].mo->state)
-							CONS_Printf("State: S_NULL\n");
-						else
-							CONS_Printf("State: %d\n", (statenum_t)(players[i].mo->state-states));
-					}
-					else
-						CONS_Printf("Mobj: NULL\n");
-					CONS_Printf("-------------------------------------\n");
-				}
-			}
+		case KICK_MSG_STOP_HACKING:
+			CONS_Printf(M_GetText("left the game (Hack attempted)\n"));
 			break;
 		case KICK_MSG_TIMEOUT:
 			CONS_Printf(M_GetText("left the game (Connection timeout)\n"));
@@ -2048,18 +1965,13 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum)
 
 	if (pnum == consoleplayer)
 	{
-#ifdef DUMPCONSISTENCY
-		if (msg == KICK_MSG_CON_FAIL) SV_SavedGame();
-#endif
 		D_QuitNetGame();
 		CL_Reset();
 		D_StartTitle();
-		if (msg == KICK_MSG_CON_FAIL)
-			M_StartMessage(M_GetText("Server closed connection\n(synch failure)\nPress ESC\n"), NULL, MM_NOTHING);
-#ifdef NEWPING
+		if (msg == KICK_MSG_STOP_HACKING) // You shouldn't have done that.
+			M_StartMessage(M_GetText("Server closed connection\n\nPress ESC\n"), NULL, MM_NOTHING);
 		else if (msg == KICK_MSG_PING_HIGH)
 			M_StartMessage(M_GetText("Server closed connection\n(Broke ping limit)\nPress ESC\n"), NULL, MM_NOTHING);
-#endif
 		else if (msg == KICK_MSG_BANNED)
 			M_StartMessage(M_GetText("You have been banned by the server\n\nPress ESC\n"), NULL, MM_NOTHING);
 		else if (msg == KICK_MSG_CUSTOM_KICK)
@@ -2107,9 +2019,6 @@ void D_ClientServerInit(void)
 	CV_RegisterVar(&cv_allownewplayer);
 	CV_RegisterVar(&cv_joinnextround);
 	CV_RegisterVar(&cv_showjoinaddress);
-#ifdef DUMPCONSISTENCY
-	CV_RegisterVar(&cv_dumpconsistency);
-#endif
 	Ban_Load_File(false);
 #endif
 
@@ -2263,7 +2172,7 @@ static void Got_AddPlayer(UINT8 **p, INT32 playernum)
 			XBOXSTATIC UINT8 buf[2];
 
 			buf[0] = (UINT8)playernum;
-			buf[1] = KICK_MSG_CON_FAIL;
+			buf[1] = KICK_MSG_STOP_HACKING;
 			SendNetXCmd(XD_KICK, &buf, 2);
 		}
 		return;
@@ -2820,35 +2729,6 @@ FILESTAMP
 				nodeingame[node] = false;
 				break;
 // -------------------------------------------- CLIENT RECEIVE ----------
-#ifdef NEWPING
-			case PT_PING:
-				// Only accept PT_PING from the server.
-				if (node != servernode)
-				{
-					CONS_Alert(CONS_WARNING, M_GetText("%s recieved from non-host %d\n"), "PT_PING", node);
-
-					if (server)
-					{
-						XBOXSTATIC char buf[2];
-						buf[0] = (char)node;
-						buf[1] = KICK_MSG_CON_FAIL;
-						SendNetXCmd(XD_KICK, &buf, 2);
-					}
-
-					break;
-				}
-
-				//Update client ping table from the server.
-				if (!server)
-				{
-					INT32 i;
-					for (i = 0; i < MAXNETNODES; i++)
-						if (playeringame[i])
-							playerpingtable[i] = (tic_t)netbuffer->u.pingtable[i];
-				}
-
-				break;
-#endif
 			case PT_SERVERCFG:
 				break;
 			case PT_FILEFRAGMENT:
@@ -2945,66 +2825,6 @@ void TryRunTics(tic_t realtics)
 		}
 }
 
-#ifdef NEWPING
-static inline void PingUpdate(void)
-{
-	INT32 i;
-	boolean laggers[MAXPLAYERS];
-	UINT8 numlaggers = 0;
-	memset(laggers, 0, sizeof(boolean) * MAXPLAYERS);
-
-	netbuffer->packettype = PT_PING;
-
-	//check for ping limit breakage.
-	if (cv_maxping.value)
-	{
-		for (i = 1; i < MAXNETNODES; i++)
-		{
-			if (playeringame[i] && (realpingtable[i] / pingmeasurecount > (unsigned)cv_maxping.value))
-			{
-				if (players[i].jointime > 30 * TICRATE)
-					laggers[i] = true;
-				numlaggers++;
-			}
-		}
-
-		//kick lagging players... unless everyone but the server's ping sucks.
-		//in that case, it is probably the server's fault.
-		if (numlaggers < D_NumPlayers() - 1)
-		{
-			for (i = 1; i < MAXNETNODES; i++)
-			{
-				if (playeringame[i] && laggers[i])
-				{
-					XBOXSTATIC char buf[2];
-
-					buf[0] = (char)i;
-					buf[1] = KICK_MSG_PING_HIGH;
-					SendNetXCmd(XD_KICK, &buf, 2);
-				}
-			}
-		}
-	}
-
-	//make the ping packet and clear server data for next one
-	for (i = 0; i < MAXNETNODES; i++)
-	{
-		netbuffer->u.pingtable[i] = realpingtable[i] / pingmeasurecount;
-		//server takes a snapshot of the real ping for display.
-		//otherwise, pings fluctuate a lot and would be odd to look at.
-		playerpingtable[i] = realpingtable[i] / pingmeasurecount;
-		realpingtable[i] = 0; //Reset each as we go.
-	}
-
-	//send out our ping packets
-	for (i = 0; i < MAXNETNODES; i++)
-		if (playeringame[i])
-			HSendPacket(i, true, 0, sizeof(INT32) * MAXPLAYERS);
-
-	pingmeasurecount = 1; //Reset count
-}
-#endif
-
 void NetUpdate(void)
 {
 	static tic_t gametime = 0;
@@ -3028,24 +2848,6 @@ void NetUpdate(void)
 
 	gametime = nowtime;
 
-	if (!(gametime % 255) && netgame && server)
-	{
-#ifdef NEWPING
-		PingUpdate();
-#endif
-	}
-
-#ifdef NEWPING
-	if (server)
-	{
-		// update node latency values so we can take an average later.
-		for (i = 0; i < MAXNETNODES; i++)
-			if (playeringame[i])
-				realpingtable[i] += G_TicsToMilliseconds(GetLag(i));
-		pingmeasurecount++;
-	}
-#endif
-
 	Local_Maketic(realtics); // make local tic, and call menu?
 
 FILESTAMP
diff --git a/src/d_clisrv.h b/src/d_clisrv.h
index 9b1c52bb88..5731350f36 100644
--- a/src/d_clisrv.h
+++ b/src/d_clisrv.h
@@ -56,9 +56,6 @@ typedef enum {
 
 	PT_CLIENTJOIN,    // Client wants to join; used in start game.
 	PT_NODETIMEOUT,   // Packet sent to self if the connection times out.
-#ifdef NEWPING
-	PT_PING           // Packet sent to tell clients the other client's latency to server.
-#endif
 } packettype_t;
 
 #if defined(_MSC_VER)
@@ -233,9 +230,6 @@ typedef struct
 		msaskinfo_pak msaskinfo;    //       22 bytes
 		plrinfo playerinfo[MAXPLAYERS]; // 1152 bytes
 		plrconfig playerconfig[MAXPLAYERS]; // (up to) 896 bytes
-#ifdef NEWPING
-		UINT32 pingtable[MAXPLAYERS]; //    128 bytes
-#endif
 	} u; // this is needed to pack diff packet types data together
 } ATTRPACK doomdata_t;
 
@@ -263,16 +257,23 @@ extern consvar_t cv_playbackspeed;
 #define FILETXHEADER ((size_t)((filetx_pak *)0)->data)
 #define BASESERVERTICSSIZE ((size_t)&(((doomdata_t *)0)->u.serverpak.cmds[0]))
 
-#define KICK_MSG_GO_AWAY     1
-#define KICK_MSG_CON_FAIL    2
-#define KICK_MSG_PLAYER_QUIT 3
-#define KICK_MSG_TIMEOUT     4
-#define KICK_MSG_BANNED      5
-#ifdef NEWPING
-#define KICK_MSG_PING_HIGH   6
-#endif
-#define KICK_MSG_CUSTOM_KICK 7
-#define KICK_MSG_CUSTOM_BAN  8
+typedef enum {
+	// Player left
+	KICK_MSG_PLAYER_QUIT,
+
+	// Generic kick/ban
+	KICK_MSG_GO_AWAY,
+	KICK_MSG_BANNED,
+
+	// Custom kick/ban
+	KICK_MSG_CUSTOM_KICK,
+	KICK_MSG_CUSTOM_BAN,
+
+	// Networking errors
+	KICK_MSG_TIMEOUT,
+	KICK_MSG_PING_HIGH,
+	KICK_MSG_STOP_HACKING
+} kickmsg_e;
 
 extern boolean server;
 extern boolean dedicated; // for dedicated server
@@ -282,11 +283,6 @@ extern SINT8 servernode;
 
 void Command_Ping_f(void);
 extern tic_t connectiontimeout;
-#ifdef NEWPING
-extern UINT16 pingmeasurecount;
-extern UINT32 realpingtable[MAXPLAYERS];
-extern UINT32 playerpingtable[MAXPLAYERS];
-#endif
 
 extern consvar_t cv_joinnextround, cv_allownewplayer, cv_maxplayers, cv_maxsend;
 
diff --git a/src/d_netcmd.c b/src/d_netcmd.c
index 6d9fb6b511..c0ab494a12 100644
--- a/src/d_netcmd.c
+++ b/src/d_netcmd.c
@@ -341,9 +341,6 @@ consvar_t cv_killingdead = {"killingdead", "Off", CV_NETVAR, CV_OnOff, NULL, 0,
 consvar_t cv_netstat = {"netstat", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; // show bandwidth statistics
 static CV_PossibleValue_t nettimeout_cons_t[] = {{TICRATE/7, "MIN"}, {60*TICRATE, "MAX"}, {0, NULL}};
 consvar_t cv_nettimeout = {"nettimeout", "525", CV_CALL|CV_SAVE, nettimeout_cons_t, NetTimeout_OnChange, 0, NULL, NULL, 0, 0, NULL};
-#ifdef NEWPING
-consvar_t cv_maxping = {"maxping", "0", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL};
-#endif
 // Intermission time Tails 04-19-2002
 static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NULL}};
 consvar_t cv_inttime = {"inttime", "20", CV_NETVAR, inttime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
@@ -523,9 +520,6 @@ void D_RegisterServerCommands(void)
 
 	CV_RegisterVar(&cv_skipmapcheck);
 	CV_RegisterVar(&cv_sleep);
-#ifdef NEWPING
-	CV_RegisterVar(&cv_maxping);
-#endif
 
 #ifdef SEENAMES
 	 CV_RegisterVar(&cv_allowseenames);
@@ -961,7 +955,7 @@ static void SetPlayerName(INT32 playernum, char *newname)
 			XBOXSTATIC UINT8 buf[2];
 
 			buf[0] = (UINT8)playernum;
-			buf[1] = KICK_MSG_CON_FAIL;
+			buf[1] = KICK_MSG_STOP_HACKING;
 			SendNetXCmd(XD_KICK, &buf, 2);
 		}
 	}
@@ -1292,7 +1286,7 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
 			CONS_Alert(CONS_WARNING, M_GetText("Illegal color change received from %s (team: %d), color: %d)\n"), player_names[playernum], p->ctfteam, p->skincolor);
 
 			buf[0] = (UINT8)playernum;
-			buf[1] = KICK_MSG_CON_FAIL;
+			buf[1] = KICK_MSG_STOP_HACKING;
 			SendNetXCmd(XD_KICK, &buf, 2);
 			return;
 		}
@@ -1708,7 +1702,7 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
 			XBOXSTATIC UINT8 buf[2];
 
 			buf[0] = (UINT8)playernum;
-			buf[1] = KICK_MSG_CON_FAIL;
+			buf[1] = KICK_MSG_STOP_HACKING;
 			SendNetXCmd(XD_KICK, &buf, 2);
 		}
 		return;
@@ -1824,7 +1818,7 @@ static void Got_Pause(UINT8 **cp, INT32 playernum)
 			XBOXSTATIC UINT8 buf[2];
 
 			buf[0] = (UINT8)playernum;
-			buf[1] = KICK_MSG_CON_FAIL;
+			buf[1] = KICK_MSG_STOP_HACKING;
 			SendNetXCmd(XD_KICK, &buf, 2);
 		}
 		return;
@@ -1904,7 +1898,7 @@ static void Got_Suicide(UINT8 **cp, INT32 playernum)
 			XBOXSTATIC UINT8 buf[2];
 
 			buf[0] = (UINT8)playernum;
-			buf[1] = KICK_MSG_CON_FAIL;
+			buf[1] = KICK_MSG_STOP_HACKING;
 			SendNetXCmd(XD_KICK, &buf, 2);
 		}
 		return;
@@ -1973,7 +1967,7 @@ static void Got_Clearscores(UINT8 **cp, INT32 playernum)
 			XBOXSTATIC UINT8 buf[2];
 
 			buf[0] = (UINT8)playernum;
-			buf[1] = KICK_MSG_CON_FAIL;
+			buf[1] = KICK_MSG_STOP_HACKING;
 			SendNetXCmd(XD_KICK, &buf, 2);
 		}
 		return;
@@ -2326,7 +2320,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
 			XBOXSTATIC UINT8 buf[2];
 
 			buf[0] = (UINT8)playernum;
-			buf[1] = KICK_MSG_CON_FAIL;
+			buf[1] = KICK_MSG_STOP_HACKING;
 			SendNetXCmd(XD_KICK, &buf, 2);
 		}
 	}
@@ -2341,7 +2335,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
 				XBOXSTATIC UINT8 buf[2];
 
 				buf[0] = (UINT8)playernum;
-				buf[1] = KICK_MSG_CON_FAIL;
+				buf[1] = KICK_MSG_STOP_HACKING;
 				SendNetXCmd(XD_KICK, &buf, 2);
 			}
 			return;
@@ -2380,7 +2374,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
 				XBOXSTATIC UINT8 buf[2];
 
 				buf[0] = (UINT8)playernum;
-				buf[1] = KICK_MSG_CON_FAIL;
+				buf[1] = KICK_MSG_STOP_HACKING;
 				SendNetXCmd(XD_KICK, &buf, 2);
 			}
 		}
@@ -2433,7 +2427,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
 		XBOXSTATIC UINT8 buf[2];
 
 		buf[0] = (UINT8)playernum;
-		buf[1] = KICK_MSG_CON_FAIL;
+		buf[1] = KICK_MSG_STOP_HACKING;
 		CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
 		SendNetXCmd(XD_KICK, &buf, 2);
 	}
@@ -2728,7 +2722,7 @@ static void Got_Verification(UINT8 **cp, INT32 playernum)
 			XBOXSTATIC UINT8 buf[2];
 
 			buf[0] = (UINT8)playernum;
-			buf[1] = KICK_MSG_CON_FAIL;
+			buf[1] = KICK_MSG_STOP_HACKING;
 			SendNetXCmd(XD_KICK, &buf, 2);
 		}
 		return;
@@ -2808,7 +2802,7 @@ static void Got_MotD_f(UINT8 **cp, INT32 playernum)
 			XBOXSTATIC UINT8 buf[2];
 
 			buf[0] = (UINT8)playernum;
-			buf[1] = KICK_MSG_CON_FAIL;
+			buf[1] = KICK_MSG_STOP_HACKING;
 			SendNetXCmd(XD_KICK, &buf, 2);
 		}
 
@@ -2871,7 +2865,7 @@ static void Got_RunSOCcmd(UINT8 **cp, INT32 playernum)
 			XBOXSTATIC UINT8 buf[2];
 
 			buf[0] = (UINT8)playernum;
-			buf[1] = KICK_MSG_CON_FAIL;
+			buf[1] = KICK_MSG_STOP_HACKING;
 			SendNetXCmd(XD_KICK, &buf, 2);
 		}
 		return;
@@ -3048,7 +3042,7 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum)
 		CONS_Alert(CONS_WARNING, M_GetText("Illegal addfile command received from %s\n"), player_names[playernum]);
 
 		buf[0] = (UINT8)playernum;
-		buf[1] = KICK_MSG_CON_FAIL;
+		buf[1] = KICK_MSG_STOP_HACKING;
 		SendNetXCmd(XD_KICK, &buf, 2);
 		return;
 	}
@@ -3088,7 +3082,7 @@ static void Got_Delfilecmd(UINT8 **cp, INT32 playernum)
 			XBOXSTATIC UINT8 buf[2];
 
 			buf[0] = (UINT8)playernum;
-			buf[1] = KICK_MSG_CON_FAIL;
+			buf[1] = KICK_MSG_STOP_HACKING;
 			SendNetXCmd(XD_KICK, &buf, 2);
 		}
 		return;
@@ -3121,7 +3115,7 @@ static void Got_Addfilecmd(UINT8 **cp, INT32 playernum)
 			XBOXSTATIC UINT8 buf[2];
 
 			buf[0] = (UINT8)playernum;
-			buf[1] = KICK_MSG_CON_FAIL;
+			buf[1] = KICK_MSG_STOP_HACKING;
 			SendNetXCmd(XD_KICK, &buf, 2);
 		}
 		return;
@@ -3740,7 +3734,7 @@ static void Got_ExitLevelcmd(UINT8 **cp, INT32 playernum)
 			XBOXSTATIC UINT8 buf[2];
 
 			buf[0] = (UINT8)playernum;
-			buf[1] = KICK_MSG_CON_FAIL;
+			buf[1] = KICK_MSG_STOP_HACKING;
 			SendNetXCmd(XD_KICK, &buf, 2);
 		}
 		return;
diff --git a/src/d_netcmd.h b/src/d_netcmd.h
index 31a7cf8186..4c0e2909ae 100644
--- a/src/d_netcmd.h
+++ b/src/d_netcmd.h
@@ -113,10 +113,6 @@ extern consvar_t cv_ringslinger, cv_soundtest;
 
 extern consvar_t cv_specialrings, cv_powerstones, cv_matchboxes, cv_competitionboxes;
 
-#ifdef NEWPING
-extern consvar_t cv_maxping;
-#endif
-
 extern consvar_t cv_skipmapcheck;
 
 extern consvar_t cv_sleep, cv_screenshot_option, cv_screenshot_folder;
diff --git a/src/doomdef.h b/src/doomdef.h
index 74bab9a467..95bce084ee 100644
--- a/src/doomdef.h
+++ b/src/doomdef.h
@@ -458,9 +458,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
 ///	Allows gravity changes in netgames, no questions asked.
 //#define NETGAME_GRAVITY
 
-///	Dumps the contents of a network save game upon consistency failure for debugging.
-//#define DUMPCONSISTENCY
-
 ///	Polyobject fake flat code
 #define POLYOBJECTS_PLANES
 
@@ -468,9 +465,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
 ///	\todo	Remove this define.
 #define BLUE_SPHERES // Blue spheres for future use.
 
-///	Improved way of dealing with ping values and a ping limit.
-#define NEWPING
-
 ///	See name of player in your crosshair
 #define SEENAMES
 
diff --git a/src/hu_stuff.c b/src/hu_stuff.c
index a5c4bb236c..df6bd64b46 100644
--- a/src/hu_stuff.c
+++ b/src/hu_stuff.c
@@ -487,7 +487,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
 			XBOXSTATIC UINT8 buf[2];
 
 			buf[0] = (UINT8)playernum;
-			buf[1] = KICK_MSG_CON_FAIL;
+			buf[1] = KICK_MSG_STOP_HACKING;
 			SendNetXCmd(XD_KICK, &buf, 2);
 		}
 		return;
@@ -507,7 +507,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
 					XBOXSTATIC char buf[2];
 
 					buf[0] = (char)playernum;
-					buf[1] = KICK_MSG_CON_FAIL;
+					buf[1] = KICK_MSG_STOP_HACKING;
 					SendNetXCmd(XD_KICK, &buf, 2);
 				}
 				return;
-- 
GitLab