diff options
-rw-r--r-- | host.c | 1 | ||||
-rw-r--r-- | include/enet/enet.h | 3 | ||||
-rw-r--r-- | peer.c | 2 | ||||
-rw-r--r-- | protocol.c | 4 |
4 files changed, 5 insertions, 5 deletions
@@ -165,7 +165,6 @@ enet_host_connect (ENetHost * host, const ENetAddress * address, size_t channelC channel -> outgoingReliableSequenceNumber = 0; channel -> outgoingUnreliableSequenceNumber = 0; channel -> incomingReliableSequenceNumber = 0; - channel -> incomingUnreliableSequenceNumber = 0; enet_list_clear (& channel -> incomingReliableCommands); enet_list_clear (& channel -> incomingUnreliableCommands); diff --git a/include/enet/enet.h b/include/enet/enet.h index 9d8c200..d3bced8 100644 --- a/include/enet/enet.h +++ b/include/enet/enet.h @@ -201,7 +201,8 @@ enum ENET_PEER_PING_INTERVAL = 500, ENET_PEER_UNSEQUENCED_WINDOW_SIZE = 4 * 32, ENET_PEER_RELIABLE_WINDOWS = 16, - ENET_PEER_RELIABLE_WINDOW_SIZE = 0x1000 + ENET_PEER_RELIABLE_WINDOW_SIZE = 0x1000, + ENET_PEER_FREE_RELIABLE_WINDOWS = 8 }; typedef struct _ENetChannel @@ -572,7 +572,7 @@ enet_peer_queue_incoming_command (ENetPeer * peer, const ENetProtocol * command, reliableSequenceNumber += 0x10000; } - if (reliableWindow < currentWindow || reliableWindow >= currentWindow + ENET_PEER_RELIABLE_WINDOWS / 2) + if (reliableWindow < currentWindow || reliableWindow >= currentWindow + ENET_PEER_FREE_RELIABLE_WINDOWS) goto freePacket; } @@ -1174,8 +1174,8 @@ enet_protocol_send_reliable_outgoing_commands (ENetHost * host, ENetPeer * peer) if (channel != NULL && outgoingCommand -> sendAttempts < 1 && ! (outgoingCommand -> reliableSequenceNumber % ENET_PEER_RELIABLE_WINDOW_SIZE) && - channel -> usedReliableWindows & ((((1 << (ENET_PEER_RELIABLE_WINDOWS / 2)) - 1) << reliableWindow) | - (((1 << (ENET_PEER_RELIABLE_WINDOWS / 2)) - 1) >> (ENET_PEER_RELIABLE_WINDOW_SIZE - reliableWindow)))) + channel -> usedReliableWindows & ((((1 << ENET_PEER_FREE_RELIABLE_WINDOWS) - 1) << reliableWindow) | + (((1 << ENET_PEER_FREE_RELIABLE_WINDOWS) - 1) >> (ENET_PEER_RELIABLE_WINDOW_SIZE - reliableWindow)))) break; commandSize = commandSizes [outgoingCommand -> command.header.command & ENET_PROTOCOL_COMMAND_MASK]; |