Skip to content

Commit

Permalink
perf: don't drop acks, follow original C algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpach committed Oct 19, 2020
1 parent a1584e7 commit c0b5a12
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Assets/Mirror/Runtime/Transport/Kcp/Kcp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -536,12 +536,9 @@ void FlushAcknowledges(Segment seg)
{
MakeSpace(OVERHEAD);
AckItem ack = ackList[i];
if (ack.serialNumber >= rcv_nxt || ackList.Count - 1 == i)
{
seg.serialNumber = ack.serialNumber;
seg.timeStamp = ack.timestamp;
writeIndex += seg.Encode(buffer, writeIndex);
}
seg.serialNumber = ack.serialNumber;
seg.timeStamp = ack.timestamp;
writeIndex += seg.Encode(buffer, writeIndex);
}
ackList.Clear();
}
Expand Down

0 comments on commit c0b5a12

Please sign in to comment.