From 7a29b07d4e148acd68ee257126c5de5ccebe4cd6 Mon Sep 17 00:00:00 2001 From: def Date: Sun, 21 Jul 2013 23:42:08 +0200 Subject: [PATCH] Add support for a reset file to execute on map change or reload --- src/engine/shared/config_variables.h | 1 + src/game/server/gamecontext.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h index e780ee410..8e34c699d 100644 --- a/src/engine/shared/config_variables.h +++ b/src/engine/shared/config_variables.h @@ -203,6 +203,7 @@ MACRO_CONFIG_INT(SvPlasmaPerSec, sv_plasma_per_sec, 3, 0, 50, CFGFLAG_SERVER, "H MACRO_CONFIG_INT(SvVotePause, sv_vote_pause, 1, 0, 1, CFGFLAG_SERVER, "Allow voting to pause players (instead of moving to spectators)") MACRO_CONFIG_INT(SvVotePauseTime, sv_vote_pause_time, 10, 0, 360, CFGFLAG_SERVER, "The time (in seconds) players have to wait in pause when paused by vote") MACRO_CONFIG_INT(SvTuneReset, sv_tune_reset, 0, 0, 1, CFGFLAG_SERVER, "Whether tuning is reset after each map change or not") +MACRO_CONFIG_STR(SvResetFile, sv_reset_file, 128, "reset.cfg", CFGFLAG_SERVER, "File to execute on map change or reload to set the default server settings") MACRO_CONFIG_INT(SvDDRaceTuneReset, sv_ddrace_tune_reset, 1, 0, 1, CFGFLAG_SERVER, "Whether DDRace tuning(sv_hit, Sv_Endless_Drag & Sv_Old_Laser) is reset after each map change or not") MACRO_CONFIG_INT(SvNamelessScore, sv_nameless_score, 0, 0, 1, CFGFLAG_SERVER, "Whether nameless tee has a score or not") MACRO_CONFIG_INT(SvTimeInBroadcastInterval, sv_time_in_broadcast_interval, 1, 0, 60, CFGFLAG_SERVER, "How often to update the broadcast time") diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index a41725157..b470095be 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -1857,6 +1857,8 @@ void CGameContext::OnInit(/*class IKernel *pKernel*/) g_Config.m_SvOldLaser = 0; } + Console()->ExecuteFile(g_Config.m_SvResetFile); + char buf[512]; str_format(buf, sizeof(buf), "data/maps/%s.cfg", g_Config.m_SvMap); Console()->ExecuteFile(buf);