public void SendPing()
{
uint oldestUnacked = 0;
// Get the oldest NeedAck value, the first entry in the sorted dictionary
lock (NeedAck)
{
if (NeedAck.Count > 0)
{
SortedDictionary<uint, NetworkManager.OutgoingPacket>.KeyCollection.Enumerator en = NeedAck.Keys.GetEnumerator();
en.MoveNext();
oldestUnacked = en.Current;
}
}
//if (oldestUnacked != 0)
// Logger.DebugLog("Sending ping with oldestUnacked=" + oldestUnacked);
StartPingCheckPacket ping = new StartPingCheckPacket();
ping.PingID.PingID = Stats.LastPingID++;
ping.PingID.OldestUnacked = oldestUnacked;
ping.Header.Reliable = false;
SendPacket(ping, true);
Stats.LastPingSent = Environment.TickCount;
}