Move/rename AfkVoteTimer to AfkTimer

This commit is contained in:
Arda Demir 2022-06-11 20:32:06 +03:00
parent 18ab88d33e
commit c4492c27ea
3 changed files with 7 additions and 7 deletions

View file

@ -331,7 +331,7 @@ MACRO_CONFIG_INT(ClBackgroundShowTilesLayers, cl_background_show_tiles_layers, 0
MACRO_CONFIG_INT(SvShowOthers, sv_show_others, 1, 0, 1, CFGFLAG_SERVER, "Whether players can use the command showothers or not") MACRO_CONFIG_INT(SvShowOthers, sv_show_others, 1, 0, 1, CFGFLAG_SERVER, "Whether players can use the command showothers or not")
MACRO_CONFIG_INT(SvShowOthersDefault, sv_show_others_default, 0, 0, 2, CFGFLAG_SERVER | CFGFLAG_GAME, "Whether players see others by default (2 for own team)") MACRO_CONFIG_INT(SvShowOthersDefault, sv_show_others_default, 0, 0, 2, CFGFLAG_SERVER | CFGFLAG_GAME, "Whether players see others by default (2 for own team)")
MACRO_CONFIG_INT(SvShowAllDefault, sv_show_all_default, 0, 0, 1, CFGFLAG_SERVER, "Whether players see all tees by default") MACRO_CONFIG_INT(SvShowAllDefault, sv_show_all_default, 0, 0, 1, CFGFLAG_SERVER, "Whether players see all tees by default")
MACRO_CONFIG_INT(SvMaxAfkVoteTime, sv_max_afk_vote_time, 300, 0, 9999, CFGFLAG_SERVER, "The time in seconds a player can be afk and his votes still count (0 = disabled)") MACRO_CONFIG_INT(SvMaxAfkTime, sv_max_afk_time, 300, 0, 9999, CFGFLAG_SERVER, "The time in seconds a player to be afk (0 = disabled)")
MACRO_CONFIG_INT(SvPlasmaRange, sv_plasma_range, 700, 1, 99999, CFGFLAG_SERVER | CFGFLAG_GAME, "How far will the plasma gun track tees") MACRO_CONFIG_INT(SvPlasmaRange, sv_plasma_range, 700, 1, 99999, CFGFLAG_SERVER | CFGFLAG_GAME, "How far will the plasma gun track tees")
MACRO_CONFIG_INT(SvPlasmaPerSec, sv_plasma_per_sec, 3, 0, 50, CFGFLAG_SERVER | CFGFLAG_GAME, "How many shots does the plasma gun fire per seconds") MACRO_CONFIG_INT(SvPlasmaPerSec, sv_plasma_per_sec, 3, 0, 50, CFGFLAG_SERVER | CFGFLAG_GAME, "How many shots does the plasma gun fire per seconds")
MACRO_CONFIG_INT(SvDraggerRange, sv_dragger_range, 700, 1, 99999, CFGFLAG_SERVER | CFGFLAG_GAME, "How far will the dragger track tees") MACRO_CONFIG_INT(SvDraggerRange, sv_dragger_range, 700, 1, 99999, CFGFLAG_SERVER | CFGFLAG_GAME, "How far will the dragger track tees")

View file

@ -504,7 +504,7 @@ void CPlayer::OnPredictedInput(CNetObj_PlayerInput *NewInput)
if((m_PlayerFlags & PLAYERFLAG_CHATTING) && (NewInput->m_PlayerFlags & PLAYERFLAG_CHATTING)) if((m_PlayerFlags & PLAYERFLAG_CHATTING) && (NewInput->m_PlayerFlags & PLAYERFLAG_CHATTING))
return; return;
AfkVoteTimer(NewInput); AfkTimer();
m_NumInputs++; m_NumInputs++;
@ -526,7 +526,7 @@ void CPlayer::OnDirectInput(CNetObj_PlayerInput *NewInput)
if(NewInput->m_PlayerFlags) if(NewInput->m_PlayerFlags)
Server()->SetClientFlags(m_ClientID, NewInput->m_PlayerFlags); Server()->SetClientFlags(m_ClientID, NewInput->m_PlayerFlags);
AfkVoteTimer(NewInput); AfkTimer();
if(((!m_pCharacter && m_Team == TEAM_SPECTATORS) || m_Paused) && m_SpectatorID == SPEC_FREEVIEW) if(((!m_pCharacter && m_Team == TEAM_SPECTATORS) || m_Paused) && m_SpectatorID == SPEC_FREEVIEW)
m_ViewPos = vec2(NewInput->m_TargetX, NewInput->m_TargetY); m_ViewPos = vec2(NewInput->m_TargetX, NewInput->m_TargetY);
@ -695,12 +695,12 @@ void CPlayer::UpdatePlaytime()
m_LastPlaytime = time_get(); m_LastPlaytime = time_get();
} }
void CPlayer::AfkVoteTimer(CNetObj_PlayerInput *NewTarget) void CPlayer::AfkTimer()
{ {
if(g_Config.m_SvMaxAfkVoteTime == 0) if(g_Config.m_SvMaxAfkTime == 0)
return; return;
if(m_LastPlaytime < time_get() - time_freq() * g_Config.m_SvMaxAfkVoteTime) if(m_LastPlaytime < time_get() - time_freq() * g_Config.m_SvMaxAfkTime)
{ {
m_Afk = true; m_Afk = true;
return; return;

View file

@ -180,7 +180,7 @@ public:
bool m_Moderating; bool m_Moderating;
void UpdatePlaytime(); void UpdatePlaytime();
void AfkVoteTimer(CNetObj_PlayerInput *pNewTarget); void AfkTimer();
int64_t m_LastPlaytime; int64_t m_LastPlaytime;
int64_t m_LastEyeEmote; int64_t m_LastEyeEmote;
int64_t m_LastBroadcast; int64_t m_LastBroadcast;