Admin improvements for Looc and Deadchat (#41273)

* looc and deadchat speak interrupt events

* comment

* admin log tweak

* clean up log entity targets; switch admin deadchat logged entity from player to mob

* one event only

* rename event, broadcast player session with the event
This commit is contained in:
Errant
2025-11-21 22:41:24 +01:00
committed by GitHub
parent eb95f4b214
commit b02edf29e3
3 changed files with 45 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
using Content.Shared.ActionBlocker;
using Content.Shared.Chat;
using Content.Shared.Emoting;
using Content.Shared.Interaction.Events;
using Content.Shared.Item;
@@ -31,6 +32,8 @@ public sealed class AdminFrozenSystem : EntitySystem
SubscribeLocalEvent<AdminFrozenComponent, ChangeDirectionAttemptEvent>(OnAttempt);
SubscribeLocalEvent<AdminFrozenComponent, EmoteAttemptEvent>(OnEmoteAttempt);
SubscribeLocalEvent<AdminFrozenComponent, SpeakAttemptEvent>(OnSpeakAttempt);
SubscribeLocalEvent<AdminFrozenComponent, InGameOocMessageAttemptEvent>(OnInGameOocMessageAttempt);
SubscribeLocalEvent<InGameOocMessageAttemptEvent>(OnInGameOocMessageAttemptBroadcast);
}
/// <summary>
@@ -56,6 +59,20 @@ public sealed class AdminFrozenSystem : EntitySystem
args.Cancel();
}
private void OnInGameOocMessageAttempt(Entity<AdminFrozenComponent> ent, ref InGameOocMessageAttemptEvent args)
{
if (!ent.Comp.Muted)
return;
// Despite Type being available, Admin Mute does not care to differentiate. If you are out, you are out.
args.Cancelled = true;
}
private void OnInGameOocMessageAttemptBroadcast(ref InGameOocMessageAttemptEvent args)
{
//TODO Player LOOC mute/ban. Session is in the args, but where to store/check the muted state?
}
private void OnAttempt(EntityUid uid, AdminFrozenComponent component, CancellableEntityEventArgs args)
{
args.Cancel();