diff --git a/Content.Server/Ghost/Roles/GhostRoleSystem.cs b/Content.Server/Ghost/Roles/GhostRoleSystem.cs index e82402345a..9977e490d2 100644 --- a/Content.Server/Ghost/Roles/GhostRoleSystem.cs +++ b/Content.Server/Ghost/Roles/GhostRoleSystem.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using Content.Server.Administration; +using Content.Server.Administration.Logs; using Content.Server.EUI; using Content.Server.Ghost.Components; using Content.Server.Ghost.Roles.Components; @@ -8,6 +9,7 @@ using Content.Server.Mind.Components; using Content.Server.MobState.States; using Content.Server.Players; using Content.Shared.Administration; +using Content.Shared.Database; using Content.Shared.GameTicking; using Content.Shared.Ghost; using Content.Shared.Ghost.Roles; @@ -29,6 +31,7 @@ namespace Content.Server.Ghost.Roles { [Dependency] private readonly EuiManager _euiManager = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; + [Dependency] private readonly AdminLogSystem _adminLogSystem = default!; private uint _nextRoleIdentifier; private bool _needsUpdateGhostRoleCount = true; @@ -178,6 +181,10 @@ namespace Content.Server.Ghost.Roles { if (!_ghostRoles.TryGetValue(identifier, out var role)) return; if (!role.Take(player)) return; + + if (player.AttachedEntity != null) + _adminLogSystem.Add(LogType.GhostRoleTaken, LogImpact.Low, $"{player:player} took the {role.RoleName:roleName} ghost role {ToPrettyString(player.AttachedEntity.Value):entity}"); + CloseEui(player); } diff --git a/Content.Shared.Database/LogType.cs b/Content.Shared.Database/LogType.cs index 1928f13fc2..80e3eb0609 100644 --- a/Content.Shared.Database/LogType.cs +++ b/Content.Shared.Database/LogType.cs @@ -61,4 +61,5 @@ public enum LogType AtmosFilterChanged = 57, AtmosRatioChanged = 58, Emitter = 59, + GhostRoleTaken = 60, }