From: terencehill Date: Sun, 12 May 2013 16:49:06 +0000 (+0200) Subject: Fix sv_maxidle not kicking dead players and kicking spectators even if sv_maxidle_spe... X-Git-Tag: xonotic-v0.7.0~52^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=694fc4b5554ae3ca732985a0f142f672adae3ed8;p=xonotic%2Fxonotic-data.pk3dir.git Fix sv_maxidle not kicking dead players and kicking spectators even if sv_maxidle_spectatorsareidle is 0 --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 0a66a9078..5825655be 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1102,10 +1102,8 @@ set sv_intermission_cdtrack "" set g_cdtracks_dontusebydefault "rising-of-the-phoenix" set menu_cdtrack "rising-of-the-phoenix" -// maxidle (in seconds): kick players idle for more than that amount of time -set sv_maxidle 0 -// when sv_maxidle is not 0, assume spectators are idle too -set sv_maxidle_spectatorsareidle 0 +set sv_maxidle 0 "kick players idle for more than this amount of time in seconds" +set sv_maxidle_spectatorsareidle 0 "when sv_maxidle is not 0, assume spectators are idle too" // these entities are not referenced by anything directly, they just represent // teams and are found by find() when needed diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index a6f202e99..6df7310e7 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -2776,7 +2776,8 @@ void PlayerPostThink (void) stuffcmd(self, strcat("name ", self.netname, substring(ftos(random()), 2, -1), "\n")); } - if(sv_maxidle && frametime) // WORKAROUND: only use dropclient in server frames (frametime set). Never use it in cl_movement frames (frametime zero). + if(sv_maxidle > 0 && frametime) // WORKAROUND: only use dropclient in server frames (frametime set). Never use it in cl_movement frames (frametime zero). + if(IS_PLAYER(self) || sv_maxidle_spectatorsareidle) { if (time - self.parm_idlesince < 1) // instead of (time == self.parm_idlesince) to support sv_maxidle <= 10 { diff --git a/qcsrc/server/cl_physics.qc b/qcsrc/server/cl_physics.qc index b65e62a85..5ce7b7d47 100644 --- a/qcsrc/server/cl_physics.qc +++ b/qcsrc/server/cl_physics.qc @@ -760,7 +760,7 @@ void SV_PlayerPhysics() else if(self.specialcommand_pos && (c != substring(specialcommand, self.specialcommand_pos - 1, 1))) self.specialcommand_pos = 0; - if(!sv_maxidle_spectatorsareidle || self.movetype == MOVETYPE_WALK) + if(sv_maxidle > 0) { if(buttons != self.buttons_old || self.movement != self.movement_old || self.v_angle != self.v_angle_old) self.parm_idlesince = time;