From 74abdb9125daa9f0c074063c2e41da819f2bd1dc Mon Sep 17 00:00:00 2001
From: SimpleStation14 <130339894+SimpleStation14@users.noreply.github.com>
Date: Sat, 4 May 2024 17:33:58 -0700
Subject: [PATCH] Mirror: More fax logging (#174)
## Mirror of PR #25911: [More fax
logging](https://github.com/space-wizards/space-station-14/pull/25911)
from
[space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14)
###### `c27c7086c0acc41b3f58710811bd9358de94fc8c`
PR opened by
Deatherd at
2024-03-07 15:31:19 UTC
PR merged by
web-flow at
2024-03-13 09:03:12 UTC
---
PR changed 1 files with 13 additions and 2 deletions.
The PR had the following labels:
- Status: Needs Review
---
Original Body
>
>
>
> ## About the PR
> Added logging for copying and printing from a file using fax.
>
> ## Why / Balance
> My solution for issue
[#25694](https://github.com/space-wizards/space-station-14/issues/25694),
that takes into account the logic of fax operation.
>
> ## Technical details
> Now an admin log is added when adding a fax task to copy or print from
a file.
>
> ## Media
>
>
> - [X] I have added screenshots/videos to this PR showcasing its
changes ingame, **or** this PR does not require an ingame showcase
>
> ## Breaking changes
>
>
> **Changelog**
>
>
>
>
Co-authored-by: Deatherd <69344159+Deatherd@users.noreply.github.com>
---
Content.Server/Fax/FaxSystem.cs | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/Content.Server/Fax/FaxSystem.cs b/Content.Server/Fax/FaxSystem.cs
index 265a20ce1c9..3ff139466f5 100644
--- a/Content.Server/Fax/FaxSystem.cs
+++ b/Content.Server/Fax/FaxSystem.cs
@@ -313,7 +313,7 @@ private void OnFileButtonPressed(EntityUid uid, FaxMachineComponent component, F
private void OnCopyButtonPressed(EntityUid uid, FaxMachineComponent component, FaxCopyMessage args)
{
- Copy(uid, component);
+ Copy(uid, component, args);
}
private void OnSendButtonPressed(EntityUid uid, FaxMachineComponent component, FaxSendMessage args)
@@ -416,13 +416,20 @@ public void PrintFile(EntityUid uid, FaxMachineComponent component, FaxFileMessa
component.SendTimeoutRemaining += component.SendTimeout;
UpdateUserInterface(uid, component);
+
+ if (args.Session.AttachedEntity != null)
+ _adminLogger.Add(LogType.Action, LogImpact.Low,
+ $"{ToPrettyString(args.Session.AttachedEntity.Value):actor} added print job to {ToPrettyString(uid):tool} with text: {args.Content}");
+ else
+ _adminLogger.Add(LogType.Action, LogImpact.Low,
+ $"Someone added print job to {ToPrettyString(uid):tool} with text: {args.Content}");
}
///
/// Copies the paper in the fax. A timeout is set after copying,
/// which is shared by the send button.
///
- public void Copy(EntityUid uid, FaxMachineComponent? component = null)
+ public void Copy(EntityUid uid, FaxMachineComponent? component, FaxCopyMessage args)
{
if (!Resolve(uid, ref component))
return;
@@ -449,6 +456,10 @@ public void Copy(EntityUid uid, FaxMachineComponent? component = null)
// will start immediately.
UpdateUserInterface(uid, component);
+
+ if (args.Session.AttachedEntity != null)
+ _adminLogger.Add(LogType.Action, LogImpact.Low,
+ $"{ToPrettyString(args.Session.AttachedEntity.Value):actor} added copy job to {ToPrettyString(uid):tool} with text: {ToPrettyString(component.PaperSlot.Item):subject}");
}
///