diff --git a/src/d_net.c b/src/d_net.c index acbd34be..2562de9a 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -364,10 +364,7 @@ static boolean Processackpak(void) UINT8 ack = netbuffer->ack; getackpacket++; - if (cmpack(ack, node->firstacktosend) <= 0 - // UGLY PROBABLY-BAD HACK: If we get PT_CLIENTJOIN, assume this is an in-order packet? - && netbuffer->packettype != PT_CLIENTJOIN - ) + if (cmpack(ack, node->firstacktosend) <= 0) { DEBFILE(va("Discard(1) ack %d (duplicated)\n", ack)); duppacket++; @@ -390,10 +387,6 @@ static boolean Processackpak(void) // Then search for a "hole" in the queue UINT8 nextfirstack = (UINT8)(node->firstacktosend + 1); - // UGLY PROBABLY-BAD HACK: If we get PT_CLIENTJOIN, assume this is an in-order packet? - if (netbuffer->packettype == PT_CLIENTJOIN) - node->firstacktosend = (UINT8)((ack-1+MAXACKTOSEND) % MAXACKTOSEND); - if (!nextfirstack) nextfirstack = 1; @@ -1214,6 +1207,10 @@ boolean HGetPacket(void) continue; } + // UGLY PROBABLY-BAD HACK: If we get PT_CLIENTJOIN, assume this is an in-order packet? + if (netbuffer->packettype == PT_CLIENTJOIN) + nodes[doomcom->remotenode].firstacktosend = (UINT8)((netbuffer->ack-1+MAXACKTOSEND) % MAXACKTOSEND); + if (netbuffer->ack > 1 && !(server && netbuffer->packettype == PT_CLIENTJOIN)) { DEBFILE("New node sent a packet with an out-of-sequence ack. Ghost connection? Ignoring...\n");