From 48f6a02a3814a459cc78b55eefef439762390d93 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 29 Dec 2000 07:15:50 +0000 Subject: [PATCH] make the `dead sleep' optional (sys_dead_sleep: defaults to on) --- source/sv_sys_unix.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/sv_sys_unix.c b/source/sv_sys_unix.c index 00b4099..8eff7dd 100644 --- a/source/sv_sys_unix.c +++ b/source/sv_sys_unix.c @@ -55,6 +55,7 @@ cvar_t *sys_extrasleep; +cvar_t *sys_dead_sleep; qboolean is_server = true; qboolean stdin_ready; @@ -150,6 +151,10 @@ Sys_Init_Cvars (void) { sys_nostdout = Cvar_Get ("sys_nostdout", "0", CVAR_NONE, "None"); sys_extrasleep = Cvar_Get ("sys_extrasleep", "0", CVAR_NONE, "None"); + sys_dead_sleep = Cvar_Get ("sys_dead_sleep", "1", CVAR_NONE, + "When set, the server gets NO cpu if no clients are connected" + "and there's no other activity. *MIGHT* cause problems with" + "some mods."); } void @@ -210,7 +215,7 @@ main (int argc, char *argv[]) _timeout.tv_sec = 1; _timeout.tv_usec = 0; - if (svs.num_clients) + if (svs.num_clients || !sys_dead_sleep->int_val) timeout = &_timeout; if (select (net_socket + 1, &fdset, NULL, NULL, timeout) == -1)