mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 09:11:48 +00:00
Loop through rebound packets until you found a good one or ran out of them
This commit is contained in:
parent
5a1fc6098e
commit
1078a642df
1 changed files with 17 additions and 12 deletions
|
@ -1124,6 +1124,10 @@ boolean HGetPacket(void)
|
|||
// Get a packet from self
|
||||
if (rebound_tail != rebound_head)
|
||||
{
|
||||
while (true) // loop until we found a valid packet, or we ran out of packets
|
||||
{ // provided MAXREBOUND is not all that large this shouldn't take too long
|
||||
if (rebound_tail == rebound_head)
|
||||
break; // just give up, none of them were any good somehow
|
||||
M_Memcpy(netbuffer, &reboundstore[rebound_tail], reboundsize[rebound_tail]);
|
||||
doomcom->datalength = reboundsize[rebound_tail];
|
||||
if (netbuffer->packettype == PT_NODETIMEOUT)
|
||||
|
@ -1134,13 +1138,14 @@ boolean HGetPacket(void)
|
|||
rebound_tail = (rebound_tail+1) % MAXREBOUND;
|
||||
|
||||
if (doomcom->remotenode == -1) // wait hang on what?
|
||||
return true; // there might still be packets from others though, so don't return false
|
||||
continue; // ignore it, look for the next packet
|
||||
#ifdef DEBUGFILE
|
||||
if (debugfile)
|
||||
DebugPrintpacket("GETLOCAL");
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!netgame)
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue