From: terencehill Date: Sun, 5 Sep 2021 19:08:08 +0000 (+0200) Subject: sv_maxidle_minplayers 2 "check for idlers only when there are at least this many... X-Git-Tag: xonotic-v0.8.5~353^2~2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8ffdd1c022bdd0eec44ba42acfd8ac475f21d69c;p=xonotic%2Fxonotic-data.pk3dir.git sv_maxidle_minplayers 2 "check for idlers only when there are at least this many players (only in dedicated servers)" --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 6dcad909c..dadc04b5b 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -2662,10 +2662,10 @@ void PlayerPostThink (entity this) }); } - if (totalClients <= 1) + if (totalClients < autocvar_sv_maxidle_minplayers) { + // idle kick disabled CS(this).parm_idlesince = time; - /* do nothing */ } else if (time - CS(this).parm_idlesince < 1) // instead of (time == this.parm_idlesince) to support sv_maxidle <= 10 { diff --git a/qcsrc/server/client.qh b/qcsrc/server/client.qh index 3199d155a..b7166609b 100644 --- a/qcsrc/server/client.qh +++ b/qcsrc/server/client.qh @@ -33,6 +33,7 @@ bool autocvar_g_nodepthtestplayers; string autocvar_g_mutatormsg; float autocvar_sv_foginterval; float autocvar_sv_maxidle; +int autocvar_sv_maxidle_minplayers = 2; float autocvar_sv_maxidle_playertospectator = 60; bool autocvar_sv_maxidle_alsokickspectators; int autocvar_sv_maxidle_slots; diff --git a/xonotic-server.cfg b/xonotic-server.cfg index 39323f0dc..a6213cb24 100644 --- a/xonotic-server.cfg +++ b/xonotic-server.cfg @@ -418,7 +418,7 @@ set sv_maxidle 0 "kick players idle for more than this amount of time in seconds set sv_maxidle_alsokickspectators 1 "when sv_maxidle is > 0, kick idle spectators as well as players" set sv_maxidle_slots 0 "when not 0, only kick idlers when this many or less player slots are available" set sv_maxidle_slots_countbots 1 "count bots as player slots" - +set sv_maxidle_minplayers 2 "check for idlers only when there are at least this many players (only in dedicated servers)" set sv_maxidle_playertospectator 60 "move players idle for more than this amount of time in seconds to spectators (sv_maxidle timer starts again after sv_maxidle_playertospectator has moved a player to spectators)" sv_allowdownloads_inarchive 1 // for csprogs.dat