Files
Delta-v/Content.Server/_DV/Administration/EntitySystems/InGameOocMutedSystem.cs
T
DisposableCrewmember42andpathetic meowmeow e9b74fbef4 feat: OOC/LOOC/Deadchat muting (#5858)
* feat: LOOC/OOC/Deadchat muting

* refactor: split OocMuteCommands.cs into 3 files

* tweak: use proper admin logging

* refactor: remove unused loc args

* feat: one mute command, channel as argument

- properly marked target player in admin log so it actually alerts.

* refactor: completion options made named constant, used in error message

* tweak: display supported channels in help too

* fix: pass command to help string again

* style: add whitespace

Co-authored-by: pathetic meowmeow <uhhadd@gmail.com>
Signed-off-by: DisposableCrewmember42 <disposablecrewmember42@proton.me>

---------

Signed-off-by: DisposableCrewmember42 <disposablecrewmember42@proton.me>
Co-authored-by: pathetic meowmeow <uhhadd@gmail.com>
2026-05-28 12:56:19 -04:00

32 lines
861 B
C#

using Content.Server._DV.Administration.Components;
using Content.Server.GameTicking;
using Content.Shared.Chat;
using Content.Shared.Players;
namespace Content.Server._DV.Administration.EntitySystems;
public sealed class InGameOocMutedSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<InGameOocMessageAttemptEvent>(OnIngameOoc);
}
private void OnIngameOoc(ref InGameOocMessageAttemptEvent args)
{
if (args.Session.GetMind() is not { } mind)
return;
if (!TryComp<InGameOocMutedComponent>(mind, out var oocMuted))
return;
if (oocMuted.MuteDeadchat && args.Type == InGameOOCChatType.Dead
|| oocMuted.MuteLooc && args.Type == InGameOOCChatType.Looc)
{
args.Cancelled = true;
}
}
}