Add ENet::GetTotalPacketReceived

This commit is contained in:
Lynix 2019-12-29 11:54:00 +01:00
parent 2dcf154553
commit 24cb8f6845
5 changed files with 12 additions and 0 deletions

View File

@ -210,6 +210,7 @@ Nazara Engine:
- Added physics function to control sleeping behavior
- String::Number is now locale-independent
- Added ENetPeer::GetTotalByte[Received|Sent]
- Added ENetPeer::GetTotalPacketSent
Nazara Development Kit:
- Added ImageWidget (#139)

View File

@ -58,6 +58,7 @@ namespace Nz
inline ENetPeerState GetState() const;
inline UInt64 GetTotalByteReceived() const;
inline UInt64 GetTotalByteSent() const;
inline UInt64 GetTotalPacketReceived() const;
inline UInt64 GetTotalPacketLost() const;
inline UInt64 GetTotalPacketSent() const;
@ -241,6 +242,7 @@ namespace Nz
UInt32 m_windowSize;
UInt64 m_totalByteReceived;
UInt64 m_totalByteSent;
UInt64 m_totalPacketReceived;
UInt64 m_totalPacketLost;
UInt64 m_totalPacketSent;
bool m_isSimulationEnabled;

View File

@ -72,6 +72,11 @@ namespace Nz
return m_totalByteSent;
}
inline UInt64 ENetPeer::GetTotalPacketReceived() const
{
return m_totalPacketReceived;
}
inline UInt64 ENetPeer::GetTotalPacketLost() const
{
return m_totalPacketLost;

View File

@ -658,6 +658,9 @@ namespace Nz
return commandError();
}
if (peer)
peer->m_totalPacketReceived++;
if (peer && (command->header.command & ENetProtocolFlag_Acknowledge) != 0)
{
UInt16 sentTime;

View File

@ -165,6 +165,7 @@ namespace Nz
m_eventData = 0;
m_totalByteReceived = 0;
m_totalByteSent = 0;
m_totalPacketReceived = 0;
m_totalPacketLost = 0;
m_totalPacketSent = 0;
m_totalWaitingData = 0;