Improve sv_join_vote_delay against vote bots

- Prolong to 5 minutes
- also affects participating in votes
This commit is contained in:
Dennis Felsing 2018-12-11 10:29:34 +01:00
parent fabd559746
commit b224a4dafe
3 changed files with 7 additions and 2 deletions

View file

@ -726,6 +726,7 @@ void CGameContext::OnTick()
if(m_apPlayers[i])
Server()->GetClientAddr(i, aaBuf[i], NETADDR_MAXSTRSIZE);
bool aVoteChecked[MAX_CLIENTS] = {0};
int64 Now = Server()->Tick();
for(int i = 0; i < MAX_CLIENTS; i++)
{
//if(!m_apPlayers[i] || m_apPlayers[i]->GetTeam() == TEAM_SPECTATORS || aVoteChecked[i]) // don't count in votes by spectators
@ -743,6 +744,10 @@ void CGameContext::OnTick()
if(m_apPlayers[i]->m_Afk && i != m_VoteCreator)
continue;
// can't vote in the beginning after joining
if(Now < m_apPlayers[i]->m_FirstVoteTick)
continue;
// connecting clients with spoofed ips can clog slots without being ingame
if(((CServer*)Server())->m_aClients[i].m_State != CServer::CClient::STATE_INGAME)
continue;

View file

@ -127,7 +127,7 @@ void CPlayer::Reset()
// non-empty, allow them to vote immediately. This allows players to
// vote after map changes or when they join an empty server.
//
// Otherwise, block voting for 60 seconds after joining.
// Otherwise, block voting in the begnning after joining.
if(Now > GameServer()->m_NonEmptySince + 10 * TickSpeed)
m_FirstVoteTick = Now + g_Config.m_SvJoinVoteDelay * TickSpeed;
else

View file

@ -140,7 +140,7 @@ MACRO_CONFIG_INT(SvVoteSpectateRejoindelay, sv_vote_spectate_rejoindelay, 3, 0,
MACRO_CONFIG_INT(SvVoteKick, sv_vote_kick, 1, 0, 1, CFGFLAG_SERVER, "Allow voting to kick players")
MACRO_CONFIG_INT(SvVoteKickMin, sv_vote_kick_min, 0, 0, MAX_CLIENTS, CFGFLAG_SERVER, "Minimum number of players required to start a kick vote")
MACRO_CONFIG_INT(SvVoteKickBantime, sv_vote_kick_bantime, 5, 0, 1440, CFGFLAG_SERVER, "The time in seconds to ban a player if kicked by vote. 0 makes it just use kick")
MACRO_CONFIG_INT(SvJoinVoteDelay, sv_join_vote_delay, 60, 0, 1000, CFGFLAG_SERVER, "Add a delay before recently joined players can vote (in seconds)")
MACRO_CONFIG_INT(SvJoinVoteDelay, sv_join_vote_delay, 300, 0, 1000, CFGFLAG_SERVER, "Add a delay before recently joined players can call or participate in a vote (in seconds)")
MACRO_CONFIG_INT(SvOldTeleportWeapons, sv_old_teleport_weapons, 0, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Teleporting of all weapons (deprecated, use special entities instead)")
MACRO_CONFIG_INT(SvOldTeleportHook, sv_old_teleport_hook, 0, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Hook through teleporter (deprecated, use special entities instead)")
MACRO_CONFIG_INT(SvTeleportHoldHook, sv_teleport_hold_hook, 0, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Hold hook when teleported")