You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-17 07:36:32 +09:00
UseMessageCoalescing fixed :-)
This commit is contained in:
@@ -205,23 +205,26 @@ namespace Lidgren.Network
|
|||||||
int msgPayloadLength = msg.LengthBytes;
|
int msgPayloadLength = msg.LengthBytes;
|
||||||
msg.m_lastSentTime = now;
|
msg.m_lastSentTime = now;
|
||||||
|
|
||||||
if (!useCoalescing || (ptr > 0 && (ptr + NetPeer.kMaxPacketHeaderSize + msgPayloadLength) > mtu))
|
if (ptr > 0)
|
||||||
{
|
{
|
||||||
// send packet and start new packet
|
if (!useCoalescing || ((ptr + NetPeer.kMaxPacketHeaderSize + msgPayloadLength) > mtu))
|
||||||
bool connectionReset;
|
|
||||||
m_owner.SendPacket(ptr, m_remoteEndpoint, numIncludedMessages, out connectionReset);
|
|
||||||
if (connectionReset)
|
|
||||||
{
|
{
|
||||||
// ouch! can't sent any more; lets disconnect
|
// send packet and start new packet
|
||||||
Disconnect(NetConstants.ConnResetMessage);
|
bool connectionReset;
|
||||||
ptr = 0;
|
m_owner.SendPacket(ptr, m_remoteEndpoint, numIncludedMessages, out connectionReset);
|
||||||
|
if (connectionReset)
|
||||||
|
{
|
||||||
|
// ouch! can't sent any more; lets disconnect
|
||||||
|
Disconnect(NetConstants.ConnResetMessage);
|
||||||
|
ptr = 0;
|
||||||
|
numIncludedMessages = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
m_statistics.PacketSent(ptr, numIncludedMessages);
|
||||||
numIncludedMessages = 0;
|
numIncludedMessages = 0;
|
||||||
break;
|
m_throttleDebt += ptr;
|
||||||
|
ptr = 0;
|
||||||
}
|
}
|
||||||
m_statistics.PacketSent(ptr, numIncludedMessages);
|
|
||||||
numIncludedMessages = 0;
|
|
||||||
m_throttleDebt += ptr;
|
|
||||||
ptr = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user