death to it (#8981)
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Text;
|
|||||||
using Content.Server.Administration.Logs;
|
using Content.Server.Administration.Logs;
|
||||||
using Content.Server.Administration.Managers;
|
using Content.Server.Administration.Managers;
|
||||||
using Content.Server.Chat.Managers;
|
using Content.Server.Chat.Managers;
|
||||||
|
using Content.Server.GameTicking;
|
||||||
using Content.Server.Ghost.Components;
|
using Content.Server.Ghost.Components;
|
||||||
using Content.Server.Headset;
|
using Content.Server.Headset;
|
||||||
using Content.Server.Players;
|
using Content.Server.Players;
|
||||||
@@ -56,6 +57,8 @@ public sealed class ChatSystem : SharedChatSystem
|
|||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
_configurationManager.OnValueChanged(CCVars.LoocEnabled, OnLoocEnabledChanged, true);
|
_configurationManager.OnValueChanged(CCVars.LoocEnabled, OnLoocEnabledChanged, true);
|
||||||
|
|
||||||
|
SubscribeLocalEvent<GameRunLevelChangedEvent>(OnGameChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Shutdown()
|
public override void Shutdown()
|
||||||
@@ -72,6 +75,17 @@ public sealed class ChatSystem : SharedChatSystem
|
|||||||
Loc.GetString(val ? "chat-manager-looc-chat-enabled-message" : "chat-manager-looc-chat-disabled-message"));
|
Loc.GetString(val ? "chat-manager-looc-chat-enabled-message" : "chat-manager-looc-chat-disabled-message"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnGameChange(GameRunLevelChangedEvent ev)
|
||||||
|
{
|
||||||
|
if (_configurationManager.GetCVar(CCVars.OocEnableDuringRound))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (ev.New == GameRunLevel.InRound)
|
||||||
|
_configurationManager.SetCVar(CCVars.OocEnabled, false);
|
||||||
|
else if (ev.New == GameRunLevel.PostRound)
|
||||||
|
_configurationManager.SetCVar(CCVars.OocEnabled, true);
|
||||||
|
}
|
||||||
|
|
||||||
// ReSharper disable once InconsistentNaming
|
// ReSharper disable once InconsistentNaming
|
||||||
public void TrySendInGameICMessage(EntityUid source, string message, InGameICChatType desiredType, bool hideChat,
|
public void TrySendInGameICMessage(EntityUid source, string message, InGameICChatType desiredType, bool hideChat,
|
||||||
IConsoleShell? shell = null, IPlayerSession? player = null)
|
IConsoleShell? shell = null, IPlayerSession? player = null)
|
||||||
|
|||||||
@@ -728,6 +728,12 @@ namespace Content.Shared.CCVar
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly CVarDef<bool> DisablingOOCDisablesRelay = CVarDef.Create("ooc.disabling_ooc_disables_relay", true, CVar.SERVERONLY);
|
public static readonly CVarDef<bool> DisablingOOCDisablesRelay = CVarDef.Create("ooc.disabling_ooc_disables_relay", true, CVar.SERVERONLY);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether or not OOC chat should be enabled during a round.
|
||||||
|
/// </summary>
|
||||||
|
public static readonly CVarDef<bool> OocEnableDuringRound =
|
||||||
|
CVarDef.Create("ooc.enable_during_round", false, CVar.NOTIFY | CVar.REPLICATED |CVar.SERVER);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* LOOC
|
* LOOC
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user