diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 71e2e947e..d3cc0b0e2 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3615,6 +3615,9 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum) CL_RemovePlayer(pnum, kickreason); } +static CV_PossibleValue_t netticbuffer_cons_t[] = {{0, "MIN"}, {3, "MAX"}, {0, NULL}}; +consvar_t cv_netticbuffer = {"netticbuffer", "1", CV_SAVE, netticbuffer_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; + consvar_t cv_allownewplayer = {"allowjoin", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL }; consvar_t cv_joinnextround = {"joinnextround", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /// \todo not done static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {32, "MAX"}, {0, NULL}}; @@ -5380,6 +5383,10 @@ void TryRunTics(tic_t realtics) ExtraDataTicker(); gametic++; consistancy[gametic%BACKUPTICS] = Consistancy(); + + // Leave a certain amount of tics present in the net buffer as long as we've ran at least one tic this frame. + if (client && gamestate == GS_LEVEL && leveltime > 3 && neededtic <= gametic + cv_netticbuffer.value) + break; } } } diff --git a/src/d_clisrv.h b/src/d_clisrv.h index cb23883a8..d537984df 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -540,7 +540,7 @@ extern UINT32 realpingtable[MAXPLAYERS]; extern UINT32 playerpingtable[MAXPLAYERS]; extern tic_t servermaxping; -extern consvar_t cv_allownewplayer, cv_joinnextround, cv_maxplayers, cv_joindelay, cv_rejointimeout; +extern consvar_t cv_netticbuffer, cv_allownewplayer, cv_joinnextround, cv_maxplayers, cv_joindelay, cv_rejointimeout; extern consvar_t cv_resynchattempts, cv_blamecfail; extern consvar_t cv_maxsend, cv_noticedownload, cv_downloadspeed; diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 592734067..6aa168aa7 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -701,6 +701,7 @@ void D_RegisterClientCommands(void) #endif CV_RegisterVar(&cv_rollingdemos); CV_RegisterVar(&cv_netstat); + CV_RegisterVar(&cv_netticbuffer); #ifdef NETGAME_DEVMODE CV_RegisterVar(&cv_fishcake);