Wacky attempt at not reopening nodes for D/Ced ackreting clients

This commit is contained in:
fickleheart 2019-03-25 22:22:25 -05:00
parent 32fd6dc834
commit 8c56f1aa0b
2 changed files with 20 additions and 4 deletions

View file

@ -1146,7 +1146,7 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen
//
boolean HGetPacket(void)
{
//boolean nodejustjoined;
boolean nodejustjoined;
// Get a packet from self
if (rebound_tail != rebound_head)
@ -1173,11 +1173,16 @@ boolean HGetPacket(void)
while(true)
{
//nodejustjoined = I_NetGet();
I_NetGet();
nodejustjoined = I_NetGet();
//I_NetGet();
if (doomcom->remotenode == -1) // No packet received
return false;
{
if (nodejustjoined) // _This_ means we did receive a packet, but either from a node we couldn't allocate or a gone player ackreting...
continue;
else
return false;
}
getbytes += packetheaderlength + doomcom->datalength; // For stat

View file

@ -624,6 +624,13 @@ static boolean SOCK_Get(void)
}
// not found
if (netbuffer->packettype == PT_NOTHING)
{
DEBFILE(va("Ackret received from disconnected address:%s, ignoring...\n", SOCK_AddrToStr(&fromaddress)));
doomcom->remotenode = -1; // no packet
return true;
}
// find a free slot
j = getfreenode();
if (j > 0)
@ -650,7 +657,11 @@ static boolean SOCK_Get(void)
return true;
}
else
{
DEBFILE("New node detected: No more free slots\n");
doomcom->remotenode = -1; // no packet
return true;
}
}
}