From 5b34923352e0c1917dfa8112bdfe8e6fc2f0c780 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Sun, 12 Jan 2020 18:34:08 +0100 Subject: [PATCH] Fix node numbers being used in place of player numbers --- src/d_clisrv.c | 22 +++++++++++----------- src/d_clisrv.h | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 188304fda..86cc1c28c 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1343,11 +1343,11 @@ static void SV_SendPlayerInfo(INT32 node) { if (!playeringame[i]) { - netbuffer->u.playerinfo[i].node = 255; // This slot is empty. + netbuffer->u.playerinfo[i].num = 255; // This slot is empty. continue; } - netbuffer->u.playerinfo[i].node = i; + netbuffer->u.playerinfo[i].num = i; strncpy(netbuffer->u.playerinfo[i].name, (const char *)&player_names[i], MAXPLAYERNAME+1); netbuffer->u.playerinfo[i].name[MAXPLAYERNAME] = '\0'; @@ -4113,7 +4113,7 @@ static void HandlePacketFromPlayer(SINT8 node) if (server) { UINT8 buf[2]; - buf[0] = (UINT8)node; + buf[0] = (UINT8)netconsole; buf[1] = KICK_MSG_CON_FAIL; SendNetXCmd(XD_KICK, &buf, 2); } @@ -4138,7 +4138,7 @@ static void HandlePacketFromPlayer(SINT8 node) if (server) { UINT8 buf[2]; - buf[0] = (UINT8)node; + buf[0] = (UINT8)netconsole; buf[1] = KICK_MSG_CON_FAIL; SendNetXCmd(XD_KICK, &buf, 2); } @@ -4204,8 +4204,8 @@ static void HandlePacketFromPlayer(SINT8 node) if (server) { - char buf[2]; - buf[0] = (char)node; + UINT8 buf[2]; + buf[0] = (UINT8)netconsole; buf[1] = KICK_MSG_CON_FAIL; SendNetXCmd(XD_KICK, &buf, 2); } @@ -4223,8 +4223,8 @@ static void HandlePacketFromPlayer(SINT8 node) if (server) { - char buf[2]; - buf[0] = (char)node; + UINT8 buf[2]; + buf[0] = (UINT8)netconsole; buf[1] = KICK_MSG_CON_FAIL; SendNetXCmd(XD_KICK, &buf, 2); } @@ -4255,7 +4255,7 @@ static void HandlePacketFromPlayer(SINT8 node) if (server) { UINT8 buf[2]; - buf[0] = (UINT8)node; + buf[0] = (UINT8)netconsole; buf[1] = KICK_MSG_CON_FAIL; SendNetXCmd(XD_KICK, &buf, 2); } @@ -4806,11 +4806,11 @@ static inline void PingUpdate(void) if (pingtimeout[i] > cv_pingtimeout.value) // ok your net has been bad for too long, you deserve to die. { - char buf[2]; + UINT8 buf[2]; pingtimeout[i] = 0; - buf[0] = (char)i; + buf[0] = (UINT8)i; buf[1] = KICK_MSG_PING_HIGH; SendNetXCmd(XD_KICK, &buf, 2); } diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 4ba4ee0eb..a19b37fbc 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -375,7 +375,7 @@ typedef struct // Shorter player information for external use. typedef struct { - UINT8 node; + UINT8 num; char name[MAXPLAYERNAME+1]; UINT8 address[4]; // sending another string would run us up against MAXPACKETLENGTH UINT8 team;