diff --git a/src/d_clisrv.c b/src/d_clisrv.c index eafc1283..f5d9b213 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3017,6 +3017,9 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum) } } +static CV_PossibleValue_t netticbuffer_cons_t[] = {{0, "MIN"}, {3, "MAX"}}; +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 }; #ifdef VANILLAJOINNEXTROUND consvar_t cv_joinnextround = {"joinnextround", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /// \todo not done @@ -3068,6 +3071,7 @@ void D_ClientServerInit(void) RegisterNetXCmd(XD_REMOVEPLAYER, Got_RemovePlayer); #ifndef NONET CV_RegisterVar(&cv_allownewplayer); + CV_RegisterVar(&cv_netticbuffer); #ifdef VANILLAJOINNEXTROUND CV_RegisterVar(&cv_joinnextround); #endif @@ -4925,6 +4929,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 (gamestate == GS_LEVEL && leveltime > 3 && neededtic <= gametic + cv_netticbuffer.value) + break; } } else