diff options
author | Simon Howard | 2006-02-24 08:19:45 +0000 |
---|---|---|
committer | Simon Howard | 2006-02-24 08:19:45 +0000 |
commit | 655f385834d9f2076c8545199d6d703b226395ae (patch) | |
tree | d5cb9075da764e30f52297f241809fc92078713c /src | |
parent | a032e990d92b8ef4c97cef00edcde5deecbb64e2 (diff) | |
download | chocolate-doom-655f385834d9f2076c8545199d6d703b226395ae.tar.gz chocolate-doom-655f385834d9f2076c8545199d6d703b226395ae.tar.bz2 chocolate-doom-655f385834d9f2076c8545199d6d703b226395ae.zip |
Only advance the receive window if we have received ticcmds from all
connected players.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 387
Diffstat (limited to 'src')
-rw-r--r-- | src/net_server.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/src/net_server.c b/src/net_server.c index 9e82ddec..a83edd72 100644 --- a/src/net_server.c +++ b/src/net_server.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: net_server.c 384 2006-02-23 23:40:30Z fraggle $ +// $Id: net_server.c 387 2006-02-24 08:19:45Z fraggle $ // // Copyright(C) 2005 Simon Howard // @@ -21,6 +21,10 @@ // 02111-1307, USA. // // $Log$ +// Revision 1.34 2006/02/24 08:19:45 fraggle +// Only advance the receive window if we have received ticcmds from all +// connected players. +// // Revision 1.33 2006/02/23 23:40:30 fraggle // Free back packets sent to the server after parsing them // @@ -363,6 +367,38 @@ static void NET_SV_AdvanceWindow(void) while (recvwindow_start < lowtic) { + boolean should_advance; + + // Check we have tics from all players for first tic in + // the recv window + + should_advance = true; + + for (i=0; i<MAXPLAYERS; ++i) + { + if (sv_players[i] == NULL || !ClientConnected(sv_players[i])) + { + continue; + } + + if (!recvwindow[0][i].active) + { + should_advance = false; + break; + } + } + + if (!should_advance) + { + // The first tic is not complete: ie. we have not + // received tics from all connected players. This can + // happen if only one player is in the game. + + break; + } + + // Advance the window + memcpy(recvwindow, recvwindow + 1, sizeof(*recvwindow) * (BACKUPTICS - 1)); memset(&recvwindow[BACKUPTICS-1], 0, sizeof(*recvwindow)); ++recvwindow_start; |