Skip to content

Commit

Permalink
mute spec until round ends
Browse files Browse the repository at this point in the history
  • Loading branch information
JSaurusRex committed Dec 1, 2024
1 parent 6f2a214 commit e7462ec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/engine/shared/variables_insta.h
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
5 changes: 5 additions & 0 deletions src/game/server/gamecontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
5 changes: 5 additions & 0 deletions src/game/server/gamecontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e7462ec

Please sign in to comment.