Skip to content

Commit

Permalink
Mirror: Add logs to recycler gibbing and broadcasting. (#156)
Browse files Browse the repository at this point in the history
## Mirror of PR #26008: [Add logs to recycler gibbing and
broadcasting.](space-wizards/space-station-14#26008)
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)

###### `2b8415b378c181fd0222cdf7f4d005a70ebe8044`

PR opened by <img
src="https://avatars.githubusercontent.com/u/32041239?v=4"
width="16"/><a href="https://github.com/nikthechampiongr">
nikthechampiongr</a> at 2024-03-11 18:01:29 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-12 10:57:05 UTC

---

PR changed 3 files with 8 additions and 0 deletions.

The PR had the following labels:
- Status: Needs Review


---

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

> fixes #25556 
> fixes #25037 
> 
> <!-- 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
> <!-- What did you change in this PR? -->
> This just adds logs for broadcasting and getting gibbed by a recycler.
> 
> ## Why / Balance
> <!-- Why was it changed? Link any discussions or issues here. Please
discuss how this would affect game 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
> <!-- If this is a code change, summarize at high level how your new
code works. This makes it easier to review. -->
> 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
> <!-- 
> 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
> 
> **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!
> -->
> 🆑
> ADMIN:
> - add: Recyclers now leave logs when they gib people.
> - add: People sending a broadcast in the communications console now
leave logs.


</details>

Co-authored-by: nikthechampiongr <[email protected]>
  • Loading branch information
SimpleStation14 and nikthechampiongr authored May 4, 2024
1 parent b1e3b79 commit a751152
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Content.Server/Communications/CommunicationsConsoleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions Content.Server/Materials/MaterialReclaimerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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!;

/// <inheritdoc/>
public override void Initialize()
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions Content.Shared.Database/LogType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,5 @@ public enum LogType
/// </summary>
ChatRateLimited = 87,
AtmosTemperatureChanged = 88,
DeviceNetwork = 89,
}

0 comments on commit a751152

Please sign in to comment.