From 063bf830ff72d87d20007ae1bc55012ff8eb1737 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 19 Jul 2024 14:38:38 +0200 Subject: [PATCH] make a packet to tell if a joined client is on saturn initial stuff works and seems to be vanilla compatible needs its own function and other things to be useful --- src/d_clisrv.c | 12 +++++++++++- src/d_clisrv.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 51067797b..973765bde 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -4656,6 +4656,8 @@ static void HandleConnect(SINT8 node) #ifdef JOININGAME if (nodewaiting[node]) { + netbuffer->packettype = PT_ISSATURN; + HSendPacket(node, false, 0, 0); if (node && newnode) { SV_SendSaveGame(node); // send a complete game state @@ -4979,6 +4981,11 @@ static void HandlePacketFromAwayNode(SINT8 node) break; /* FALLTHRU */ + case PT_ISSATURN: + CONS_Printf("hi im on saturn\n"); + client_is_saturn = true; + break; + default: DEBFILE(va("unknown packet received (%d) from unknown host\n",netbuffer->packettype)); Net_CloseConnection(node); @@ -5028,7 +5035,6 @@ static void HandlePacketFromPlayer(SINT8 node) tic_t realend, realstart; UINT8 *pak, *txtpak, numtxtpak; - txtpak = NULL; if (dedicated && node == 0) @@ -5489,6 +5495,10 @@ static void HandlePacketFromPlayer(SINT8 node) if (client) Got_Filetxpak(); break; + case PT_ISSATURN: + CONS_Printf("hi im on saturn\n"); + client_is_saturn = true; + break; default: DEBFILE(va("UNKNOWN PACKET TYPE RECEIVED %d from host %d\n", netbuffer->packettype, node)); diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 13c2bc353..6faf62d97 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -98,6 +98,7 @@ typedef enum PT_MOREFILESNEEDED, // Server, to client: "you need these (+ more on top of those)" PT_PING, // Packet sent to tell clients the other client's latency to server. + PT_ISSATURN, NUMPACKETTYPE } packettype_t;