From a7511522a0f0b663dd63606668a32768e4283aa9 Mon Sep 17 00:00:00 2001
From: SimpleStation14 <130339894+SimpleStation14@users.noreply.github.com>
Date: Sat, 4 May 2024 16:57:20 -0700
Subject: [PATCH] Mirror: Add logs to recycler gibbing and broadcasting. (#156)
## Mirror of PR #26008: [Add logs to recycler gibbing and
broadcasting.](https://github.com/space-wizards/space-station-14/pull/26008)
from
[space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14)
###### `2b8415b378c181fd0222cdf7f4d005a70ebe8044`
PR opened by
nikthechampiongr at 2024-03-11 18:01:29 UTC
PR merged by web-flow at
2024-03-12 10:57:05 UTC
---
PR changed 3 files with 8 additions and 0 deletions.
The PR had the following labels:
- Status: Needs Review
---
Original Body
> fixes #25556
> fixes #25037
>
>
>
>
> ## About the PR
>
> This just adds logs for broadcasting and getting gibbed by a recycler.
>
> ## Why / Balance
>
> Me admin. Me want this logs. Me beat logs with rock if I no know why
passenger gibbed or who put the nword on all the monitors in the
station.
>
> ## Technical details
>
> The broadcast log uses the new DeviceNetwork log because I can find no
other appropriate log type. The closest is Chat which announcements use
but this makes no sense.
>
> ## Media
>
>
> - [x] I have added screenshots/videos to this PR showcasing its
changes ingame, **or** this PR does not require an ingame showcase
>
> **Changelog**
>
>
>
> :cl:
> ADMIN:
> - add: Recyclers now leave logs when they gib people.
> - add: People sending a broadcast in the communications console now
leave logs.
Co-authored-by: nikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com>
---
Content.Server/Communications/CommunicationsConsoleSystem.cs | 3 +++
Content.Server/Materials/MaterialReclaimerSystem.cs | 4 ++++
Content.Shared.Database/LogType.cs | 1 +
3 files changed, 8 insertions(+)
diff --git a/Content.Server/Communications/CommunicationsConsoleSystem.cs b/Content.Server/Communications/CommunicationsConsoleSystem.cs
index 6b0b13c410e..6b745c8cd95 100644
--- a/Content.Server/Communications/CommunicationsConsoleSystem.cs
+++ b/Content.Server/Communications/CommunicationsConsoleSystem.cs
@@ -303,6 +303,9 @@ private void OnBroadcastMessage(EntityUid uid, CommunicationsConsoleComponent co
};
_deviceNetworkSystem.QueuePacket(uid, null, payload, net.TransmitFrequency);
+
+ if (message.Session.AttachedEntity != null)
+ _adminLogger.Add(LogType.DeviceNetwork, LogImpact.Low, $"{ToPrettyString(message.Session.AttachedEntity.Value):player} has sent the following broadcast: {message.Message:msg}");
}
private void OnCallShuttleMessage(EntityUid uid, CommunicationsConsoleComponent comp, CommunicationsConsoleCallEmergencyShuttleMessage message)
diff --git a/Content.Server/Materials/MaterialReclaimerSystem.cs b/Content.Server/Materials/MaterialReclaimerSystem.cs
index c976543f7ca..8920daf60d0 100644
--- a/Content.Server/Materials/MaterialReclaimerSystem.cs
+++ b/Content.Server/Materials/MaterialReclaimerSystem.cs
@@ -19,6 +19,8 @@
using Robust.Shared.Player;
using Robust.Shared.Utility;
using System.Linq;
+using Content.Server.Administration.Logs;
+using Content.Shared.Database;
namespace Content.Server.Materials;
@@ -35,6 +37,7 @@ public sealed class MaterialReclaimerSystem : SharedMaterialReclaimerSystem
[Dependency] private readonly PuddleSystem _puddle = default!;
[Dependency] private readonly StackSystem _stack = default!;
[Dependency] private readonly SharedMindSystem _mind = default!;
+ [Dependency] private readonly IAdminLogManager _adminLogger = default!;
///
public override void Initialize()
@@ -154,6 +157,7 @@ public override void Reclaim(EntityUid uid,
if (CanGib(uid, item, component))
{
+ _adminLogger.Add(LogType.Gib, LogImpact.Extreme, $"{ToPrettyString(item):victim} was gibbed by {ToPrettyString(uid):entity} ");
SpawnChemicalsFromComposition(uid, item, completion, false, component, xform);
_body.GibBody(item, true);
_appearance.SetData(uid, RecyclerVisuals.Bloody, true);
diff --git a/Content.Shared.Database/LogType.cs b/Content.Shared.Database/LogType.cs
index cc87dddf302..70a6119130e 100644
--- a/Content.Shared.Database/LogType.cs
+++ b/Content.Shared.Database/LogType.cs
@@ -97,4 +97,5 @@ public enum LogType
///
ChatRateLimited = 87,
AtmosTemperatureChanged = 88,
+ DeviceNetwork = 89,
}