Skip to content

Commit

Permalink
Mirror: More fax logging (#174)
Browse files Browse the repository at this point in the history
## Mirror of PR #25911: [More fax
logging](space-wizards/space-station-14#25911)
from <img src="https://avatars.githubusercontent.com/u/10567778?v=4"
alt="space-wizards" width="22"/>
[space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14)

###### `c27c7086c0acc41b3f58710811bd9358de94fc8c`

PR opened by <img
src="https://avatars.githubusercontent.com/u/69344159?v=4"
width="16"/><a href="https://github.com/Deatherd"> Deatherd</a> at
2024-03-07 15:31:19 UTC
PR merged by <img
src="https://avatars.githubusercontent.com/u/19864447?v=4"
width="16"/><a href="https://github.com/web-flow"> web-flow</a> 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


---

<details open="true"><summary><h1>Original Body</h1></summary>

> <!-- Please read these guidelines before opening your PR:
https://docs.spacestation14.io/en/getting-started/pr-guideline -->
> <!-- The text between the arrows are comments - they will not be
visible on your PR. -->
> 
> ## About the PR
> Added logging for copying and printing from a file using fax.
> 
> ## Why / Balance
> My solution for issue
[#25694](space-wizards/space-station-14#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
> <!-- 
> PRs which make ingame changes (adding clothing, items, new features,
etc) are required to have media attached that showcase the changes.
> Small fixes/refactors are exempt.
> Any media may be used in SS14 progress reports, with clear credit
given.
> 
> If you're unsure whether your PR will require media, ask a maintainer.
> 
> Check the box below to confirm that you have in fact seen this (put an
X in the brackets, like [X]):
> -->
> 
> - [X] I have added screenshots/videos to this PR showcasing its
changes ingame, **or** this PR does not require an ingame showcase
> 
> ## Breaking changes
> <!--
> List any breaking changes, including namespace, public
class/method/field changes, prototype renames; and provide instructions
for fixing them. This will be pasted in #codebase-changes.
> -->
> 
> **Changelog**
> <!--
> Make players aware of new features and changes that could affect how
they play the game by adding a Changelog entry. Please read the
Changelog guidelines located at:
https://docs.spacestation14.io/en/getting-started/pr-guideline#changelog
> -->
> 
> <!--
> Make sure to take this Changelog template out of the comment block in
order for it to show up.
> 🆑
> - add: Added fun!
> - remove: Removed fun!
> - tweak: Changed fun!
> - fix: Fixed fun!
> -->
> 


</details>

Co-authored-by: Deatherd <[email protected]>
  • Loading branch information
SimpleStation14 and Deatherd authored May 5, 2024
1 parent a507435 commit 74abdb9
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Content.Server/Fax/FaxSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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}");
}

/// <summary>
/// Copies the paper in the fax. A timeout is set after copying,
/// which is shared by the send button.
/// </summary>
public void Copy(EntityUid uid, FaxMachineComponent? component = null)
public void Copy(EntityUid uid, FaxMachineComponent? component, FaxCopyMessage args)
{
if (!Resolve(uid, ref component))
return;
Expand All @@ -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}");
}

/// <summary>
Expand Down

0 comments on commit 74abdb9

Please sign in to comment.