Network/ENet: More cleanup
This commit is contained in:
@@ -64,8 +64,6 @@ namespace Nz
|
||||
void AddToDispatchQueue(ENetPeer* peer);
|
||||
void RemoveFromDispatchQueue(ENetPeer* peer);
|
||||
|
||||
bool CheckTimeouts(ENetPeer* peer, ENetEvent* event);
|
||||
|
||||
bool DispatchIncomingCommands(ENetEvent* event);
|
||||
|
||||
bool HandleAcknowledge(ENetEvent* event, ENetPeer* peer, const ENetProtocol* command);
|
||||
|
||||
@@ -68,8 +68,10 @@ namespace Nz
|
||||
struct IncomingCommmand;
|
||||
struct OutgoingCommand;
|
||||
|
||||
// Protocol functions
|
||||
inline void ChangeState(ENetPeerState state);
|
||||
|
||||
bool CheckTimeouts(ENetEvent* event);
|
||||
|
||||
void DispatchState(ENetPeerState state);
|
||||
|
||||
void DispatchIncomingReliableCommands(Channel& channel);
|
||||
@@ -85,6 +87,7 @@ namespace Nz
|
||||
|
||||
bool QueueAcknowledgement(ENetProtocol* command, UInt16 sentTime);
|
||||
IncomingCommmand* QueueIncomingCommand(const ENetProtocol& command, const void* data, std::size_t dataLength, UInt32 flags, UInt32 fragmentCount);
|
||||
inline void QueueOutgoingCommand(ENetProtocol& command);
|
||||
void QueueOutgoingCommand(ENetProtocol& command, ENetPacketRef packet, UInt32 offset, UInt16 length);
|
||||
|
||||
void SetupOutgoingCommand(OutgoingCommand& outgoingCommand);
|
||||
|
||||
@@ -37,6 +37,11 @@ namespace Nz
|
||||
|
||||
m_state = state;
|
||||
}
|
||||
|
||||
inline void ENetPeer::QueueOutgoingCommand(ENetProtocol& command)
|
||||
{
|
||||
QueueOutgoingCommand(command, ENetPacketRef(), 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/Network/DebugOff.hpp>
|
||||
|
||||
@@ -267,6 +267,14 @@ namespace Nz
|
||||
|
||||
union NAZARA_PACKED ENetProtocol
|
||||
{
|
||||
ENetProtocol() = default;
|
||||
|
||||
ENetProtocol(UInt8 command, UInt8 channel)
|
||||
{
|
||||
header.command = command;
|
||||
header.channelID = channel;
|
||||
}
|
||||
|
||||
ENetProtocolCommandHeader header;
|
||||
ENetProtocolAcknowledge acknowledge;
|
||||
ENetProtocolBandwidthLimit bandwidthLimit;
|
||||
|
||||
Reference in New Issue
Block a user