Nazara/Network: Add GetTotalByte[Received|Sent]

This commit is contained in:
Lynix
2019-12-28 17:31:21 +01:00
parent 9f8e83087a
commit 56243f5a12
5 changed files with 23 additions and 1 deletions

View File

@@ -541,6 +541,7 @@ namespace Nz
{
peer->m_address = m_receivedAddress;
peer->m_incomingDataTotal += UInt32(m_receivedDataLength);
peer->m_totalByteReceived += UInt32(m_receivedDataLength);
}
auto commandError = [&]() -> bool

View File

@@ -163,6 +163,8 @@ namespace Nz
m_incomingUnsequencedGroup = 0;
m_outgoingUnsequencedGroup = 0;
m_eventData = 0;
m_totalByteReceived = 0;
m_totalByteSent = 0;
m_totalPacketLost = 0;
m_totalPacketSent = 0;
m_totalWaitingData = 0;
@@ -1085,6 +1087,7 @@ namespace Nz
acknowledgment.sentTime = sentTime;
m_outgoingDataTotal += sizeof(Acknowledgement);
m_totalByteSent += sizeof(Acknowledgement);
m_acknowledgements.emplace_back(acknowledgment);
@@ -1265,7 +1268,10 @@ namespace Nz
void ENetPeer::SetupOutgoingCommand(OutgoingCommand& outgoingCommand)
{
m_outgoingDataTotal += static_cast<UInt32>(ENetHost::GetCommandSize(outgoingCommand.command.header.command) + outgoingCommand.fragmentLength);
UInt32 commandSize = static_cast<UInt32>(ENetHost::GetCommandSize(outgoingCommand.command.header.command) + outgoingCommand.fragmentLength);
m_outgoingDataTotal += commandSize;
m_totalByteSent += commandSize;
if (outgoingCommand.command.header.channelID == 0xFF)
{