Skip to content

Commit

Permalink
Add admin log for ghost warping (#33636)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrSmugleaf authored Nov 29, 2024
1 parent 422d1a9 commit 3ad227a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Content.Server/Ghost/GhostSystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Linq;
using System.Numerics;
using Content.Server.Administration.Logs;
using Content.Server.Chat.Managers;
using Content.Server.GameTicking;
Expand Down Expand Up @@ -32,14 +34,13 @@
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!;
Expand Down Expand Up @@ -323,6 +324,8 @@ private void OnGhostnadoRequest(GhostnadoRequestEvent msg, EntitySessionEventArg

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);
Expand Down
6 changes: 5 additions & 1 deletion Content.Shared.Database/LogType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

0 comments on commit 3ad227a

Please sign in to comment.