]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Bluespace Anomaly Admin Logs (#23942)
authorTrevor Day <tday93@users.noreply.github.com>
Thu, 11 Jan 2024 21:56:06 +0000 (13:56 -0800)
committerGitHub <noreply@github.com>
Thu, 11 Jan 2024 21:56:06 +0000 (16:56 -0500)
Add bluespace anomaly teleportation logs.

Content.Server/Anomaly/Effects/BluespaceAnomalySystem.cs

index 603396e31ac54dc041c0b01cfba82fd5f27c5255..87c0ba4a4eedd742933e90a8e14fb655bc05de97 100644 (file)
@@ -1,7 +1,9 @@
 using System.Linq;
 using System.Numerics;
 using Content.Server.Anomaly.Components;
+using Content.Shared.Administration.Logs;
 using Content.Shared.Anomaly.Components;
+using Content.Shared.Database;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Teleportation.Components;
 using Robust.Shared.Audio;
@@ -13,6 +15,7 @@ namespace Content.Server.Anomaly.Effects;
 public sealed class BluespaceAnomalySystem : EntitySystem
 {
     [Dependency] private readonly IRobustRandom _random = default!;
+    [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
     [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly EntityLookupSystem _lookup = default!;
     [Dependency] private readonly SharedTransformSystem _xform = default!;
@@ -43,6 +46,8 @@ public sealed class BluespaceAnomalySystem : EntitySystem
         _random.Shuffle(coords);
         for (var i = 0; i < allEnts.Count; i++)
         {
+
+            _adminLogger.Add(LogType.Teleport, $"{ToPrettyString(allEnts[i])} has been shuffled to {coords[i]} by the {ToPrettyString(uid)} at {xform.Coordinates}");
             _xform.SetWorldPosition(allEnts[i], coords[i], xformQuery);
         }
     }
@@ -62,6 +67,9 @@ public sealed class BluespaceAnomalySystem : EntitySystem
             var randomY = _random.NextFloat(gridBounds.Bottom, gridBounds.Top);
 
             var pos = new Vector2(randomX, randomY);
+
+            _adminLogger.Add(LogType.Teleport, $"{ToPrettyString(ent)} has been teleported to {pos} by the supercritical {ToPrettyString(uid)} at {mapPos}");
+
             _xform.SetWorldPosition(ent, pos);
             _audio.PlayPvs(component.TeleportSound, ent);
         }