From 7322d553ba6a832868fe9c70780ee6b09e94eee2 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 17 Feb 2025 18:05:30 +0100 Subject: [PATCH 1/2] Revert "Merge pull request #151 from Indev450/fixdupeacks" This reverts commit 1fabc14ac9c4b4dd7283aca19183b8cd3ca59185, reversing changes made to d9492eee282834066bd06e9fba96fca09582f772. --- src/d_net.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/d_net.c b/src/d_net.c index 6f43147b9..16156ca06 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -325,10 +325,10 @@ static void RemoveAck(INT32 i) } // We have got a packet, proceed the ack request and ack return -static int Processackpak(void) +static boolean Processackpak(void) { INT32 i; - int goodpacket = 0; + boolean goodpacket = true; node_t *node = &nodes[doomcom->remotenode]; // Received an ack return, so remove the ack in the list @@ -353,7 +353,7 @@ static int Processackpak(void) { DEBFILE(va("Discard(1) ack %d (duplicated)\n", ack)); duppacket++; - goodpacket = 1; // Discard packet (duplicate) + goodpacket = false; // Discard packet (duplicate) } else { @@ -363,10 +363,10 @@ static int Processackpak(void) { DEBFILE(va("Discard(2) ack %d (duplicated)\n", ack)); duppacket++; - goodpacket = 1; // Discard packet (duplicate) + goodpacket = false; // Discard packet (duplicate) break; } - if (goodpacket == 0) + if (goodpacket) { // Is a good packet so increment the acknowledge number, // Then search for a "hole" in the queue @@ -427,13 +427,12 @@ static int Processackpak(void) else // Buffer full discard packet, sender will resend it { // We can admit the packet but we will not detect the duplication after :( DEBFILE("no more freeackret\n"); - goodpacket = 2; + goodpacket = false; } } } } } - // return values: 0 = ok, 1 = duplicate, 2 = out of order return goodpacket; } #endif @@ -1160,7 +1159,6 @@ boolean HGetPacket(void) while(true) { //nodejustjoined = I_NetGet(); - int goodpacket; I_NetGet(); if (doomcom->remotenode == -1) // No packet received @@ -1205,15 +1203,8 @@ boolean HGetPacket(void) }*/ // Proceed the ack and ackreturn field - goodpacket = Processackpak(); - if (goodpacket != 0) - { - // resend the ACK in case the previous ACK didn't reach the client. - // prevents the client's netbuffer from locking up. - if (goodpacket == 1) - Net_SendAcks(doomcom->remotenode); + if (!Processackpak()) continue; // discarded (duplicated) - } // A packet with just ackreturn if (netbuffer->packettype == PT_NOTHING) From 75d69dc90ddef61b0c11aac67ea17895f13cbfa4 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 17 Feb 2025 20:54:37 +0100 Subject: [PATCH 2/2] skip a bunch of stuff in dedi/render_none --- src/d_main.c | 5 ++++- src/p_mobj.c | 4 ++++ src/p_tick.c | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index af25ae2ea..0bfda85a2 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -183,6 +183,9 @@ static void D_GamePadMenuScrollTicker(void) static SINT8 menuInputDelayTimer = 0; int key = 0; // butt-on output + if (dedicated) + return; + // wish i had a switch ono if (DPADUPSCROLL) key = KEY_UPARROW; @@ -214,7 +217,7 @@ static void D_DeviceLEDTick(void) UINT16 color[MAXSPLITSCREENPLAYERS]; UINT16 curcolor[MAXSPLITSCREENPLAYERS]; - if (I_NumJoys() == 0) + if (dedicated || I_NumJoys() == 0) { return; } diff --git a/src/p_mobj.c b/src/p_mobj.c index 77e65c24f..09f246a85 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6039,6 +6039,10 @@ static void P_KoopaThinker(mobj_t *koopa) // void P_RollPitchMobj(mobj_t* mobj) { + // we dont need this in dedi do we? + if (rendermode == render_none) + return; + if (P_MobjWasRemoved(mobj)) return; diff --git a/src/p_tick.c b/src/p_tick.c index e9ea16ed0..5a55d23e3 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -373,7 +373,7 @@ static void P_DeviceRumbleTick(void) { UINT8 i; - if (I_NumJoys() == 0 || gamestate != GS_LEVEL) + if (dedicated || I_NumJoys() == 0 || gamestate != GS_LEVEL) { return; } @@ -503,6 +503,9 @@ static inline void P_ResetSpriteStuff(void) { thinker_t *th; + if (rendermode == render_none) + return; + for (th = thinkercap.next; th != &thinkercap; th = th->next) { mobj_t *mo;