Make AdminLogsSystem an IoC manager (#8492)

* Make log not entity system

* Fixes
This commit is contained in:
wrexbe
2022-05-28 23:41:17 -07:00
committed by GitHub
parent 0f99a0dd1d
commit 1e0babbd50
79 changed files with 653 additions and 572 deletions

View File

@@ -125,7 +125,7 @@ namespace Content.Server.StationEvents.Events
Occurrences += 1;
LastRun = EntitySystem.Get<GameTicker>().RoundDuration();
EntitySystem.Get<AdminLogSystem>()
IoCManager.Resolve<IAdminLogManager>()
.Add(LogType.EventStarted, LogImpact.High, $"Event startup: {Name}");
}
@@ -135,7 +135,7 @@ namespace Content.Server.StationEvents.Events
/// </summary>
public virtual void Announce()
{
EntitySystem.Get<AdminLogSystem>()
IoCManager.Resolve<IAdminLogManager>()
.Add(LogType.EventAnnounced, $"Event announce: {Name}");
if (StartAnnouncement != null)
@@ -158,7 +158,7 @@ namespace Content.Server.StationEvents.Events
/// </summary>
public virtual void Shutdown()
{
EntitySystem.Get<AdminLogSystem>()
IoCManager.Resolve<IAdminLogManager>()
.Add(LogType.EventStopped, $"Event shutdown: {Name}");
if (EndAnnouncement != null)

View File

@@ -28,7 +28,7 @@ namespace Content.Server.StationEvents
[Dependency] private readonly GameTicker _gameTicker = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly AdminLogSystem _adminLog = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
public StationEvent? CurrentEvent { get; private set; }
public IReadOnlyCollection<StationEvent> StationEvents => _stationEvents;
@@ -72,7 +72,7 @@ namespace Content.Server.StationEvents
/// <returns></returns>
public string RunEvent(string name)
{
_adminLog.Add(LogType.EventRan, LogImpact.High, $"Event run: {name}");
_adminLogger.Add(LogType.EventRan, LogImpact.High, $"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