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

Sequence numbers now stored in dictionary per connection to enable sending the same message reliable ordered message to several connections

This commit is contained in:
lidgren
2010-05-20 18:36:19 +00:00
parent 00edeaabf4
commit 046ca06ec6
11 changed files with 84 additions and 79 deletions

View File

@@ -59,15 +59,17 @@ namespace Lidgren.Network
internal void HandleIncomingPing(byte pingNumber)
{
double now = NetTime.Now;
// send pong
NetOutgoingMessage pong = m_owner.CreateMessage(1);
pong.m_type = NetMessageType.Library;
pong.m_libType = NetMessageLibraryType.Pong;
pong.Write((byte)pingNumber);
pong.Write(NetTime.Now);
pong.Write(now);
// send immediately
m_owner.SendImmediately(this, pong);
m_owner.SendImmediately(now, this, pong);
}
internal void HandleIncomingPong(double receiveNow, byte pingNumber, double remoteNetTime)
@@ -146,7 +148,7 @@ namespace Lidgren.Network
ping.m_libType = NetMessageLibraryType.Ping;
ping.Write((byte)m_lastSentPingNumber);
m_owner.SendImmediately(this, ping);
m_owner.SendImmediately(now, this, ping);
m_lastPingSendTime = NetTime.Now; // need exact number
m_nextPing = now + m_owner.Configuration.m_pingFrequency;