diff --git a/Content.Server/StationEvents/Events/StationEvent.cs b/Content.Server/StationEvents/Events/StationEvent.cs index 5e9e0c717b..6be4c15030 100644 --- a/Content.Server/StationEvents/Events/StationEvent.cs +++ b/Content.Server/StationEvents/Events/StationEvent.cs @@ -1,5 +1,8 @@ +using Content.Server.Administration.Logs; using Content.Server.Chat.Managers; +using Content.Shared.Administration.Logs; using Robust.Shared.Audio; +using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Player; @@ -103,6 +106,9 @@ namespace Content.Server.StationEvents.Events { Started = true; Occurrences += 1; + + EntitySystem.Get() + .Add(LogType.EventStarted, $"Event startup: {Name}"); } /// @@ -111,6 +117,9 @@ namespace Content.Server.StationEvents.Events /// public virtual void Announce() { + EntitySystem.Get() + .Add(LogType.EventAnnounced, $"Event announce: {Name}"); + if (StartAnnouncement != null) { var chatManager = IoCManager.Resolve(); @@ -131,6 +140,9 @@ namespace Content.Server.StationEvents.Events /// public virtual void Shutdown() { + EntitySystem.Get() + .Add(LogType.EventAnnounced, $"Event shutdown: {Name}"); + if (EndAnnouncement != null) { var chatManager = IoCManager.Resolve(); diff --git a/Content.Server/StationEvents/StationEventSystem.cs b/Content.Server/StationEvents/StationEventSystem.cs index aeab52e2c7..8519e7ecea 100644 --- a/Content.Server/StationEvents/StationEventSystem.cs +++ b/Content.Server/StationEvents/StationEventSystem.cs @@ -2,9 +2,11 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; +using Content.Server.Administration.Logs; using Content.Server.GameTicking; using Content.Server.StationEvents.Events; using Content.Shared; +using Content.Shared.Administration.Logs; using Content.Shared.CCVar; using Content.Shared.GameTicking; using Content.Shared.StationEvents; @@ -33,6 +35,8 @@ namespace Content.Server.StationEvents [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly AdminLogSystem _adminLog = default!; + public StationEvent? CurrentEvent { get; private set; } public IReadOnlyCollection StationEvents => _stationEvents; @@ -91,6 +95,8 @@ namespace Content.Server.StationEvents /// public string RunEvent(string name) { + _adminLog.Add(LogType.EventRan, $"Event run: {name}"); + // Could use a dictionary but it's such a minor thing, eh. // Wasn't sure on whether to localize this given it's a command var upperName = name.ToUpperInvariant(); diff --git a/Content.Shared/Administration/Logs/LogType.cs b/Content.Shared/Administration/Logs/LogType.cs index f2e264c4e0..97bd666916 100644 --- a/Content.Shared/Administration/Logs/LogType.cs +++ b/Content.Shared/Administration/Logs/LogType.cs @@ -8,4 +8,8 @@ public enum LogType Damaged = 2, Healed = 3, Slip = 4, + EventAnnounced = 5, + EventStarted = 6, + EventRan = 6, + EventStopped = 7, }