1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-06 10:21:09 +09:00

Fix for unreliable sequenced channels. If you sent too many messages rapidly that get dropped along the wire messages would stop being enqueued.

This commit is contained in:
lidgren
2014-05-31 17:05:42 +00:00
parent fbddaf8962
commit 1de702e5ff
2 changed files with 2 additions and 5 deletions

View File

@@ -52,10 +52,7 @@ namespace Lidgren.Network
internal override NetSendResult Enqueue(NetOutgoingMessage message)
{
m_queuedSends.Enqueue(message);
int queueLen = m_queuedSends.Count;
int left = m_windowSize - ((m_sendStart + NetConstants.NumSequenceNumbers) - m_windowStart) % NetConstants.NumSequenceNumbers;
if (queueLen <= left)
if (m_queuedSends.Count <= GetAllowedSends())
return NetSendResult.Sent;
return NetSendResult.Queued;
}