| enet.h | | enet.h | |
| | | | |
| skipping to change at line 27 | | skipping to change at line 27 | |
| #else | | #else | |
| #include "enet/unix.h" | | #include "enet/unix.h" | |
| #endif | | #endif | |
| | | | |
| #include "enet/types.h" | | #include "enet/types.h" | |
| #include "enet/protocol.h" | | #include "enet/protocol.h" | |
| #include "enet/list.h" | | #include "enet/list.h" | |
| #include "enet/callbacks.h" | | #include "enet/callbacks.h" | |
| | | | |
| #define ENET_VERSION_MAJOR 1 | | #define ENET_VERSION_MAJOR 1 | |
|
| #define ENET_VERSION_MINOR 2 | | #define ENET_VERSION_MINOR 3 | |
| #define ENET_VERSION_PATCH 5 | | #define ENET_VERSION_PATCH 0 | |
| #define ENET_VERSION_CREATE(major, minor, patch) (((major)<<16) | ((minor)<
<8) | (patch)) | | #define ENET_VERSION_CREATE(major, minor, patch) (((major)<<16) | ((minor)<
<8) | (patch)) | |
| #define ENET_VERSION ENET_VERSION_CREATE(ENET_VERSION_MAJOR, ENET_VERSION_M
INOR, ENET_VERSION_PATCH) | | #define ENET_VERSION ENET_VERSION_CREATE(ENET_VERSION_MAJOR, ENET_VERSION_M
INOR, ENET_VERSION_PATCH) | |
| | | | |
| typedef enet_uint32 ENetVersion; | | typedef enet_uint32 ENetVersion; | |
| | | | |
| typedef enum _ENetSocketType | | typedef enum _ENetSocketType | |
| { | | { | |
| ENET_SOCKET_TYPE_STREAM = 1, | | ENET_SOCKET_TYPE_STREAM = 1, | |
| ENET_SOCKET_TYPE_DATAGRAM = 2 | | ENET_SOCKET_TYPE_DATAGRAM = 2 | |
| } ENetSocketType; | | } ENetSocketType; | |
| | | | |
| skipping to change at line 221 | | skipping to change at line 221 | |
| ENET_PEER_FREE_RELIABLE_WINDOWS = 8 | | ENET_PEER_FREE_RELIABLE_WINDOWS = 8 | |
| }; | | }; | |
| | | | |
| typedef struct _ENetChannel | | typedef struct _ENetChannel | |
| { | | { | |
| enet_uint16 outgoingReliableSequenceNumber; | | enet_uint16 outgoingReliableSequenceNumber; | |
| enet_uint16 outgoingUnreliableSequenceNumber; | | enet_uint16 outgoingUnreliableSequenceNumber; | |
| enet_uint16 usedReliableWindows; | | enet_uint16 usedReliableWindows; | |
| enet_uint16 reliableWindows [ENET_PEER_RELIABLE_WINDOWS]; | | enet_uint16 reliableWindows [ENET_PEER_RELIABLE_WINDOWS]; | |
| enet_uint16 incomingReliableSequenceNumber; | | enet_uint16 incomingReliableSequenceNumber; | |
|
| enet_uint16 incomingUnreliableSequenceNumber; | | | |
| ENetList incomingReliableCommands; | | ENetList incomingReliableCommands; | |
| ENetList incomingUnreliableCommands; | | ENetList incomingUnreliableCommands; | |
| } ENetChannel; | | } ENetChannel; | |
| | | | |
| /** | | /** | |
| * An ENet peer which data packets may be sent or received from. | | * An ENet peer which data packets may be sent or received from. | |
| * | | * | |
| * No fields should be modified unless otherwise specified. | | * No fields should be modified unless otherwise specified. | |
| */ | | */ | |
| typedef struct _ENetPeer | | typedef struct _ENetPeer | |
| { | | { | |
| ENetListNode dispatchList; | | ENetListNode dispatchList; | |
| struct _ENetHost * host; | | struct _ENetHost * host; | |
| enet_uint16 outgoingPeerID; | | enet_uint16 outgoingPeerID; | |
| enet_uint16 incomingPeerID; | | enet_uint16 incomingPeerID; | |
|
| enet_uint32 sessionID; | | enet_uint32 connectID; | |
| | | enet_uint8 outgoingSessionID; | |
| | | enet_uint8 incomingSessionID; | |
| ENetAddress address; /**< Internet address of the peer */ | | ENetAddress address; /**< Internet address of the peer */ | |
| void * data; /**< Application private data, may be
freely modified */ | | void * data; /**< Application private data, may be
freely modified */ | |
| ENetPeerState state; | | ENetPeerState state; | |
| ENetChannel * channels; | | ENetChannel * channels; | |
| size_t channelCount; /**< Number of channels allocated for
communication with peer */ | | size_t channelCount; /**< Number of channels allocated for
communication with peer */ | |
| enet_uint32 incomingBandwidth; /**< Downstream bandwidth of the clien
t in bytes/second */ | | enet_uint32 incomingBandwidth; /**< Downstream bandwidth of the clien
t in bytes/second */ | |
| enet_uint32 outgoingBandwidth; /**< Upstream bandwidth of the client
in bytes/second */ | | enet_uint32 outgoingBandwidth; /**< Upstream bandwidth of the client
in bytes/second */ | |
| enet_uint32 incomingBandwidthThrottleEpoch; | | enet_uint32 incomingBandwidthThrottleEpoch; | |
| enet_uint32 outgoingBandwidthThrottleEpoch; | | enet_uint32 outgoingBandwidthThrottleEpoch; | |
| enet_uint32 incomingDataTotal; | | enet_uint32 incomingDataTotal; | |
| | | | |
| skipping to change at line 271 | | skipping to change at line 272 | |
| enet_uint32 packetThrottleEpoch; | | enet_uint32 packetThrottleEpoch; | |
| enet_uint32 packetThrottleAcceleration; | | enet_uint32 packetThrottleAcceleration; | |
| enet_uint32 packetThrottleDeceleration; | | enet_uint32 packetThrottleDeceleration; | |
| enet_uint32 packetThrottleInterval; | | enet_uint32 packetThrottleInterval; | |
| enet_uint32 lastRoundTripTime; | | enet_uint32 lastRoundTripTime; | |
| enet_uint32 lowestRoundTripTime; | | enet_uint32 lowestRoundTripTime; | |
| enet_uint32 lastRoundTripTimeVariance; | | enet_uint32 lastRoundTripTimeVariance; | |
| enet_uint32 highestRoundTripTimeVariance; | | enet_uint32 highestRoundTripTimeVariance; | |
| enet_uint32 roundTripTime; /**< mean round trip time (RTT),
in milliseconds, between sending a reliable packet and receiving its ackno
wledgement */ | | enet_uint32 roundTripTime; /**< mean round trip time (RTT),
in milliseconds, between sending a reliable packet and receiving its ackno
wledgement */ | |
| enet_uint32 roundTripTimeVariance; | | enet_uint32 roundTripTimeVariance; | |
|
| enet_uint16 mtu; | | enet_uint32 mtu; | |
| enet_uint32 windowSize; | | enet_uint32 windowSize; | |
| enet_uint32 reliableDataInTransit; | | enet_uint32 reliableDataInTransit; | |
| enet_uint16 outgoingReliableSequenceNumber; | | enet_uint16 outgoingReliableSequenceNumber; | |
| ENetList acknowledgements; | | ENetList acknowledgements; | |
| ENetList sentReliableCommands; | | ENetList sentReliableCommands; | |
| ENetList sentUnreliableCommands; | | ENetList sentUnreliableCommands; | |
| ENetList outgoingReliableCommands; | | ENetList outgoingReliableCommands; | |
| ENetList outgoingUnreliableCommands; | | ENetList outgoingUnreliableCommands; | |
| ENetList dispatchedCommands; | | ENetList dispatchedCommands; | |
| int needsDispatch; | | int needsDispatch; | |
| enet_uint16 incomingUnsequencedGroup; | | enet_uint16 incomingUnsequencedGroup; | |
| enet_uint16 outgoingUnsequencedGroup; | | enet_uint16 outgoingUnsequencedGroup; | |
| enet_uint32 unsequencedWindow [ENET_PEER_UNSEQUENCED_WINDOW_SIZE / 32]
; | | enet_uint32 unsequencedWindow [ENET_PEER_UNSEQUENCED_WINDOW_SIZE / 32]
; | |
|
| enet_uint32 disconnectData; | | enet_uint32 eventData; | |
| } ENetPeer; | | } ENetPeer; | |
| | | | |
|
| /** Callback that computes the checksum of the data held in buffers [0..buf | | /** An ENet packet compressor for compressing UDP packets before socket sen | |
| ferCount-1] */ | | ds or receives. | |
| | | */ | |
| | | typedef struct _ENetCompressor | |
| | | { | |
| | | /** Context data for the compressor. Must be non-NULL. */ | |
| | | void * context; | |
| | | /** Compresses from inBuffers[0:inBufferCount-1], containing inLimit byt | |
| | | es, to outData, outputting at most outLimit bytes. Should return 0 on failu | |
| | | re. */ | |
| | | size_t (ENET_CALLBACK * compress) (void * context, const ENetBuffer * in | |
| | | Buffers, size_t inBufferCount, size_t inLimit, enet_uint8 * outData, size_t | |
| | | outLimit); | |
| | | /** Decompresses from inData, containing inLimit bytes, to outData, outp | |
| | | utting at most outLimit bytes. Should return 0 on failure. */ | |
| | | size_t (ENET_CALLBACK * decompress) (void * context, const enet_uint8 * | |
| | | inData, size_t inLimit, enet_uint8 * outData, size_t outLimit); | |
| | | /** Destroys the context when compression is disabled or the host is des | |
| | | troyed. May be NULL. */ | |
| | | void (ENET_CALLBACK * destroy) (void * context); | |
| | | } ENetCompressor; | |
| | | | |
| | | /** Callback that computes the checksum of the data held in buffers[0:buffe | |
| | | rCount-1] */ | |
| typedef enet_uint32 (ENET_CALLBACK * ENetChecksumCallback) (const ENetBuffe
r * buffers, size_t bufferCount); | | typedef enet_uint32 (ENET_CALLBACK * ENetChecksumCallback) (const ENetBuffe
r * buffers, size_t bufferCount); | |
| | | | |
| /** An ENet host for communicating with peers. | | /** An ENet host for communicating with peers. | |
| * | | * | |
|
| * No fields should be modified. | | * No fields should be modified unless otherwise stated. | |
| | | | |
| @sa enet_host_create() | | @sa enet_host_create() | |
| @sa enet_host_destroy() | | @sa enet_host_destroy() | |
| @sa enet_host_connect() | | @sa enet_host_connect() | |
| @sa enet_host_service() | | @sa enet_host_service() | |
| @sa enet_host_flush() | | @sa enet_host_flush() | |
| @sa enet_host_broadcast() | | @sa enet_host_broadcast() | |
|
| @sa enet_host_checksum() | | @sa enet_host_compress() | |
| | | @sa enet_host_compress_with_range_coder() | |
| @sa enet_host_channel_limit() | | @sa enet_host_channel_limit() | |
| @sa enet_host_bandwidth_limit() | | @sa enet_host_bandwidth_limit() | |
| @sa enet_host_bandwidth_throttle() | | @sa enet_host_bandwidth_throttle() | |
| */ | | */ | |
| typedef struct _ENetHost | | typedef struct _ENetHost | |
| { | | { | |
| ENetSocket socket; | | ENetSocket socket; | |
| ENetAddress address; /**< Internet address
of the host */ | | ENetAddress address; /**< Internet address
of the host */ | |
| enet_uint32 incomingBandwidth; /**< downstream bandwi
dth of the host */ | | enet_uint32 incomingBandwidth; /**< downstream bandwi
dth of the host */ | |
| enet_uint32 outgoingBandwidth; /**< upstream bandwidt
h of the host */ | | enet_uint32 outgoingBandwidth; /**< upstream bandwidt
h of the host */ | |
| enet_uint32 bandwidthThrottleEpoch; | | enet_uint32 bandwidthThrottleEpoch; | |
| enet_uint32 mtu; | | enet_uint32 mtu; | |
|
| | | enet_uint32 randomSeed; | |
| int recalculateBandwidthLimits; | | int recalculateBandwidthLimits; | |
| ENetPeer * peers; /**< array of peers al
located for this host */ | | ENetPeer * peers; /**< array of peers al
located for this host */ | |
| size_t peerCount; /**< number of peers a
llocated for this host */ | | size_t peerCount; /**< number of peers a
llocated for this host */ | |
| size_t channelLimit; /**< maximum number of
channels allowed for connected peers */ | | size_t channelLimit; /**< maximum number of
channels allowed for connected peers */ | |
| enet_uint32 serviceTime; | | enet_uint32 serviceTime; | |
| ENetList dispatchQueue; | | ENetList dispatchQueue; | |
| int continueSending; | | int continueSending; | |
| size_t packetSize; | | size_t packetSize; | |
| enet_uint16 headerFlags; | | enet_uint16 headerFlags; | |
| ENetProtocol commands [ENET_PROTOCOL_MAXIMUM_PACKET_COMMANDS]; | | ENetProtocol commands [ENET_PROTOCOL_MAXIMUM_PACKET_COMMANDS]; | |
| size_t commandCount; | | size_t commandCount; | |
| ENetBuffer buffers [ENET_BUFFER_MAXIMUM]; | | ENetBuffer buffers [ENET_BUFFER_MAXIMUM]; | |
| size_t bufferCount; | | size_t bufferCount; | |
|
| ENetChecksumCallback checksum; | | ENetChecksumCallback checksum; /**< callback the user | |
| | | can set to enable packet checksums for this host */ | |
| | | ENetCompressor compressor; | |
| | | enet_uint8 packetData [2][ENET_PROTOCOL_MAXIMUM_MTU]; | |
| ENetAddress receivedAddress; | | ENetAddress receivedAddress; | |
|
| enet_uint8 receivedData [ENET_PROTOCOL_MAXIMUM_MTU]; | | enet_uint8 * receivedData; | |
| size_t receivedDataLength; | | size_t receivedDataLength; | |
| enet_uint32 totalSentData; /**< total data sent,
user should reset to 0 as needed to prevent overflow */ | | enet_uint32 totalSentData; /**< total data sent,
user should reset to 0 as needed to prevent overflow */ | |
| enet_uint32 totalSentPackets; /**< total UDP packets
sent, user should reset to 0 as needed to prevent overflow */ | | enet_uint32 totalSentPackets; /**< total UDP packets
sent, user should reset to 0 as needed to prevent overflow */ | |
| enet_uint32 totalReceivedData; /**< total data receiv
ed, user should reset to 0 as needed to prevent overflow */ | | enet_uint32 totalReceivedData; /**< total data receiv
ed, user should reset to 0 as needed to prevent overflow */ | |
| enet_uint32 totalReceivedPackets; /**< total UDP packets
received, user should reset to 0 as needed to prevent overflow */ | | enet_uint32 totalReceivedPackets; /**< total UDP packets
received, user should reset to 0 as needed to prevent overflow */ | |
| } ENetHost; | | } ENetHost; | |
| | | | |
| /** | | /** | |
| * An ENet event type, as specified in @ref ENetEvent. | | * An ENet event type, as specified in @ref ENetEvent. | |
| */ | | */ | |
| | | | |
| skipping to change at line 479 | | skipping to change at line 498 | |
| */ | | */ | |
| ENET_API int enet_address_get_host (const ENetAddress * address, char * hos
tName, size_t nameLength); | | ENET_API int enet_address_get_host (const ENetAddress * address, char * hos
tName, size_t nameLength); | |
| | | | |
| /** @} */ | | /** @} */ | |
| | | | |
| ENET_API ENetPacket * enet_packet_create (const void *, size_t, enet_uint32
); | | ENET_API ENetPacket * enet_packet_create (const void *, size_t, enet_uint32
); | |
| ENET_API void enet_packet_destroy (ENetPacket *); | | ENET_API void enet_packet_destroy (ENetPacket *); | |
| ENET_API int enet_packet_resize (ENetPacket *, size_t); | | ENET_API int enet_packet_resize (ENetPacket *, size_t); | |
| extern enet_uint32 enet_crc32 (const ENetBuffer *, size_t); | | extern enet_uint32 enet_crc32 (const ENetBuffer *, size_t); | |
| | | | |
|
| ENET_API ENetHost * enet_host_create (const ENetAddress *, size_t, enet_uin
t32, enet_uint32); | | ENET_API ENetHost * enet_host_create (const ENetAddress *, size_t, size_t,
enet_uint32, enet_uint32); | |
| ENET_API void enet_host_destroy (ENetHost *); | | ENET_API void enet_host_destroy (ENetHost *); | |
|
| ENET_API ENetPeer * enet_host_connect (ENetHost *, const ENetAddress *, siz
e_t); | | ENET_API ENetPeer * enet_host_connect (ENetHost *, const ENetAddress *, siz
e_t, enet_uint32); | |
| ENET_API int enet_host_check_events (ENetHost *, ENetEvent *); | | ENET_API int enet_host_check_events (ENetHost *, ENetEvent *); | |
| ENET_API int enet_host_service (ENetHost *, ENetEvent *, enet_uint32
); | | ENET_API int enet_host_service (ENetHost *, ENetEvent *, enet_uint32
); | |
| ENET_API void enet_host_flush (ENetHost *); | | ENET_API void enet_host_flush (ENetHost *); | |
| ENET_API void enet_host_broadcast (ENetHost *, enet_uint8, ENetPacket
*); | | ENET_API void enet_host_broadcast (ENetHost *, enet_uint8, ENetPacket
*); | |
|
| | | ENET_API void enet_host_compress (ENetHost *, const ENetCompressor *) | |
| | | ; | |
| | | ENET_API int enet_host_compress_with_range_coder (ENetHost * host); | |
| ENET_API void enet_host_channel_limit (ENetHost *, size_t); | | ENET_API void enet_host_channel_limit (ENetHost *, size_t); | |
| ENET_API void enet_host_bandwidth_limit (ENetHost *, enet_uint32, ene
t_uint32); | | ENET_API void enet_host_bandwidth_limit (ENetHost *, enet_uint32, ene
t_uint32); | |
| extern void enet_host_bandwidth_throttle (ENetHost *); | | extern void enet_host_bandwidth_throttle (ENetHost *); | |
| | | | |
| ENET_API int enet_peer_send (ENetPeer *, enet_uint8, ENetPa
cket *); | | ENET_API int enet_peer_send (ENetPeer *, enet_uint8, ENetPa
cket *); | |
| ENET_API ENetPacket * enet_peer_receive (ENetPeer *, enet_uint8 * ch
annelID); | | ENET_API ENetPacket * enet_peer_receive (ENetPeer *, enet_uint8 * ch
annelID); | |
| ENET_API void enet_peer_ping (ENetPeer *); | | ENET_API void enet_peer_ping (ENetPeer *); | |
| ENET_API void enet_peer_reset (ENetPeer *); | | ENET_API void enet_peer_reset (ENetPeer *); | |
| ENET_API void enet_peer_disconnect (ENetPeer *, enet_uint32)
; | | ENET_API void enet_peer_disconnect (ENetPeer *, enet_uint32)
; | |
| ENET_API void enet_peer_disconnect_now (ENetPeer *, enet_uin
t32); | | ENET_API void enet_peer_disconnect_now (ENetPeer *, enet_uin
t32); | |
| | | | |
| skipping to change at line 507 | | skipping to change at line 528 | |
| ENET_API void enet_peer_throttle_configure (ENetPeer *, enet
_uint32, enet_uint32, enet_uint32); | | ENET_API void enet_peer_throttle_configure (ENetPeer *, enet
_uint32, enet_uint32, enet_uint32); | |
| extern int enet_peer_throttle (ENetPeer *, enet_uint32); | | extern int enet_peer_throttle (ENetPeer *, enet_uint32); | |
| extern void enet_peer_reset_queues (ENetPeer *); | | extern void enet_peer_reset_queues (ENetPeer *); | |
| extern void enet_peer_setup_outgoing_command (ENetPeer *,
ENetOutgoingCommand *); | | extern void enet_peer_setup_outgoing_command (ENetPeer *,
ENetOutgoingCommand *); | |
| extern ENetOutgoingCommand * enet_peer_queue_outgoing_command (ENetPeer *,
const ENetProtocol *, ENetPacket *, enet_uint32, enet_uint16); | | extern ENetOutgoingCommand * enet_peer_queue_outgoing_command (ENetPeer *,
const ENetProtocol *, ENetPacket *, enet_uint32, enet_uint16); | |
| extern ENetIncomingCommand * enet_peer_queue_incoming_command (ENetPeer *,
const ENetProtocol *, ENetPacket *, enet_uint32); | | extern ENetIncomingCommand * enet_peer_queue_incoming_command (ENetPeer *,
const ENetProtocol *, ENetPacket *, enet_uint32); | |
| extern ENetAcknowledgement * enet_peer_queue_acknowledgement (ENetPeer *, c
onst ENetProtocol *, enet_uint16); | | extern ENetAcknowledgement * enet_peer_queue_acknowledgement (ENetPeer *, c
onst ENetProtocol *, enet_uint16); | |
| extern void enet_peer_dispatch_incoming_unreliable_command
s (ENetPeer *, ENetChannel *); | | extern void enet_peer_dispatch_incoming_unreliable_command
s (ENetPeer *, ENetChannel *); | |
| extern void enet_peer_dispatch_incoming_reliable_commands
(ENetPeer *, ENetChannel *); | | extern void enet_peer_dispatch_incoming_reliable_commands
(ENetPeer *, ENetChannel *); | |
| | | | |
|
| | | ENET_API void * enet_range_coder_create (void); | |
| | | ENET_API void enet_range_coder_destroy (void *); | |
| | | ENET_API size_t enet_range_coder_compress (void *, const ENetBuffer *, size | |
| | | _t, size_t, enet_uint8 *, size_t); | |
| | | ENET_API size_t enet_range_coder_decompress (void *, const enet_uint8 *, si | |
| | | ze_t, enet_uint8 *, size_t); | |
| | | | |
| extern size_t enet_protocol_command_size (enet_uint8); | | extern size_t enet_protocol_command_size (enet_uint8); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif /* __ENET_ENET_H__ */ | | #endif /* __ENET_ENET_H__ */ | |
| | | | |
End of changes. 15 change blocks. |
| 14 lines changed or deleted | | 52 lines changed or added | |
|
| protocol.h | | protocol.h | |
| | | | |
| skipping to change at line 19 | | skipping to change at line 19 | |
| | | | |
| enum | | enum | |
| { | | { | |
| ENET_PROTOCOL_MINIMUM_MTU = 576, | | ENET_PROTOCOL_MINIMUM_MTU = 576, | |
| ENET_PROTOCOL_MAXIMUM_MTU = 4096, | | ENET_PROTOCOL_MAXIMUM_MTU = 4096, | |
| ENET_PROTOCOL_MAXIMUM_PACKET_COMMANDS = 32, | | ENET_PROTOCOL_MAXIMUM_PACKET_COMMANDS = 32, | |
| ENET_PROTOCOL_MINIMUM_WINDOW_SIZE = 4096, | | ENET_PROTOCOL_MINIMUM_WINDOW_SIZE = 4096, | |
| ENET_PROTOCOL_MAXIMUM_WINDOW_SIZE = 32768, | | ENET_PROTOCOL_MAXIMUM_WINDOW_SIZE = 32768, | |
| ENET_PROTOCOL_MINIMUM_CHANNEL_COUNT = 1, | | ENET_PROTOCOL_MINIMUM_CHANNEL_COUNT = 1, | |
| ENET_PROTOCOL_MAXIMUM_CHANNEL_COUNT = 255, | | ENET_PROTOCOL_MAXIMUM_CHANNEL_COUNT = 255, | |
|
| ENET_PROTOCOL_MAXIMUM_PEER_ID = 0x7FFF | | ENET_PROTOCOL_MAXIMUM_PEER_ID = 0xFFF | |
| }; | | }; | |
| | | | |
| typedef enum _ENetProtocolCommand | | typedef enum _ENetProtocolCommand | |
| { | | { | |
| ENET_PROTOCOL_COMMAND_NONE = 0, | | ENET_PROTOCOL_COMMAND_NONE = 0, | |
| ENET_PROTOCOL_COMMAND_ACKNOWLEDGE = 1, | | ENET_PROTOCOL_COMMAND_ACKNOWLEDGE = 1, | |
| ENET_PROTOCOL_COMMAND_CONNECT = 2, | | ENET_PROTOCOL_COMMAND_CONNECT = 2, | |
| ENET_PROTOCOL_COMMAND_VERIFY_CONNECT = 3, | | ENET_PROTOCOL_COMMAND_VERIFY_CONNECT = 3, | |
| ENET_PROTOCOL_COMMAND_DISCONNECT = 4, | | ENET_PROTOCOL_COMMAND_DISCONNECT = 4, | |
| ENET_PROTOCOL_COMMAND_PING = 5, | | ENET_PROTOCOL_COMMAND_PING = 5, | |
| | | | |
| skipping to change at line 46 | | skipping to change at line 46 | |
| ENET_PROTOCOL_COMMAND_COUNT = 12, | | ENET_PROTOCOL_COMMAND_COUNT = 12, | |
| | | | |
| ENET_PROTOCOL_COMMAND_MASK = 0x0F | | ENET_PROTOCOL_COMMAND_MASK = 0x0F | |
| } ENetProtocolCommand; | | } ENetProtocolCommand; | |
| | | | |
| typedef enum _ENetProtocolFlag | | typedef enum _ENetProtocolFlag | |
| { | | { | |
| ENET_PROTOCOL_COMMAND_FLAG_ACKNOWLEDGE = (1 << 7), | | ENET_PROTOCOL_COMMAND_FLAG_ACKNOWLEDGE = (1 << 7), | |
| ENET_PROTOCOL_COMMAND_FLAG_UNSEQUENCED = (1 << 6), | | ENET_PROTOCOL_COMMAND_FLAG_UNSEQUENCED = (1 << 6), | |
| | | | |
|
| ENET_PROTOCOL_HEADER_FLAG_SENT_TIME = (1 << 15), | | ENET_PROTOCOL_HEADER_FLAG_COMPRESSED = (1 << 14), | |
| ENET_PROTOCOL_HEADER_FLAG_MASK = 0x8000 | | ENET_PROTOCOL_HEADER_FLAG_SENT_TIME = (1 << 15), | |
| | | ENET_PROTOCOL_HEADER_FLAG_MASK = ENET_PROTOCOL_HEADER_FLAG_COMPRES | |
| | | SED | ENET_PROTOCOL_HEADER_FLAG_SENT_TIME, | |
| | | | |
| | | ENET_PROTOCOL_HEADER_SESSION_MASK = (3 << 12), | |
| | | ENET_PROTOCOL_HEADER_SESSION_SHIFT = 12 | |
| } ENetProtocolFlag; | | } ENetProtocolFlag; | |
| | | | |
| #ifdef _MSC_VER_ | | #ifdef _MSC_VER_ | |
| #pragma pack(push, 1) | | #pragma pack(push, 1) | |
| #define ENET_PACKED | | #define ENET_PACKED | |
| #elif defined(__GNUC__) | | #elif defined(__GNUC__) | |
| #define ENET_PACKED __attribute__ ((packed)) | | #define ENET_PACKED __attribute__ ((packed)) | |
| #else | | #else | |
| #define ENET_PACKED | | #define ENET_PACKED | |
| #endif | | #endif | |
| | | | |
| typedef struct _ENetProtocolHeader | | typedef struct _ENetProtocolHeader | |
| { | | { | |
|
| enet_uint32 checksum; | | | |
| enet_uint16 peerID; | | enet_uint16 peerID; | |
| enet_uint16 sentTime; | | enet_uint16 sentTime; | |
| } ENET_PACKED ENetProtocolHeader; | | } ENET_PACKED ENetProtocolHeader; | |
| | | | |
| typedef struct _ENetProtocolCommandHeader | | typedef struct _ENetProtocolCommandHeader | |
| { | | { | |
| enet_uint8 command; | | enet_uint8 command; | |
| enet_uint8 channelID; | | enet_uint8 channelID; | |
| enet_uint16 reliableSequenceNumber; | | enet_uint16 reliableSequenceNumber; | |
| } ENET_PACKED ENetProtocolCommandHeader; | | } ENET_PACKED ENetProtocolCommandHeader; | |
| | | | |
| skipping to change at line 84 | | skipping to change at line 87 | |
| { | | { | |
| ENetProtocolCommandHeader header; | | ENetProtocolCommandHeader header; | |
| enet_uint16 receivedReliableSequenceNumber; | | enet_uint16 receivedReliableSequenceNumber; | |
| enet_uint16 receivedSentTime; | | enet_uint16 receivedSentTime; | |
| } ENET_PACKED ENetProtocolAcknowledge; | | } ENET_PACKED ENetProtocolAcknowledge; | |
| | | | |
| typedef struct _ENetProtocolConnect | | typedef struct _ENetProtocolConnect | |
| { | | { | |
| ENetProtocolCommandHeader header; | | ENetProtocolCommandHeader header; | |
| enet_uint16 outgoingPeerID; | | enet_uint16 outgoingPeerID; | |
|
| enet_uint16 mtu; | | enet_uint8 incomingSessionID; | |
| | | enet_uint8 outgoingSessionID; | |
| | | enet_uint32 mtu; | |
| enet_uint32 windowSize; | | enet_uint32 windowSize; | |
| enet_uint32 channelCount; | | enet_uint32 channelCount; | |
| enet_uint32 incomingBandwidth; | | enet_uint32 incomingBandwidth; | |
| enet_uint32 outgoingBandwidth; | | enet_uint32 outgoingBandwidth; | |
| enet_uint32 packetThrottleInterval; | | enet_uint32 packetThrottleInterval; | |
| enet_uint32 packetThrottleAcceleration; | | enet_uint32 packetThrottleAcceleration; | |
| enet_uint32 packetThrottleDeceleration; | | enet_uint32 packetThrottleDeceleration; | |
|
| enet_uint32 sessionID; | | enet_uint32 connectID; | |
| | | enet_uint32 data; | |
| } ENET_PACKED ENetProtocolConnect; | | } ENET_PACKED ENetProtocolConnect; | |
| | | | |
| typedef struct _ENetProtocolVerifyConnect | | typedef struct _ENetProtocolVerifyConnect | |
| { | | { | |
| ENetProtocolCommandHeader header; | | ENetProtocolCommandHeader header; | |
| enet_uint16 outgoingPeerID; | | enet_uint16 outgoingPeerID; | |
|
| enet_uint16 mtu; | | enet_uint8 incomingSessionID; | |
| | | enet_uint8 outgoingSessionID; | |
| | | enet_uint32 mtu; | |
| enet_uint32 windowSize; | | enet_uint32 windowSize; | |
| enet_uint32 channelCount; | | enet_uint32 channelCount; | |
| enet_uint32 incomingBandwidth; | | enet_uint32 incomingBandwidth; | |
| enet_uint32 outgoingBandwidth; | | enet_uint32 outgoingBandwidth; | |
| enet_uint32 packetThrottleInterval; | | enet_uint32 packetThrottleInterval; | |
| enet_uint32 packetThrottleAcceleration; | | enet_uint32 packetThrottleAcceleration; | |
| enet_uint32 packetThrottleDeceleration; | | enet_uint32 packetThrottleDeceleration; | |
|
| | | enet_uint32 connectID; | |
| } ENET_PACKED ENetProtocolVerifyConnect; | | } ENET_PACKED ENetProtocolVerifyConnect; | |
| | | | |
| typedef struct _ENetProtocolBandwidthLimit | | typedef struct _ENetProtocolBandwidthLimit | |
| { | | { | |
| ENetProtocolCommandHeader header; | | ENetProtocolCommandHeader header; | |
| enet_uint32 incomingBandwidth; | | enet_uint32 incomingBandwidth; | |
| enet_uint32 outgoingBandwidth; | | enet_uint32 outgoingBandwidth; | |
| } ENET_PACKED ENetProtocolBandwidthLimit; | | } ENET_PACKED ENetProtocolBandwidthLimit; | |
| | | | |
| typedef struct _ENetProtocolThrottleConfigure | | typedef struct _ENetProtocolThrottleConfigure | |
| | | | |
End of changes. 7 change blocks. |
| 7 lines changed or deleted | | 17 lines changed or added | |
|