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