Skip to content

Commit ae5cb37

Browse files
committed
fix server operators setting network rate higher than tickrate
1 parent 6c42416 commit ae5cb37

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

src/game/shared/multiplay_gamerules.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,28 @@ CMultiplayRules::CMultiplayRules()
316316
}
317317
}
318318

319+
const int iMaxPacketRate = TIME_TO_TICKS( 1 );
320+
static ConVarRef sv_mincmdrate( "sv_mincmdrate" );
321+
if ( sv_mincmdrate.GetInt() > iMaxPacketRate )
322+
{
323+
sv_mincmdrate.SetValue( iMaxPacketRate );
324+
}
325+
static ConVarRef sv_maxcmdrate( "sv_maxcmdrate" );
326+
if ( sv_maxcmdrate.GetInt() > iMaxPacketRate )
327+
{
328+
sv_maxcmdrate.SetValue( iMaxPacketRate );
329+
}
330+
static ConVarRef sv_minupdaterate( "sv_minupdaterate" );
331+
if ( sv_minupdaterate.GetInt() > iMaxPacketRate )
332+
{
333+
sv_minupdaterate.SetValue( iMaxPacketRate );
334+
}
335+
static ConVarRef sv_maxupdaterate( "sv_maxupdaterate" );
336+
if ( sv_maxupdaterate.GetInt() > iMaxPacketRate )
337+
{
338+
sv_maxupdaterate.SetValue( iMaxPacketRate );
339+
}
340+
319341
nextlevel.SetValue( "" );
320342
LoadMapCycleFile();
321343

0 commit comments

Comments
 (0)