Skip to content

Commit

Permalink
fix: Fixed last packet resend not given enough time
Browse files Browse the repository at this point in the history
  • Loading branch information
TwoTenPvP committed Dec 18, 2019
1 parent 343c8dc commit ffefe21
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -609,14 +609,15 @@ public void InternalUpdate()
{
if (_sendSequencer[i].Fragments.Pointers[j] != null && ((PendingOutgoingFragment)_sendSequencer[i].Fragments.Pointers[j]).Alive)
{
if (((PendingOutgoingFragment)_sendSequencer[i].Fragments.Pointers[j]).Attempts > config.ReliabilityMaxResendAttempts)
{
// If they don't ack the message, disconnect them
connection.Disconnect(false);
return;
}
else if ((NetTime.Now - ((PendingOutgoingFragment)_sendSequencer[i].Fragments.Pointers[j]).LastSent).TotalMilliseconds > connection.SmoothRoundtrip * config.ReliabilityResendRoundtripMultiplier && (NetTime.Now - ((PendingOutgoingFragment)_sendSequencer[i].Fragments.Pointers[j]).LastSent).TotalMilliseconds > config.ReliabilityMinPacketResendDelay)
if ((NetTime.Now - ((PendingOutgoingFragment)_sendSequencer[i].Fragments.Pointers[j]).LastSent).TotalMilliseconds > connection.SmoothRoundtrip * config.ReliabilityResendRoundtripMultiplier && (NetTime.Now - ((PendingOutgoingFragment)_sendSequencer[i].Fragments.Pointers[j]).LastSent).TotalMilliseconds > config.ReliabilityMinPacketResendDelay)
{
if (((PendingOutgoingFragment)_sendSequencer[i].Fragments.Pointers[j]).Attempts > config.ReliabilityMaxResendAttempts)
{
// If they don't ack the message, disconnect them
connection.Disconnect(false);
return;
}

_sendSequencer[i].Fragments.Pointers[j] = new PendingOutgoingFragment()
{
Alive = true,
Expand Down

0 comments on commit ffefe21

Please sign in to comment.