Network/ENetPeer: Add total packet lost/sent counter

This commit is contained in:
Lynix 2017-01-28 17:17:42 +01:00
parent 34828929b2
commit 4e2a037d6b
3 changed files with 6 additions and 0 deletions

View File

@ -205,6 +205,8 @@ namespace Nz
UInt32 m_timeoutMaximum;
UInt32 m_timeoutMinimum;
UInt32 m_windowSize;
UInt64 m_totalPacketLost;
UInt64 m_totalPacketSent;
};
}

View File

@ -1320,6 +1320,7 @@ namespace Nz
}
++peer->m_packetsSent;
++peer->m_totalPacketSent;
++m_bufferCount;
++m_commandCount;
}

View File

@ -191,6 +191,8 @@ namespace Nz
m_incomingUnsequencedGroup = 0;
m_outgoingUnsequencedGroup = 0;
m_eventData = 0;
m_totalPacketLost = 0;
m_totalPacketSent = 0;
m_totalWaitingData = 0;
m_unsequencedWindow.fill(0);
@ -335,6 +337,7 @@ namespace Nz
m_reliableDataInTransit -= outgoingCommand->fragmentLength;
++m_packetsLost;
++m_totalPacketLost;
// http://lists.cubik.org/pipermail/enet-discuss/2014-May/002308.html
outgoingCommand->roundTripTimeout = m_roundTripTime + 4 * m_roundTripTimeVariance;