From 0dd1422f02e25f876890fe21e31b53df4ff10afa Mon Sep 17 00:00:00 2001 From: oy Date: Thu, 17 Jan 2019 23:01:54 +0100 Subject: [PATCH] added a separate option for kicking inactive spectators. closes #1906 --- src/game/server/gamecontroller.cpp | 10 ++++++---- src/game/variables.h | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/game/server/gamecontroller.cpp b/src/game/server/gamecontroller.cpp index 690428120..5afce3c8a 100644 --- a/src/game/server/gamecontroller.cpp +++ b/src/game/server/gamecontroller.cpp @@ -63,13 +63,15 @@ void IGameController::DoActivityCheck() if(GameServer()->m_apPlayers[i] && !GameServer()->m_apPlayers[i]->IsDummy() && (GameServer()->m_apPlayers[i]->GetTeam() != TEAM_SPECTATORS || g_Config.m_SvInactiveKick > 0) && !Server()->IsAuthed(i) && (GameServer()->m_apPlayers[i]->m_InactivityTickCounter > g_Config.m_SvInactiveKickTime*Server()->TickSpeed()*60)) { - if (GameServer()->m_apPlayers[i]->GetTeam() == TEAM_SPECTATORS) { - Server()->Kick(i, "Kicked for inactivity"); + if(GameServer()->m_apPlayers[i]->GetTeam() == TEAM_SPECTATORS) + { + if(g_Config.m_SvInactiveKickSpec) + Server()->Kick(i, "Kicked for inactivity"); } - else { + else + { switch(g_Config.m_SvInactiveKick) { - case 0: case 1: { // move player to spectator diff --git a/src/game/variables.h b/src/game/variables.h index 026d415a4..c4d5978d8 100644 --- a/src/game/variables.h +++ b/src/game/variables.h @@ -115,7 +115,8 @@ MACRO_CONFIG_INT(SvPlayerSlots, sv_player_slots, 8, 0, MAX_PLAYERS, CFGFLAG_SAVE MACRO_CONFIG_INT(SvSkillLevel, sv_skill_level, 1, SERVERINFO_LEVEL_MIN, SERVERINFO_LEVEL_MAX, CFGFLAG_SAVE|CFGFLAG_SERVER, "Supposed player skill level") MACRO_CONFIG_INT(SvTeambalanceTime, sv_teambalance_time, 1, 0, 1000, CFGFLAG_SAVE|CFGFLAG_SERVER, "How many minutes to wait before autobalancing teams") MACRO_CONFIG_INT(SvInactiveKickTime, sv_inactivekick_time, 3, 0, 1000, CFGFLAG_SAVE|CFGFLAG_SERVER, "How many minutes to wait before taking care of inactive clients") -MACRO_CONFIG_INT(SvInactiveKick, sv_inactivekick, 2, 0, 3, CFGFLAG_SAVE|CFGFLAG_SERVER, "How to deal with inactive clients (0=move player to spectator, 1=move player to spectator and kick spectator, 2=move to free spectator slot/kick, 3=kick)") +MACRO_CONFIG_INT(SvInactiveKick, sv_inactivekick, 2, 1, 3, CFGFLAG_SAVE|CFGFLAG_SERVER, "How to deal with inactive clients (1=move player to spectator, 2=move to free spectator slot/kick, 3=kick)") +MACRO_CONFIG_INT(SvInactiveKickSpec, sv_inactivekick_spec, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_SERVER, "Kick inactive spectators") MACRO_CONFIG_INT(SvSilentSpectatorMode, sv_silent_spectator_mode, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_SERVER, "Mute join/leave message of spectator")