Skip to content

Commit

Permalink
[engine] Restrict host_timescale to reduce abuse chances
Browse files Browse the repository at this point in the history
  • Loading branch information
dimhotepus committed Dec 13, 2024
1 parent fa57654 commit a55f75f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion engine/host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,8 @@ static ConVar host_profile( "host_profile","0" );

ConVar host_limitlocal( "host_limitlocal", "0", 0, "Apply cl_cmdrate and cl_updaterate to loopback connection" );
ConVar host_framerate( "host_framerate","0", 0, "Set to lock per-frame time elapse." );
ConVar host_timescale( "host_timescale","1.0", FCVAR_REPLICATED, "Prescale the clock by this amount." );
// dimhotepus: Lock host_timescale min/max to prevent abuse.
ConVar host_timescale( "host_timescale","1.0", FCVAR_REPLICATED, "Prescale the clock by this amount.", true, 0.0001f, true, 1.2f );
ConVar host_speeds( "host_speeds","0", 0, "Show general system running times." ); // set for running times

ConVar host_flush_threshold( "host_flush_threshold", "20", 0, "Memory threshold below which the host should flush caches between server instances" );
Expand Down
2 changes: 1 addition & 1 deletion game/client/perfvisualbenchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void CPerfVisualBenchmark::Stop()
#endif
m_bIsOn = false;
Print();
engine->ClientCmd_Unrestricted("host_timescale 0"); // pause the mofo
engine->ClientCmd_Unrestricted("host_timescale 0.0001"); // pause the mofo
// engine->ClientCmd_Unrestricted("unpause"); // unpause the mofo
// engine->ClientCmd_Unrestricted("wait");
engine->ClientCmd_Unrestricted("toggleconsole");
Expand Down

0 comments on commit a55f75f

Please sign in to comment.