|
@@ -56,8 +56,6 @@
|
|
|
#define ENET_TIME_GREATER_EQUAL(a, b) (! ENET_TIME_LESS (a, b))
|
|
|
#define ENET_TIME_DIFFERENCE(a, b) ((a) - (b) >= ENET_TIME_OVERFLOW ? (b) - (a) : (a) - (b))
|
|
|
|
|
|
-#define ENET_UNUSED(x) (void)x;
|
|
|
-
|
|
|
// =======================================================================//
|
|
|
// !
|
|
|
// ! System differences
|
|
@@ -198,6 +196,8 @@
|
|
|
#define ENET_BUFFER_MAXIMUM (1 + 2 * ENET_PROTOCOL_MAXIMUM_PACKET_COMMANDS)
|
|
|
#endif
|
|
|
|
|
|
+#define ENET_UNUSED(x) (void)x;
|
|
|
+
|
|
|
#define ENET_MAX(x, y) ((x) > (y) ? (x) : (y))
|
|
|
#define ENET_MIN(x, y) ((x) < (y) ? (x) : (y))
|
|
|
|
|
@@ -1473,6 +1473,7 @@ extern "C" {
|
|
|
|
|
|
static void enet_protocol_change_state(ENetHost *host, ENetPeer *peer, ENetPeerState state) {
|
|
|
ENET_UNUSED(host)
|
|
|
+
|
|
|
if (state == ENET_PEER_STATE_CONNECTED || state == ENET_PEER_STATE_DISCONNECT_LATER) {
|
|
|
enet_peer_on_connect(peer);
|
|
|
} else {
|
|
@@ -1707,6 +1708,7 @@ extern "C" {
|
|
|
|
|
|
static ENetPeer * enet_protocol_handle_connect(ENetHost *host, ENetProtocolHeader *header, ENetProtocol *command) {
|
|
|
ENET_UNUSED(header)
|
|
|
+
|
|
|
enet_uint8 incomingSessionID, outgoingSessionID;
|
|
|
enet_uint32 mtu, windowSize;
|
|
|
ENetChannel *channel;
|
|
@@ -2154,6 +2156,7 @@ extern "C" {
|
|
|
static int enet_protocol_handle_ping(ENetHost *host, ENetPeer *peer, const ENetProtocol *command) {
|
|
|
ENET_UNUSED(host)
|
|
|
ENET_UNUSED(command)
|
|
|
+
|
|
|
if (peer->state != ENET_PEER_STATE_CONNECTED && peer->state != ENET_PEER_STATE_DISCONNECT_LATER) {
|
|
|
return -1;
|
|
|
}
|
|
@@ -2198,6 +2201,7 @@ extern "C" {
|
|
|
|
|
|
static int enet_protocol_handle_throttle_configure(ENetHost *host, ENetPeer *peer, const ENetProtocol *command) {
|
|
|
ENET_UNUSED(host)
|
|
|
+
|
|
|
if (peer->state != ENET_PEER_STATE_CONNECTED && peer->state != ENET_PEER_STATE_DISCONNECT_LATER) {
|
|
|
return -1;
|
|
|
}
|
|
@@ -3627,6 +3631,7 @@ extern "C" {
|
|
|
|
|
|
static void enet_peer_remove_incoming_commands(ENetList *queue, ENetListIterator startCommand, ENetListIterator endCommand) {
|
|
|
ENET_UNUSED(queue)
|
|
|
+
|
|
|
ENetListIterator currentCommand;
|
|
|
|
|
|
for (currentCommand = startCommand; currentCommand != endCommand;) {
|