add glue logs (#18667)
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
using Content.Server.Administration.Logs;
|
||||||
using Content.Shared.IdentityManagement;
|
using Content.Shared.IdentityManagement;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using Content.Shared.Item;
|
using Content.Shared.Item;
|
||||||
@@ -5,6 +6,7 @@ using Content.Shared.Glue;
|
|||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Server.Chemistry.EntitySystems;
|
using Content.Server.Chemistry.EntitySystems;
|
||||||
using Content.Server.Nutrition.Components;
|
using Content.Server.Nutrition.Components;
|
||||||
|
using Content.Shared.Database;
|
||||||
using Content.Shared.Hands;
|
using Content.Shared.Hands;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using Content.Shared.Interaction.Components;
|
using Content.Shared.Interaction.Components;
|
||||||
@@ -18,6 +20,7 @@ public sealed class GlueSystem : SharedGlueSystem
|
|||||||
[Dependency] private readonly SolutionContainerSystem _solutionContainer = default!;
|
[Dependency] private readonly SolutionContainerSystem _solutionContainer = default!;
|
||||||
[Dependency] private readonly IGameTiming _timing = default!;
|
[Dependency] private readonly IGameTiming _timing = default!;
|
||||||
[Dependency] private readonly MetaDataSystem _metaData = default!;
|
[Dependency] private readonly MetaDataSystem _metaData = default!;
|
||||||
|
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -42,7 +45,7 @@ public sealed class GlueSystem : SharedGlueSystem
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TryGlue(uid, component, target))
|
if (TryGlue(uid, component, target, args.User))
|
||||||
{
|
{
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
_audio.PlayPvs(component.Squeeze, uid);
|
_audio.PlayPvs(component.Squeeze, uid);
|
||||||
@@ -54,7 +57,7 @@ public sealed class GlueSystem : SharedGlueSystem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool TryGlue(EntityUid uid, GlueComponent component, EntityUid target)
|
private bool TryGlue(EntityUid uid, GlueComponent component, EntityUid target, EntityUid actor)
|
||||||
{
|
{
|
||||||
// if item is glued then don't apply glue again so it can be removed for reasonable time
|
// if item is glued then don't apply glue again so it can be removed for reasonable time
|
||||||
if (HasComp<GluedComponent>(target) || !HasComp<ItemComponent>(target))
|
if (HasComp<GluedComponent>(target) || !HasComp<ItemComponent>(target))
|
||||||
@@ -68,6 +71,7 @@ public sealed class GlueSystem : SharedGlueSystem
|
|||||||
if (quantity > 0)
|
if (quantity > 0)
|
||||||
{
|
{
|
||||||
EnsureComp<GluedComponent>(target).Duration = quantity.Double() * component.DurationPerUnit;
|
EnsureComp<GluedComponent>(target).Duration = quantity.Double() * component.DurationPerUnit;
|
||||||
|
_adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(actor):actor} glued {ToPrettyString(target):subject} with {ToPrettyString(uid):tool}");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user