mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-03 01:27:26 +00:00
* 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>
32 lines
861 B
C#
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;
|
|
}
|
|
}
|
|
}
|