From d4c4f7610cdf7f11c040f779a44f32db49968c55 Mon Sep 17 00:00:00 2001 From: lidgren Date: Thu, 19 Aug 2010 08:05:25 +0000 Subject: [PATCH] throttling bug fixed --- Lidgren.Network/NetConnection.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Lidgren.Network/NetConnection.cs b/Lidgren.Network/NetConnection.cs index 6f7b187..e8a54cc 100644 --- a/Lidgren.Network/NetConnection.cs +++ b/Lidgren.Network/NetConnection.cs @@ -204,8 +204,14 @@ namespace Lidgren.Network double frameLength = now - m_lastSentUnsentMessages; if (m_throttleDebt > 0) m_throttleDebt -= (float)(frameLength * throttle); - m_lastSentUnsentMessages = now; } + else + { + // 0 = unlimited (but still respect throttlethreshold per iteration) + m_throttleDebt = 0; + } + + m_lastSentUnsentMessages = now; int mtu = m_peerConfiguration.m_maximumTransmissionUnit; bool useCoalescing = m_peerConfiguration.m_useMessageCoalescing;