1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-15 22:56:30 +09:00

Release build fixed for NetPeerSettingsWindow

ManyClients project excluded missing app.config file
Reduced number of calls to NetTime.Now when receiving multiple messages
Moved magic numbers to constants in NetConnection
This commit is contained in:
lidgren
2012-11-05 13:39:57 +00:00
parent 2cdb29a768
commit b6d2111380
5 changed files with 30 additions and 9 deletions

View File

@@ -11,6 +11,9 @@ namespace Lidgren.Network
[DebuggerDisplay("RemoteUniqueIdentifier={RemoteUniqueIdentifier} RemoteEndPoint={remoteEndPoint}")]
public partial class NetConnection
{
private const int m_infrequentEventsSkipFrames = 8; // number of heartbeats to skip checking for infrequent events (ping, timeout etc)
private const int m_messageCoalesceFrames = 3; // number of heartbeats to wait for more incoming messages before sending packet
internal NetPeer m_peer;
internal NetPeerConfiguration m_peerConfiguration;
internal NetConnectionStatus m_status;
@@ -138,7 +141,7 @@ namespace Lidgren.Network
NetException.Assert(m_status != NetConnectionStatus.InitiatedConnect && m_status != NetConnectionStatus.RespondedConnect);
if ((frameCounter % 5) == 0)
if ((frameCounter % m_infrequentEventsSkipFrames) == 0)
{
if (now > m_timeoutDeadline)
{
@@ -175,7 +178,7 @@ namespace Lidgren.Network
byte[] sendBuffer = m_peer.m_sendBuffer;
int mtu = m_currentMTU;
if ((frameCounter % 3) == 0) // coalesce a few frames
if ((frameCounter % m_messageCoalesceFrames) == 0) // coalesce a few frames
{
//
// send ack messages