From 1cc15562421573ef53423df0b910bd100681b53c Mon Sep 17 00:00:00 2001 From: Paul Pacheco Date: Sun, 18 Oct 2020 10:28:50 -0500 Subject: [PATCH] fix: not enough messages move to receive queue this bug was not in the original kcp.c code, but it was in c# version --- kcp2k/Assets/kcp2k/kcp/Kcp.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kcp2k/Assets/kcp2k/kcp/Kcp.cs b/kcp2k/Assets/kcp2k/kcp/Kcp.cs index 50ff896e..5c4b2bd9 100755 --- a/kcp2k/Assets/kcp2k/kcp/Kcp.cs +++ b/kcp2k/Assets/kcp2k/kcp/Kcp.cs @@ -146,7 +146,7 @@ public int Receive(byte[] buffer, int index, int length) count = 0; foreach (Segment seg in rcv_buf) { - if (seg.sn == rcv_nxt && rcv_queue.Count + count < rcv_wnd) + if (seg.sn == rcv_nxt && rcv_queue.Count < rcv_wnd) { rcv_queue.Add(seg); rcv_nxt++;