Revert "(maybe?) fix net issues on server join"

This reverts commit af40bdb11b.
This commit is contained in:
Alug committed 2023-12-30 21:41:33 +01:00
1 parent a4e8ce7f01
commit 1daf06858b
1 file changed
+7 -16
+7 -16
View File
@@ -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)