]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add admin log for ghost warping (#33636)
authorDrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com>
Fri, 29 Nov 2024 09:46:24 +0000 (01:46 -0800)
committerGitHub <noreply@github.com>
Fri, 29 Nov 2024 09:46:24 +0000 (10:46 +0100)
Content.Server/Ghost/GhostSystem.cs
Content.Shared.Database/LogType.cs

index 2f4269a05d004c7e08982ad9d236fd6bc70b44f0..77cf813b56b4f712fd76ef5817d7cf0e1d012396 100644 (file)
@@ -1,3 +1,5 @@
+using System.Linq;
+using System.Numerics;
 using Content.Server.Administration.Logs;
 using Content.Server.Chat.Managers;
 using Content.Server.GameTicking;
@@ -32,14 +34,13 @@ using Robust.Shared.Physics.Systems;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Timing;
-using System.Linq;
-using System.Numerics;
 
 namespace Content.Server.Ghost
 {
     public sealed class GhostSystem : SharedGhostSystem
     {
         [Dependency] private readonly SharedActionsSystem _actions = default!;
+        [Dependency] private readonly IAdminLogManager _adminLog = default!;
         [Dependency] private readonly SharedEyeSystem _eye = default!;
         [Dependency] private readonly FollowerSystem _followerSystem = default!;
         [Dependency] private readonly IGameTiming _gameTiming = default!;
@@ -323,6 +324,8 @@ namespace Content.Server.Ghost
 
         private void WarpTo(EntityUid uid, EntityUid target)
         {
+            _adminLog.Add(LogType.GhostWarp, $"{ToPrettyString(uid)} ghost warped to {ToPrettyString(target)}");
+
             if ((TryComp(target, out WarpPointComponent? warp) && warp.Follow) || HasComp<MobStateComponent>(target))
             {
                 _followerSystem.StartFollowingEntity(uid, target);
index 5fedf3c7d4b90cead76ce670478c679802c7e999..91887addeabb0381e3b60bab7354466c8272e8b0 100644 (file)
@@ -115,10 +115,14 @@ public enum LogType
     /// Storage & entity-storage related interactions
     /// </summary>
     Storage = 93,
-    
+
     /// <summary>
     /// A player got hit by an explosion and was dealt damage.
     /// </summary>
     ExplosionHit = 94,
 
+    /// <summary>
+    /// A ghost warped to an entity through the ghost warp menu.
+    /// </summary>
+    GhostWarp = 95,
 }