mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-29 05:41:02 +00:00
Alternate variant of ugly probably-bad hack
This commit is contained in:
parent
0911ec79d1
commit
b434eabf56
1 changed files with 5 additions and 8 deletions
13
src/d_net.c
13
src/d_net.c
|
@ -364,10 +364,7 @@ static boolean Processackpak(void)
|
||||||
UINT8 ack = netbuffer->ack;
|
UINT8 ack = netbuffer->ack;
|
||||||
getackpacket++;
|
getackpacket++;
|
||||||
|
|
||||||
if (cmpack(ack, node->firstacktosend) <= 0
|
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
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
DEBFILE(va("Discard(1) ack %d (duplicated)\n", ack));
|
DEBFILE(va("Discard(1) ack %d (duplicated)\n", ack));
|
||||||
duppacket++;
|
duppacket++;
|
||||||
|
@ -390,10 +387,6 @@ static boolean Processackpak(void)
|
||||||
// Then search for a "hole" in the queue
|
// Then search for a "hole" in the queue
|
||||||
UINT8 nextfirstack = (UINT8)(node->firstacktosend + 1);
|
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)
|
if (!nextfirstack)
|
||||||
nextfirstack = 1;
|
nextfirstack = 1;
|
||||||
|
|
||||||
|
@ -1214,6 +1207,10 @@ boolean HGetPacket(void)
|
||||||
continue;
|
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))
|
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");
|
DEBFILE("New node sent a packet with an out-of-sequence ack. Ghost connection? Ignoring...\n");
|
||||||
|
|
Loading…
Reference in a new issue