From: Repo <47093363+Titian3@users.noreply.github.com> Date: Fri, 9 Aug 2024 06:24:19 +0000 (+1200) Subject: Add admin logs to Rehydration comp. (#30597) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=31cd2a0927de3d5aa6f2fda7491cd61a0bce5c54;p=space-station-14.git Add admin logs to Rehydration comp. (#30597) --- diff --git a/Content.Shared/Chemistry/EntitySystems/RehydratableSystem.cs b/Content.Shared/Chemistry/EntitySystems/RehydratableSystem.cs index 36ca791290..0f5d51057f 100644 --- a/Content.Shared/Chemistry/EntitySystems/RehydratableSystem.cs +++ b/Content.Shared/Chemistry/EntitySystems/RehydratableSystem.cs @@ -1,4 +1,6 @@ +using Content.Shared.Administration.Logs; using Content.Shared.Chemistry.Components; +using Content.Shared.Database; using Content.Shared.FixedPoint; using Content.Shared.Popups; using Robust.Shared.Network; @@ -13,6 +15,7 @@ public sealed class RehydratableSystem : EntitySystem [Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly SharedSolutionContainerSystem _solutions = default!; [Dependency] private readonly SharedTransformSystem _xform = default!; + [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!; public override void Initialize() { @@ -24,6 +27,7 @@ public sealed class RehydratableSystem : EntitySystem private void OnSolutionChange(Entity ent, ref SolutionContainerChangedEvent args) { var quantity = _solutions.GetTotalPrototypeQuantity(ent, ent.Comp.CatalystPrototype); + _adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(ent.Owner)} was hydrated, now contains a solution of: {SharedSolutionContainerSystem.ToPrettyString(args.Solution)}."); if (quantity != FixedPoint2.Zero && quantity >= ent.Comp.CatalystMinimum) { Expand(ent); @@ -41,6 +45,8 @@ public sealed class RehydratableSystem : EntitySystem var randomMob = _random.Pick(comp.PossibleSpawns); var target = Spawn(randomMob, Transform(uid).Coordinates); + _adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(ent.Owner)} has been hydrated correctly and spawned: {ToPrettyString(target)}."); + _popup.PopupEntity(Loc.GetString("rehydratable-component-expands-message", ("owner", uid)), target); _xform.AttachToGridOrMap(target);