You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-15 06:36:30 +09:00
Fix for messages near MTU size could cause exception
This commit is contained in:
@@ -44,10 +44,9 @@ namespace Lidgren.Network
|
||||
|
||||
if (msg.m_isSent)
|
||||
throw new NetException("This message has already been sent! Use NetPeer.SendMessage() to send to multiple recipients efficiently");
|
||||
|
||||
msg.m_isSent = true;
|
||||
|
||||
int len = msg.LengthBytes;
|
||||
int len = 5 + msg.LengthBytes; // headers + length, faster than calling msg.GetEncodedSize
|
||||
if (len <= recipient.m_currentMTU)
|
||||
{
|
||||
Interlocked.Increment(ref msg.m_recyclingCount);
|
||||
|
||||
Reference in New Issue
Block a user