Network/ENet: Add peer-side lag simulation
This commit is contained in:
@@ -100,13 +100,20 @@ namespace Nz
|
||||
static bool Initialize();
|
||||
static void Uninitialize();
|
||||
|
||||
struct PendingPacket
|
||||
struct PendingIncomingPacket
|
||||
{
|
||||
IpAddress from;
|
||||
NetPacket data;
|
||||
UInt32 deliveryTime;
|
||||
};
|
||||
|
||||
struct PendingOutgoingPacket
|
||||
{
|
||||
IpAddress to;
|
||||
NetPacket data;
|
||||
UInt32 deliveryTime;
|
||||
};
|
||||
|
||||
std::array<ENetProtocol, ENetConstants::ENetProtocol_MaximumPacketCommands> m_commands;
|
||||
std::array<NetBuffer, ENetConstants::ENetProtocol_MaximumPacketCommands * 2 + 1> m_buffers;
|
||||
std::array<UInt8, ENetConstants::ENetProtocol_MaximumMTU> m_packetData[2];
|
||||
@@ -123,7 +130,8 @@ namespace Nz
|
||||
std::size_t m_receivedDataLength;
|
||||
std::uniform_int_distribution<UInt16> m_packetDelayDistribution;
|
||||
std::vector<ENetPeer> m_peers;
|
||||
std::vector<PendingPacket> m_pendingPackets;
|
||||
std::vector<PendingIncomingPacket> m_pendingIncomingPackets;
|
||||
std::vector<PendingOutgoingPacket> m_pendingOutgoingPackets;
|
||||
UInt8* m_receivedData;
|
||||
Bitset<UInt64> m_dispatchQueue;
|
||||
MemoryPool m_packetPool;
|
||||
|
||||
Reference in New Issue
Block a user