diff --git a/README.md b/README.md index 7834985..e300dd5 100644 --- a/README.md +++ b/README.md @@ -230,7 +230,7 @@ Definitions of a flags for `Peer.Send()` function: `PacketFlags.Instant` a packet will not be bundled with other packets at a next service iteration and sent instantly instead. This delivery type trades multiplexing efficiency in favor of latency. The same packet can't be used for multiple `Peer.Send()` calls. -`PacketFlags.Crucial` a packet that was enqueued for sending unreliably should not be dropped due to throttling and sent if possible. +`PacketFlags.Unthrottled` a packet that was enqueued for sending unreliably should not be dropped due to throttling and sent if possible. `PacketFlags.Sent` a packet was sent from all queues it has entered. diff --git a/Source/Managed/ENet.cs b/Source/Managed/ENet.cs index 7f72a8b..693c913 100644 --- a/Source/Managed/ENet.cs +++ b/Source/Managed/ENet.cs @@ -37,7 +37,7 @@ public enum PacketFlags { NoAllocate = 1 << 2, UnreliableFragmented = 1 << 3, Instant = 1 << 4, - Crucial = 1 << 5, + Unthrottled = 1 << 5, Sent = 1 << 8 } @@ -928,7 +928,7 @@ public static class Library { public const uint timeoutLimit = 32; public const uint timeoutMinimum = 5000; public const uint timeoutMaximum = 30000; - public const uint version = (2 << 16) | (4 << 8) | (1); + public const uint version = (2 << 16) | (4 << 8) | (2); public static bool Initialize() { if (Native.enet_linked_version() != version) diff --git a/Source/Native/enet.h b/Source/Native/enet.h index 3a6c566..b8507a4 100644 --- a/Source/Native/enet.h +++ b/Source/Native/enet.h @@ -31,7 +31,7 @@ #define ENET_VERSION_MAJOR 2 #define ENET_VERSION_MINOR 4 -#define ENET_VERSION_PATCH 1 +#define ENET_VERSION_PATCH 2 #define ENET_VERSION_CREATE(major, minor, patch) (((major) << 16) | ((minor) << 8) | (patch)) #define ENET_VERSION_GET_MAJOR(version) (((version) >> 16) & 0xFF) #define ENET_VERSION_GET_MINOR(version) (((version) >> 8) & 0xFF) @@ -443,7 +443,7 @@ extern "C" { ENET_PACKET_FLAG_NO_ALLOCATE = (1 << 2), ENET_PACKET_FLAG_UNRELIABLE_FRAGMENTED = (1 << 3), ENET_PACKET_FLAG_INSTANT = (1 << 4), - ENET_PACKET_FLAG_CRUCIAL = (1 << 5), + ENET_PACKET_FLAG_UNTHROTTLED = (1 << 5), ENET_PACKET_FLAG_SENT = (1 << 8) } ENetPacketFlag; @@ -2652,7 +2652,7 @@ extern "C" { host->headerFlags |= ENET_PROTOCOL_HEADER_FLAG_SENT_TIME; peer->reliableDataInTransit += outgoingCommand->fragmentLength; } else { - if (outgoingCommand->packet != NULL && outgoingCommand->fragmentOffset == 0) { + if (outgoingCommand->packet != NULL && outgoingCommand->fragmentOffset == 0 && !(outgoingCommand->packet->flags & (ENET_PACKET_FLAG_UNTHROTTLED))) { peer->packetThrottleCounter += ENET_PEER_PACKET_THROTTLE_COUNTER; peer->packetThrottleCounter %= ENET_PEER_PACKET_THROTTLE_SCALE; @@ -2953,7 +2953,7 @@ extern "C" { int enet_peer_throttle(ENetPeer* peer, uint32_t rtt) { if (peer->lastRoundTripTime <= peer->lastRoundTripTimeVariance) { peer->packetThrottle = peer->packetThrottleLimit; - } else if (rtt < peer->lastRoundTripTime + (peer -> lastRoundTripTimeVariance + 1) / 2) { + } else if (rtt < peer->lastRoundTripTime + (peer->lastRoundTripTimeVariance + 1) / 2) { peer->packetThrottle += peer->packetThrottleAcceleration; if (peer->packetThrottle > peer->packetThrottleLimit)