1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-16 07:06:30 +09:00

timeout deadline initialized earlier

This commit is contained in:
lidgren
2010-12-22 22:11:56 +00:00
parent 57525d980c
commit e2b66aca41

View File

@@ -29,10 +29,13 @@ namespace Lidgren.Network
internal void InitializePing()
{
float now = (float)NetTime.Now;
// randomize ping sent time (0.25 - 1.0 x ping interval)
m_sentPingTime = (float)NetTime.Now;
m_sentPingTime = now;
m_sentPingTime -= (m_peerConfiguration.PingInterval * 0.25f); // delay ping for a little while
m_sentPingTime -= (NetRandom.Instance.NextSingle() * (m_peerConfiguration.PingInterval * 0.75f));
m_timeoutDeadline = now + (m_peerConfiguration.m_connectionTimeout * 2.0f); // initially allow a little more time
}
internal void SendPing()