mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-18 02:50:33 +00:00
Added the 'sleeptime' cvar and behavior from the 'Old Engine'.
This commit is contained in:
parent
621cdba53c
commit
422e511aac
@ -54,6 +54,7 @@ convar_t *host_clientloaded;
|
|||||||
convar_t *host_limitlocal;
|
convar_t *host_limitlocal;
|
||||||
convar_t *host_maxfps;
|
convar_t *host_maxfps;
|
||||||
convar_t *host_framerate;
|
convar_t *host_framerate;
|
||||||
|
convar_t *host_sleeptime;
|
||||||
convar_t *con_gamemaps;
|
convar_t *con_gamemaps;
|
||||||
convar_t *build, *ver;
|
convar_t *build, *ver;
|
||||||
|
|
||||||
@ -168,17 +169,18 @@ Host_CheckSleep
|
|||||||
*/
|
*/
|
||||||
void Host_CheckSleep( void )
|
void Host_CheckSleep( void )
|
||||||
{
|
{
|
||||||
|
int sleeptime = host_sleeptime->value;
|
||||||
if( Host_IsDedicated() )
|
if( Host_IsDedicated() )
|
||||||
{
|
{
|
||||||
// let the dedicated server some sleep
|
// let the dedicated server some sleep
|
||||||
Sys_Sleep( 1 );
|
Sys_Sleep( sleeptime );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( host.status == HOST_NOFOCUS )
|
if( host.status == HOST_NOFOCUS )
|
||||||
{
|
{
|
||||||
if( SV_Active() && CL_IsInGame( ))
|
if( SV_Active() && CL_IsInGame( ))
|
||||||
Sys_Sleep( 1 ); // listenserver
|
Sys_Sleep( sleeptime ); // listenserver
|
||||||
else Sys_Sleep( 20 ); // sleep 20 ms otherwise
|
else Sys_Sleep( 20 ); // sleep 20 ms otherwise
|
||||||
}
|
}
|
||||||
else if( host.status == HOST_SLEEP )
|
else if( host.status == HOST_SLEEP )
|
||||||
@ -186,6 +188,10 @@ void Host_CheckSleep( void )
|
|||||||
// completely sleep in minimized state
|
// completely sleep in minimized state
|
||||||
Sys_Sleep( 20 );
|
Sys_Sleep( 20 );
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Sys_Sleep( sleeptime );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -944,6 +950,7 @@ int EXPORT Host_Main( int argc, char **argv, const char *progname, int bChangeGa
|
|||||||
|
|
||||||
host_maxfps = Cvar_Get( "fps_max", "72", FCVAR_ARCHIVE, "host fps upper limit" );
|
host_maxfps = Cvar_Get( "fps_max", "72", FCVAR_ARCHIVE, "host fps upper limit" );
|
||||||
host_framerate = Cvar_Get( "host_framerate", "0", 0, "locks frame timing to this value in seconds" );
|
host_framerate = Cvar_Get( "host_framerate", "0", 0, "locks frame timing to this value in seconds" );
|
||||||
|
host_sleeptime = Cvar_Get( "sleeptime", "1", FCVAR_ARCHIVE, "milliseconds to sleep for each frame. higher values reduce fps accuracy" );
|
||||||
host_gameloaded = Cvar_Get( "host_gameloaded", "0", FCVAR_READ_ONLY, "inidcates a loaded game.dll" );
|
host_gameloaded = Cvar_Get( "host_gameloaded", "0", FCVAR_READ_ONLY, "inidcates a loaded game.dll" );
|
||||||
host_clientloaded = Cvar_Get( "host_clientloaded", "0", FCVAR_READ_ONLY, "inidcates a loaded client.dll" );
|
host_clientloaded = Cvar_Get( "host_clientloaded", "0", FCVAR_READ_ONLY, "inidcates a loaded client.dll" );
|
||||||
host_limitlocal = Cvar_Get( "host_limitlocal", "0", 0, "apply cl_cmdrate and rate to loopback connection" );
|
host_limitlocal = Cvar_Get( "host_limitlocal", "0", 0, "apply cl_cmdrate and rate to loopback connection" );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user