33using Content . Server . Administration . Logs ;
44using Content . Server . Administration . Managers ;
55using Content . Server . Chat . Managers ;
6+ using Content . Server . GameTicking ;
67using Content . Server . Ghost . Components ;
78using Content . Server . Headset ;
89using Content . Server . Players ;
@@ -56,6 +57,8 @@ public sealed class ChatSystem : SharedChatSystem
5657 public override void Initialize ( )
5758 {
5859 _configurationManager . OnValueChanged ( CCVars . LoocEnabled , OnLoocEnabledChanged , true ) ;
60+
61+ SubscribeLocalEvent < GameRunLevelChangedEvent > ( OnGameChange ) ;
5962 }
6063
6164 public override void Shutdown ( )
@@ -72,6 +75,17 @@ private void OnLoocEnabledChanged(bool val)
7275 Loc . GetString ( val ? "chat-manager-looc-chat-enabled-message" : "chat-manager-looc-chat-disabled-message" ) ) ;
7376 }
7477
78+ private void OnGameChange ( GameRunLevelChangedEvent ev )
79+ {
80+ if ( _configurationManager . GetCVar ( CCVars . OocEnableDuringRound ) )
81+ return ;
82+
83+ if ( ev . New == GameRunLevel . InRound )
84+ _configurationManager . SetCVar ( CCVars . OocEnabled , false ) ;
85+ else if ( ev . New == GameRunLevel . PostRound )
86+ _configurationManager . SetCVar ( CCVars . OocEnabled , true ) ;
87+ }
88+
7589 // ReSharper disable once InconsistentNaming
7690 public void TrySendInGameICMessage ( EntityUid source , string message , InGameICChatType desiredType , bool hideChat ,
7791 IConsoleShell ? shell = null , IPlayerSession ? player = null )
0 commit comments