This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
// pretend frames take this amount of time (in seconds), 0 = realtime
cvar_t host_framerate = {CF_CLIENT | CF_SERVER, "host_framerate","0", "locks frame timing to this value in seconds, 0.05 is 20fps for example, note that this can easily run too fast, use cl_maxfps if you want to limit your framerate instead, or sys_ticrate to limit server speed"};
// pretend frames take this amount of time (in seconds), 0 = realtime
cvar_t host_framerate = {CF_CLIENT | CF_SERVER, "host_framerate","0", "locks frame timing to this value in seconds, 0.05 is 20fps for example, note that this can easily run too fast, use cl_maxfps if you want to limit your framerate instead, or sys_ticrate to limit server speed"};
// shows time used by certain subsystems
cvar_t host_speeds = {CF_CLIENT | CF_SERVER, "host_speeds","0", "reports how much time is used in server/graphics/sound"};
cvar_t host_maxwait = {CF_CLIENT | CF_SERVER, "host_maxwait","1000", "maximum sleep time requested from the operating system in millisecond. Larger sleeps will be done using multiple host_maxwait length sleeps. Lowering this value will increase CPU load, but may help working around problems with accuracy of sleep times."};
// shows time used by certain subsystems
cvar_t host_speeds = {CF_CLIENT | CF_SERVER, "host_speeds","0", "reports how much time is used in server/graphics/sound"};
cvar_t host_maxwait = {CF_CLIENT | CF_SERVER, "host_maxwait","1000", "maximum sleep time requested from the operating system in millisecond. Larger sleeps will be done using multiple host_maxwait length sleeps. Lowering this value will increase CPU load, but may help working around problems with accuracy of sleep times."};
if (cls.state == ca_dedicated)
Sys_Error ("Host_Error: %s",hosterrorstring2); // dedicated servers exit
if (cls.state == ca_dedicated)
Sys_Error ("Host_Error: %s",hosterrorstring2); // dedicated servers exit
Cmd_AddCommand(CF_SHARED, "saveconfig", Host_SaveConfig_f, "save settings to config.cfg (or a specified filename) immediately (also automatic when quitting)");
Cmd_AddCommand(CF_SHARED, "loadconfig", Host_LoadConfig_f, "reset everything and reload configs");
Cmd_AddCommand(CF_SHARED, "sendcvar", SendCvar_f, "sends the value of a cvar to the server as a sentcvar command, for use by QuakeC");
Cmd_AddCommand(CF_SHARED, "saveconfig", Host_SaveConfig_f, "save settings to config.cfg (or a specified filename) immediately (also automatic when quitting)");
Cmd_AddCommand(CF_SHARED, "loadconfig", Host_LoadConfig_f, "reset everything and reload configs");
Cmd_AddCommand(CF_SHARED, "sendcvar", SendCvar_f, "sends the value of a cvar to the server as a sentcvar command, for use by QuakeC");
Cvar_RegisterVariable (&host_framerate);
Cvar_RegisterCallback (&host_framerate, Host_Framerate_c);
Cvar_RegisterVariable (&host_speeds);
Cvar_RegisterVariable (&host_framerate);
Cvar_RegisterCallback (&host_framerate, Host_Framerate_c);
Cvar_RegisterVariable (&host_speeds);
- os = DP_OS_NAME;
- dpsnprintf (engineversion, sizeof (engineversion), "%s %s %s", gamename, os, buildstring);
+ dpsnprintf (engineversion, sizeof (engineversion), "%s %s%s, buildstring: %s", gamename, DP_OS_NAME, cls.state == ca_dedicated ? " dedicated" : "", buildstring);
Con_Printf("%s\n", engineversion);
// initialize process nice level
Con_Printf("%s\n", engineversion);
// initialize process nice level
// check for special benchmark mode
// COMMANDLINEOPTION: Client: -benchmark <demoname> runs a timedemo and quits, results of any timedemo can be found in gamedir/benchmark.log (for example id1/benchmark.log)
i = Sys_CheckParm("-benchmark");
// check for special benchmark mode
// COMMANDLINEOPTION: Client: -benchmark <demoname> runs a timedemo and quits, results of any timedemo can be found in gamedir/benchmark.log (for example id1/benchmark.log)
i = Sys_CheckParm("-benchmark");
- sv_wait = SV_Frame(time);
- cl_wait = CL_Frame(time);
-
-// Con_Printf("%6.0f %6.0f\n", cl_wait * 1000000.0, sv_wait * 1000000.0);
+ // if the accumulators haven't become positive yet, wait a while
+ sv_wait = - SV_Frame(time);
+ cl_wait = - CL_Frame(time);
if(host_maxwait.value <= 0)
time = min(time, 1000000.0);
else
time = min(time, host_maxwait.value * 1000.0);
if(host_maxwait.value <= 0)
time = min(time, 1000000.0);
else
time = min(time, host_maxwait.value * 1000.0);
- newtime = host.dirtytime = Sys_DirtyTime();
- host.realtime += time = Host_UpdateTime(newtime, oldtime);
+ host.dirtytime = Sys_DirtyTime();
+ host.realtime += time = Host_UpdateTime(host.dirtytime, oldtime);