From 7bcef65dbdddba239f7f38cd9cf199dd3266733f Mon Sep 17 00:00:00 2001 From: eihrul Date: Fri, 12 Oct 2007 05:21:57 +0000 Subject: [PATCH] *** empty log message *** --- host.c | 1 - include/enet/enet.h | 3 ++- peer.c | 2 +- protocol.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/host.c b/host.c index ff703ce..9bab1a8 100644 --- a/host.c +++ b/host.c @@ -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 diff --git a/peer.c b/peer.c index 11483f8..3bd3ba6 100644 --- a/peer.c +++ b/peer.c @@ -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; } diff --git a/protocol.c b/protocol.c index f8794aa..e426243 100644 --- a/protocol.c +++ b/protocol.c @@ -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];