Offline input delay cvar

This commit is contained in:
AJ Martinez 2022-09-20 02:34:53 -07:00
parent 3f3e3ffdf6
commit db25599647
3 changed files with 5 additions and 1 deletions

View file

@ -114,6 +114,8 @@ UINT32 playerpingtable[MAXPLAYERS]; //table of player latency values.
static tic_t lowest_lag; static tic_t lowest_lag;
boolean server_lagless; boolean server_lagless;
static CV_PossibleValue_t mindelay_cons_t[] = {{0, "MIN"}, {30, "MAX"}, {0, NULL}};
consvar_t cv_mindelay = CVAR_INIT ("mindelay", "0", 0, mindelay_cons_t, NULL);
SINT8 nodetoplayer[MAXNETNODES]; SINT8 nodetoplayer[MAXNETNODES];
SINT8 nodetoplayer2[MAXNETNODES]; // say the numplayer for this node if any (splitscreen) SINT8 nodetoplayer2[MAXNETNODES]; // say the numplayer for this node if any (splitscreen)
@ -5665,7 +5667,7 @@ static void UpdatePingTable(void)
if (netgame && !(gametime % 35)) // update once per second. if (netgame && !(gametime % 35)) // update once per second.
PingUpdate(); PingUpdate();
fastest = 0; fastest = cv_mindelay.value;
// update node latency values so we can take an average later. // update node latency values so we can take an average later.
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)

View file

@ -445,6 +445,7 @@ extern UINT32 playerpingtable[MAXPLAYERS];
extern tic_t servermaxping; extern tic_t servermaxping;
extern boolean server_lagless; extern boolean server_lagless;
extern consvar_t cv_mindelay;
extern consvar_t cv_netticbuffer, cv_allownewplayer, cv_maxconnections, cv_joindelay; extern consvar_t cv_netticbuffer, cv_allownewplayer, cv_maxconnections, cv_joindelay;
extern consvar_t cv_resynchattempts, cv_blamecfail; extern consvar_t cv_resynchattempts, cv_blamecfail;

View file

@ -972,6 +972,7 @@ void D_RegisterClientCommands(void)
CV_RegisterVar(&cv_rollingdemos); CV_RegisterVar(&cv_rollingdemos);
CV_RegisterVar(&cv_netstat); CV_RegisterVar(&cv_netstat);
CV_RegisterVar(&cv_netticbuffer); CV_RegisterVar(&cv_netticbuffer);
CV_RegisterVar(&cv_mindelay);
#ifdef NETGAME_DEVMODE #ifdef NETGAME_DEVMODE
CV_RegisterVar(&cv_fishcake); CV_RegisterVar(&cv_fishcake);