Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vincent Robinson
SRB2
Commits
1078a642
Commit
1078a642
authored
8 years ago
by
Monster Iestyn
Browse files
Options
Downloads
Patches
Plain Diff
Loop through rebound packets until you found a good one or ran out of them
parent
5a1fc609
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/d_net.c
+17
-12
17 additions, 12 deletions
src/d_net.c
with
17 additions
and
12 deletions
src/d_net.c
+
17
−
12
View file @
1078a642
...
@@ -1124,6 +1124,10 @@ boolean HGetPacket(void)
...
@@ -1124,6 +1124,10 @@ 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
{
// 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
]);
M_Memcpy
(
netbuffer
,
&
reboundstore
[
rebound_tail
],
reboundsize
[
rebound_tail
]);
doomcom
->
datalength
=
reboundsize
[
rebound_tail
];
doomcom
->
datalength
=
reboundsize
[
rebound_tail
];
if
(
netbuffer
->
packettype
==
PT_NODETIMEOUT
)
if
(
netbuffer
->
packettype
==
PT_NODETIMEOUT
)
...
@@ -1134,13 +1138,14 @@ boolean HGetPacket(void)
...
@@ -1134,13 +1138,14 @@ boolean HGetPacket(void)
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?
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
#ifdef DEBUGFILE
if
(
debugfile
)
if
(
debugfile
)
DebugPrintpacket
(
"GETLOCAL"
);
DebugPrintpacket
(
"GETLOCAL"
);
#endif
#endif
return
true
;
return
true
;
}
}
}
if
(
!
netgame
)
if
(
!
netgame
)
return
false
;
return
false
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment