diff --git a/src/engine/shared/variables_insta.h b/src/engine/shared/variables_insta.h index 26f5ef01f1e..eec21309975 100644 --- a/src/engine/shared/variables_insta.h +++ b/src/engine/shared/variables_insta.h @@ -68,6 +68,7 @@ MACRO_CONFIG_INT(SvUnstackChat, sv_unstack_chat, 1, 0, 1, CFGFLAG_SERVER, "Rever MACRO_CONFIG_INT(SvTournament, sv_tournament, 0, 0, 1, CFGFLAG_SERVER, "Print messages saying tournament is running. No other effects.") MACRO_CONFIG_STR(SvTournamentWelcomeChat, sv_tournament_welcome_chat, 900, "", CFGFLAG_SERVER, "Chat message shown in chat on join when sv_tournament is 1") MACRO_CONFIG_INT(SvTournamentChat, sv_tournament_chat, 0, 0, 2, CFGFLAG_SERVER, "0=off, 1=Spectators can not public chat, 2=Nobody can public chat") +MACRO_CONFIG_INT(SvTournamentChatRound, sv_tournament_chat_round, 0, 0, 2, CFGFLAG_SERVER, "0=off, 1=Spectators can not public chat, 2=Nobody can public chat") MACRO_CONFIG_INT(SvTournamentChatSmart, sv_tournament_chat_smart, 0, 0, 2, CFGFLAG_SERVER, "Turns sv_tournament_chat on on restart and off on round end (1=specs,2=all)") MACRO_CONFIG_INT(SvTournamentJoinMsgs, sv_tournament_join_msgs, 0, 0, 2, CFGFLAG_SERVER, "Hide join/leave of spectators in chat !0.6 only for now! (0=off,1=hidden,2=shown for specs)") MACRO_CONFIG_STR(SvRoundStatsDiscordWebhook, sv_round_stats_discord_webhook, 512, "", CFGFLAG_SERVER, "If set will post score stats there on round end") diff --git a/src/game/server/gamecontroller.cpp b/src/game/server/gamecontroller.cpp index 5caf06e3ad8..622529cf032 100644 --- a/src/game/server/gamecontroller.cpp +++ b/src/game/server/gamecontroller.cpp @@ -602,6 +602,11 @@ bool IGameController::CanBeMovedOnBalance(int ClientId) void IGameController::Tick() { + if(g_Config.m_SvTournamentChatRound > 0) + { + g_Config.m_SvTournamentChat = g_Config.m_SvTournamentChatRound; + } + // handle game states if(m_GameState != IGS_GAME_RUNNING) { diff --git a/src/game/server/gamecontroller.h b/src/game/server/gamecontroller.h index 7775c219c2e..b6160ebbad0 100644 --- a/src/game/server/gamecontroller.h +++ b/src/game/server/gamecontroller.h @@ -294,6 +294,11 @@ class IGameController if(m_GameState != IGS_END_MATCH) OnEndMatchInsta(); SetGameState(IGS_END_MATCH, TIMER_END); + if(g_Config.m_SvTournamentChatRound > 0) + { + g_Config.m_SvTournamentChat = 0; + g_Config.m_SvTournamentChatRound = 0; + } } void EndRound() { SetGameState(IGS_END_ROUND, TIMER_END / 2); } // never called ddnet-insta has no round support yet