Skip to content

Commit 8273434

Browse files
death to it (#8981)
1 parent 847a749 commit 8273434

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

Content.Server/Chat/ChatSystem.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Content.Server.Administration.Logs;
44
using Content.Server.Administration.Managers;
55
using Content.Server.Chat.Managers;
6+
using Content.Server.GameTicking;
67
using Content.Server.Ghost.Components;
78
using Content.Server.Headset;
89
using 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)

Content.Shared/CCVar/CCVars.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,12 @@ public static readonly CVarDef<bool>
728728
/// </summary>
729729
public static readonly CVarDef<bool> DisablingOOCDisablesRelay = CVarDef.Create("ooc.disabling_ooc_disables_relay", true, CVar.SERVERONLY);
730730

731+
/// <summary>
732+
/// Whether or not OOC chat should be enabled during a round.
733+
/// </summary>
734+
public static readonly CVarDef<bool> OocEnableDuringRound =
735+
CVarDef.Create("ooc.enable_during_round", false, CVar.NOTIFY | CVar.REPLICATED |CVar.SERVER);
736+
731737
/*
732738
* LOOC
733739
*/

0 commit comments

Comments
 (0)