Adds even more important Admin Logging (#10268)
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System.Linq;
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Chemistry.Components.SolutionManager;
|
||||
using Content.Server.Explosion.Components;
|
||||
using Content.Server.Flash;
|
||||
using Content.Server.Flash.Components;
|
||||
@@ -13,7 +15,10 @@ using Content.Shared.Trigger;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Explosion;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Payload.Components;
|
||||
using Content.Shared.StepTrigger.Systems;
|
||||
using Robust.Server.Containers;
|
||||
using Robust.Shared.Containers;
|
||||
|
||||
namespace Content.Server.Explosion.EntitySystems
|
||||
{
|
||||
@@ -39,7 +44,8 @@ namespace Content.Server.Explosion.EntitySystems
|
||||
[Dependency] private readonly FixtureSystem _fixtures = default!;
|
||||
[Dependency] private readonly FlashSystem _flashSystem = default!;
|
||||
[Dependency] private readonly SharedBroadphaseSystem _broadphase = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger= default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly SharedContainerSystem _container = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -118,8 +124,24 @@ namespace Content.Server.Explosion.EntitySystems
|
||||
|
||||
if (user != null)
|
||||
{
|
||||
_adminLogger.Add(LogType.Trigger,
|
||||
$"{ToPrettyString(user.Value):user} started a {delay} second timer trigger on entity {ToPrettyString(uid):timer}");
|
||||
// Check if entity is bomb/mod. grenade/etc
|
||||
if (_container.TryGetContainer(uid, "payload", out IContainer? container) &&
|
||||
TryComp(container.ContainedEntities.First(), out ChemicalPayloadComponent? chemicalPayloadComponent))
|
||||
{
|
||||
// If a beaker is missing, the entity won't explode, so no reason to log it
|
||||
if (!TryComp(chemicalPayloadComponent?.BeakerSlotA.Item, out SolutionContainerManagerComponent? beakerA) ||
|
||||
!TryComp(chemicalPayloadComponent?.BeakerSlotB.Item, out SolutionContainerManagerComponent? beakerB))
|
||||
return;
|
||||
|
||||
_adminLogger.Add(LogType.Trigger,
|
||||
$"{ToPrettyString(user.Value):user} started a {delay} second timer trigger on entity {ToPrettyString(uid):timer}, which contains [{string.Join(", ", beakerA.Solutions.Values.First())}] in one beaker and [{string.Join(", ", beakerB.Solutions.Values.First())}] in the other.");
|
||||
}
|
||||
else
|
||||
{
|
||||
_adminLogger.Add(LogType.Trigger,
|
||||
$"{ToPrettyString(user.Value):user} started a {delay} second timer trigger on entity {ToPrettyString(uid):timer}");
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user