You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-06 02:11:06 +09:00
Fixed maximum handshake attempts one-off error
Fixed better disconnect messages when not yet fully connected (aborting connection attempt)
This commit is contained in:
@@ -59,7 +59,7 @@ namespace Lidgren.Network
|
||||
|
||||
if (now - m_lastHandshakeSendTime > m_peerConfiguration.m_resendHandshakeInterval)
|
||||
{
|
||||
if (m_handshakeAttempts > m_peerConfiguration.m_maximumHandshakeAttempts)
|
||||
if (m_handshakeAttempts >= m_peerConfiguration.m_maximumHandshakeAttempts)
|
||||
{
|
||||
// failed to connect
|
||||
ExecuteDisconnect("Failed to establish connection - no response from remote host", true);
|
||||
@@ -431,6 +431,7 @@ namespace Lidgren.Network
|
||||
if (m_status != NetConnectionStatus.Disconnected && m_status != NetConnectionStatus.None)
|
||||
SetStatus(NetConnectionStatus.Disconnecting, byeMessage);
|
||||
|
||||
m_handshakeAttempts = 0;
|
||||
m_disconnectRequested = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user