Quote:
Originally Posted by georgik57
but if you change the cvar afterwards to disabled, the function still works and players can still RTV.
|
It is because I cache some cvar into global variables when I read the `galileo.cfg`:
Code:
/**
* To cache some high used server cvars.
*
* @param ignoreUnregistred whether retrieve the settings dependent cvars or not.
*
* @see cacheCvarsValuesIgnored(0)
*/
stock cacheCvarsValues( ignoreUnregistred=false )
{
LOG( 128, "I AM ENTERING ON cacheCvarsValues(1)" )
// RTV wait time
g_rtvWaitRounds = get_pcvar_num( cvar_rtvWaitRounds );
g_rtvWaitFrags = get_pcvar_num( cvar_rtvWaitFrags );
g_rtvWaitMinutes = get_pcvar_float( cvar_rtvWaitMinutes );
if( !ignoreUnregistred )
{
cacheCvarsValuesIgnored();
}
g_rtvCommands = get_pcvar_num( cvar_rtvCommands );
g_extendmapStepRounds = get_pcvar_num( cvar_extendmapStepRounds );
g_extendmapStepFrags = get_pcvar_num( cvar_extendmapStepFrags );
g_extendmapStepMinutes = get_pcvar_num( cvar_extendmapStepMinutes );
g_extendmapAllowStayType = get_pcvar_num( cvar_extendmapAllowStayType );
g_showVoteStatus = get_pcvar_num( cvar_showVoteStatus );
g_voteShowNoneOptionType = get_pcvar_num( cvar_voteShowNoneOptionType );
g_showVoteStatusType = get_pcvar_num( cvar_showVoteStatusType );
g_maxRoundsNumber = get_pcvar_num( cvar_mp_maxrounds );
g_winLimitNumber = get_pcvar_num( cvar_mp_winlimit );
g_timeLimitNumber = get_pcvar_num( cvar_mp_timelimit );
g_isExtendmapAllowStay = get_pcvar_num( cvar_extendmapAllowStay ) != 0;
g_isToShowNoneOption = get_pcvar_num( cvar_isToShowNoneOption ) == 1;
g_isToShowSubMenu = get_pcvar_num( cvar_isToShowNoneOption ) == 2;
g_isToShowVoteCounter = get_pcvar_num( cvar_isToShowVoteCounter ) != 0;
g_isToShowExpCountdown = get_pcvar_num( cvar_isToShowExpCountdown ) != 0;
get_pcvar_string( cvar_voteWeightFlags, g_voteWeightFlags, charsmax( g_voteWeightFlags ) );
g_maxVotingChoices = max( min( MAX_OPTIONS_IN_VOTE, get_pcvar_num( cvar_voteMapChoiceCount ) ), 2 );
// It need to be cached after loading all the cvars, because it use some of them.
g_totalVoteTime = howManySecondsLastMapTheVoting();
}
Some of them I re-cache when it is possible to then to change. But there is not a moment which I specifically/periodically re-cache the cvar for the RTV.
__________________