Make AdminLogsSystem an IoC manager (#8492)
* Make log not entity system * Fixes
This commit is contained in:
@@ -14,7 +14,7 @@ namespace Content.Server.Construction
|
||||
{
|
||||
public sealed class AnchorableSystem : SharedAnchorableSystem
|
||||
{
|
||||
[Dependency] private readonly AdminLogSystem _adminLogs = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly ToolSystem _toolSystem = default!;
|
||||
[Dependency] private readonly PullingSystem _pullingSystem = default!;
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Content.Server.Construction
|
||||
|
||||
RaiseLocalEvent(uid, new UserUnanchoredEvent(args.User, args.Using), false);
|
||||
|
||||
_adminLogs.Add(
|
||||
_adminLogger.Add(
|
||||
LogType.Action,
|
||||
LogImpact.Low,
|
||||
$"{EntityManager.ToPrettyString(args.User):user} unanchored {EntityManager.ToPrettyString(uid):anchored} using {EntityManager.ToPrettyString(args.Using):using}"
|
||||
@@ -78,7 +78,7 @@ namespace Content.Server.Construction
|
||||
|
||||
RaiseLocalEvent(uid, new UserAnchoredEvent(args.User, args.Using), false);
|
||||
|
||||
_adminLogs.Add(
|
||||
_adminLogger.Add(
|
||||
LogType.Action,
|
||||
LogImpact.Low,
|
||||
$"{EntityManager.ToPrettyString(args.User):user} anchored {EntityManager.ToPrettyString(uid):anchored} using {EntityManager.ToPrettyString(args.Using):using}"
|
||||
|
||||
@@ -22,11 +22,11 @@ public sealed class AdminLog : IGraphAction
|
||||
|
||||
public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager)
|
||||
{
|
||||
var logSys = entityManager.EntitySysManager.GetEntitySystem<AdminLogSystem>();
|
||||
var logManager = IoCManager.Resolve<IAdminLogManager>();
|
||||
|
||||
if (userUid.HasValue)
|
||||
logSys.Add(LogType, Impact, $"{Message} - Entity: {entityManager.ToPrettyString(uid):entity}, User: {entityManager.ToPrettyString(userUid.Value):user}");
|
||||
logManager.Add(LogType, Impact, $"{Message} - Entity: {entityManager.ToPrettyString(uid):entity}, User: {entityManager.ToPrettyString(userUid.Value):user}");
|
||||
else
|
||||
logSys.Add(LogType, Impact, $"{Message} - Entity: {entityManager.ToPrettyString(uid):entity}");
|
||||
logManager.Add(LogType, Impact, $"{Message} - Entity: {entityManager.ToPrettyString(uid):entity}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user