add "gamestatecooldown" cvar
to be able to change the cooldown between gamestate resends
This commit is contained in:
1 parent
01c1ae42a1
commit
e1d4f10223
4 files changed
+17
-14
No files matched your search
+4
-4
@@ -4067,6 +4067,9 @@ consvar_t cv_discordinvites = {"discordinvites", "Everyone", CV_SAVE|CV_CALL, di
|
||||
|
||||
static CV_PossibleValue_t resynchattempts_cons_t[] = {{0, "MIN"}, {20, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_resynchattempts = {"resynchattempts", "2", CV_SAVE, resynchattempts_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL };
|
||||
|
||||
static CV_PossibleValue_t resynchcooldown_cons_t[] = {{0, "MIN"}, {20, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_resynchcooldown = {"gamestatecooldown", "5", CV_SAVE, resynchcooldown_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL };
|
||||
consvar_t cv_blamecfail = {"blamecfail", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL };
|
||||
|
||||
// max file size to send to a player (in kilobytes)
|
||||
@@ -5306,12 +5309,9 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||
HSendPacket(node, true, 0, 0);
|
||||
|
||||
if (can_receive_gamestate[node])
|
||||
{
|
||||
resendingsavegame[node] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
CONS_Printf("resynch");
|
||||
SV_RequireResynch(node);
|
||||
resendingsavegame[node] = false;
|
||||
}
|
||||
@@ -5654,7 +5654,7 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||
case PT_RECEIVEDGAMESTATE:
|
||||
sendingsavegame[node] = false;
|
||||
resendingsavegame[node] = false;
|
||||
savegameresendcooldown[node] = I_GetTime() + 5 * TICRATE;
|
||||
savegameresendcooldown[node] = I_GetTime() + cv_resynchcooldown.value * TICRATE; // I_GetTime() + 5 * TICRATE;
|
||||
break;
|
||||
case PT_WILLRESENDGAMESTATE:
|
||||
PT_WillResendGamestate();
|
||||
|
||||
+1
-1
@@ -573,7 +573,7 @@ extern consvar_t
|
||||
#ifdef VANILLAJOINNEXTROUND
|
||||
cv_joinnextround,
|
||||
#endif
|
||||
cv_netticbuffer, cv_allownewplayer, cv_joinrefusemessage, cv_maxplayers, cv_resynchattempts, cv_blamecfail, cv_maxsend, cv_noticedownload, cv_downloadspeed;
|
||||
cv_netticbuffer, cv_allownewplayer, cv_joinrefusemessage, cv_maxplayers, cv_resynchattempts, cv_resynchcooldown, cv_blamecfail, cv_maxsend, cv_noticedownload, cv_downloadspeed;
|
||||
|
||||
extern consvar_t cv_connectawaittime;
|
||||
|
||||
|
||||
@@ -779,6 +779,7 @@ void D_RegisterServerCommands(void)
|
||||
// d_clisrv
|
||||
CV_RegisterVar(&cv_maxplayers);
|
||||
CV_RegisterVar(&cv_resynchattempts);
|
||||
CV_RegisterVar(&cv_resynchcooldown);
|
||||
CV_RegisterVar(&cv_maxsend);
|
||||
CV_RegisterVar(&cv_noticedownload);
|
||||
CV_RegisterVar(&cv_downloadspeed);
|
||||
|
||||
+11
-9
@@ -1912,17 +1912,18 @@ static menuitem_t OP_AdvServerOptionsMenu[] =
|
||||
NULL, "Server Browser Address", &cv_masterserver, 10},
|
||||
#endif
|
||||
{IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 40},
|
||||
{IT_STRING | IT_CVAR, NULL, "Delay limit (frames)", &cv_maxping, 50},
|
||||
{IT_STRING | IT_CVAR, NULL, "Delay timeout (s)", &cv_pingtimeout, 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Connection timeout (tics)", &cv_nettimeout, 70},
|
||||
{IT_STRING | IT_CVAR, NULL, "Join timeout (tics)", &cv_jointimeout, 80},
|
||||
{IT_STRING | IT_CVAR, NULL, "Resend Gamestate Cooldown", &cv_resynchcooldown, 50},
|
||||
{IT_STRING | IT_CVAR, NULL, "Delay limit (frames)", &cv_maxping, 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Delay timeout (s)", &cv_pingtimeout, 70},
|
||||
{IT_STRING | IT_CVAR, NULL, "Connection timeout (tics)", &cv_nettimeout, 80},
|
||||
{IT_STRING | IT_CVAR, NULL, "Join timeout (tics)", &cv_jointimeout, 90},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Max. file transfer send (KB)", &cv_maxsend, 100},
|
||||
{IT_STRING | IT_CVAR, NULL, "File transfer packet rate", &cv_downloadspeed, 110},
|
||||
{IT_STRING | IT_CVAR, NULL, "Max. file transfer send (KB)", &cv_maxsend, 110},
|
||||
{IT_STRING | IT_CVAR, NULL, "File transfer packet rate", &cv_downloadspeed, 120},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Log join addresses", &cv_showjoinaddress, 130},
|
||||
{IT_STRING | IT_CVAR, NULL, "Log resyncs", &cv_blamecfail, 140},
|
||||
{IT_STRING | IT_CVAR, NULL, "Log file transfers", &cv_noticedownload, 150},
|
||||
{IT_STRING | IT_CVAR, NULL, "Log join addresses", &cv_showjoinaddress, 140},
|
||||
{IT_STRING | IT_CVAR, NULL, "Log resyncs", &cv_blamecfail, 150},
|
||||
{IT_STRING | IT_CVAR, NULL, "Log file transfers", &cv_noticedownload, 160},
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -1931,6 +1932,7 @@ static const char* OP_AdvServerOptionsTooltips[] =
|
||||
{
|
||||
"Server used for master server.",
|
||||
"Attempts to resynchronise player to server.",
|
||||
"Cooldown in seconds before the Server attempts\nto resend the gamestate to a Saturn Client\nbetween resending attempts.",
|
||||
"Maximum allowed delay.",
|
||||
"Delay timeout in seconds.",
|
||||
"Connection timeout in tics.",
|
||||
|
||||
Reference in new issue
Block a user