Network/ENetPacket: Add OnAcknowledged signal
This commit is contained in:
parent
f290cf2f9e
commit
62702ec481
|
|
@ -11,6 +11,7 @@
|
|||
#include <Nazara/Network/NetPacket.hpp>
|
||||
#include <NazaraUtils/MemoryPool.hpp>
|
||||
#include <NazaraUtils/MovablePtr.hpp>
|
||||
#include <NazaraUtils/Signal.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
|
|
@ -37,6 +38,8 @@ namespace Nz
|
|||
NetPacket data;
|
||||
std::size_t poolIndex;
|
||||
std::size_t referenceCount = 0;
|
||||
|
||||
NazaraSignal(OnAcknowledged);
|
||||
};
|
||||
|
||||
struct NAZARA_NETWORK_API ENetPacketRef
|
||||
|
|
|
|||
|
|
@ -1029,7 +1029,10 @@ namespace Nz
|
|||
ENetProtocolCommand commandNumber = static_cast<ENetProtocolCommand>(currentCommand->command.header.command & ENetProtocolCommand_Mask);
|
||||
|
||||
if (currentCommand->packet && wasSent)
|
||||
{
|
||||
m_reliableDataInTransit -= currentCommand->fragmentLength;
|
||||
currentCommand->packet->OnAcknowledged();
|
||||
}
|
||||
|
||||
commandList->erase(currentCommand);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue