From 1daf06858b856324ee1e44ae90f47ffe6bef0be6 Mon Sep 17 00:00:00 2001 From: Alug Date: Sat, 30 Dec 2023 21:41:33 +0100 Subject: [PATCH] Revert "(maybe?) fix net issues on server join" This reverts commit af40bdb11b7ba5c6ff1786f6fc9e62f64b591759. --- 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 27d352b4b..b0bb637c4 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -330,10 +330,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 @@ -358,7 +358,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 { @@ -368,10 +368,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 @@ -432,13 +432,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 @@ -1154,7 +1153,6 @@ boolean HGetPacket(void) while(true) { //nodejustjoined = I_NetGet(); - int goodpacket; I_NetGet(); if (doomcom->remotenode == -1) // No packet received @@ -1199,15 +1197,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)