diff options
author | Simon Howard | 2006-02-23 18:20:29 +0000 |
---|---|---|
committer | Simon Howard | 2006-02-23 18:20:29 +0000 |
commit | 19b8c7428afd6a42485a76bdf938e686e8450543 (patch) | |
tree | 13a9094bd9be855a6ae61a692f70ae793c47c797 /src/net_client.c | |
parent | 8b08253a0da0d081348c8755ec8a07977726de2b (diff) | |
download | chocolate-doom-19b8c7428afd6a42485a76bdf938e686e8450543.tar.gz chocolate-doom-19b8c7428afd6a42485a76bdf938e686e8450543.tar.bz2 chocolate-doom-19b8c7428afd6a42485a76bdf938e686e8450543.zip |
Fix bugs in resend code for server->client data
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 377
Diffstat (limited to 'src/net_client.c')
-rw-r--r-- | src/net_client.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/net_client.c b/src/net_client.c index 2d0622a5..c8b08fb6 100644 --- a/src/net_client.c +++ b/src/net_client.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: net_client.c 375 2006-02-22 18:35:55Z fraggle $ +// $Id: net_client.c 377 2006-02-23 18:20:29Z fraggle $ // // Copyright(C) 2005 Simon Howard // @@ -21,6 +21,9 @@ // 02111-1307, USA. // // $Log$ +// Revision 1.28 2006/02/23 18:20:29 fraggle +// Fix bugs in resend code for server->client data +// // Revision 1.27 2006/02/22 18:35:55 fraggle // Packet resends for server->client gamedata // @@ -552,12 +555,15 @@ static void NET_CL_SendResendRequest(int start, int end) net_packet_t *packet; unsigned int nowtime; int i; + + //printf("CL: Send resend %i-%i\n", start, end); packet = NET_NewPacket(64); NET_WriteInt16(packet, NET_PACKET_TYPE_GAMEDATA_RESEND); NET_WriteInt32(packet, start); - NET_WriteInt8(packet, end - start - 1); + NET_WriteInt8(packet, end - start + 1); NET_Conn_SendPacket(&client_connection, packet); + NET_FreePacket(packet); nowtime = I_GetTimeMS(); @@ -567,7 +573,7 @@ static void NET_CL_SendResendRequest(int start, int end) { int index; - index = start - recvwindow_start; + index = i - recvwindow_start; if (index < 0 || index >= BACKUPTICS) continue; @@ -631,6 +637,7 @@ static void NET_CL_CheckResends(void) if (resend_start >= 0) { + //printf("CL: resend request timed out: %i-%i\n", resend_start, resend_end); NET_CL_SendResendRequest(recvwindow_start + resend_start, recvwindow_start + resend_end); } @@ -669,7 +676,7 @@ static void NET_CL_ParseGameData(net_packet_t *packet) index = seq - recvwindow_start + i; - if (!NET_ReadFullTiccmd(packet, &cmd)) + if (!NET_ReadFullTiccmd(packet, &cmd, false)) { return; } |