Adds logging to stripping and construction starting (#11952)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Content.Server.Administration.Logs;
|
||||||
using Content.Server.Construction.Components;
|
using Content.Server.Construction.Components;
|
||||||
using Content.Server.DoAfter;
|
using Content.Server.DoAfter;
|
||||||
using Content.Server.Hands.Components;
|
using Content.Server.Hands.Components;
|
||||||
@@ -10,6 +11,7 @@ using Content.Shared.Construction;
|
|||||||
using Content.Shared.Construction.Prototypes;
|
using Content.Shared.Construction.Prototypes;
|
||||||
using Content.Shared.Construction.Steps;
|
using Content.Shared.Construction.Steps;
|
||||||
using Content.Shared.Coordinates;
|
using Content.Shared.Coordinates;
|
||||||
|
using Content.Shared.Database;
|
||||||
using Content.Shared.Hands.EntitySystems;
|
using Content.Shared.Hands.EntitySystems;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Inventory;
|
using Content.Shared.Inventory;
|
||||||
@@ -481,7 +483,7 @@ namespace Content.Server.Construction
|
|||||||
EntityManager.GetComponent<TransformComponent>(structure).Anchored = wasAnchored;
|
EntityManager.GetComponent<TransformComponent>(structure).Anchored = wasAnchored;
|
||||||
|
|
||||||
RaiseNetworkEvent(new AckStructureConstructionMessage(ev.Ack));
|
RaiseNetworkEvent(new AckStructureConstructionMessage(ev.Ack));
|
||||||
|
_adminLogger.Add(LogType.Construction, LogImpact.Low, $"{ToPrettyString(user):player} has started construction on the ghost of a {ev.PrototypeName}");
|
||||||
Cleanup();
|
Cleanup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ namespace Content.Server.Construction
|
|||||||
ChangeNode(uid, user, edge.Target, true, construction);
|
ChangeNode(uid, user, edge.Target, true, construction);
|
||||||
|
|
||||||
if (ev is ConstructionDoAfterComplete event1 && event1.WrappedEvent is InteractUsingEvent event2)
|
if (ev is ConstructionDoAfterComplete event1 && event1.WrappedEvent is InteractUsingEvent event2)
|
||||||
_adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(event2.User):player} changed {ToPrettyString(uid):entity}'s node to {edge.Target}");
|
_adminLogger.Add(LogType.Construction, LogImpact.Low, $"{ToPrettyString(event2.User):player} changed {ToPrettyString(uid):entity}'s node to {edge.Target}");
|
||||||
}
|
}
|
||||||
|
|
||||||
return HandleResult.True;
|
return HandleResult.True;
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ using Content.Shared.Verbs;
|
|||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using Content.Server.Administration.Logs;
|
||||||
|
using Content.Shared.Database;
|
||||||
|
|
||||||
namespace Content.Server.Strip
|
namespace Content.Server.Strip
|
||||||
{
|
{
|
||||||
@@ -26,6 +28,7 @@ namespace Content.Server.Strip
|
|||||||
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
||||||
[Dependency] private readonly EnsnareableSystem _ensnaring = default!;
|
[Dependency] private readonly EnsnareableSystem _ensnaring = default!;
|
||||||
[Dependency] private readonly UserInterfaceSystem _userInterfaceSystem = default!;
|
[Dependency] private readonly UserInterfaceSystem _userInterfaceSystem = default!;
|
||||||
|
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||||
|
|
||||||
// TODO: ECS popups. Not all of these have ECS equivalents yet.
|
// TODO: ECS popups. Not all of these have ECS equivalents yet.
|
||||||
|
|
||||||
@@ -203,7 +206,11 @@ namespace Content.Server.Strip
|
|||||||
&& _handsSystem.TryDrop(user, userHands.ActiveHand, handsComp: userHands))
|
&& _handsSystem.TryDrop(user, userHands.ActiveHand, handsComp: userHands))
|
||||||
{
|
{
|
||||||
_inventorySystem.TryEquip(user, component.Owner, held, slot);
|
_inventorySystem.TryEquip(user, component.Owner, held, slot);
|
||||||
|
|
||||||
|
_adminLogger.Add(LogType.Stripping, LogImpact.Medium, $"{ToPrettyString(user):user} has placed the item {ToPrettyString(held):item} in {ToPrettyString(component.Owner):target}'s {slot} slot");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -265,6 +272,7 @@ namespace Content.Server.Strip
|
|||||||
|
|
||||||
_handsSystem.TryDrop(user, checkActionBlocker: false, handsComp: userHands);
|
_handsSystem.TryDrop(user, checkActionBlocker: false, handsComp: userHands);
|
||||||
_handsSystem.TryPickup(component.Owner, held, handName, checkActionBlocker: false, animateUser: true, handsComp: hands);
|
_handsSystem.TryPickup(component.Owner, held, handName, checkActionBlocker: false, animateUser: true, handsComp: hands);
|
||||||
|
_adminLogger.Add(LogType.Stripping, LogImpact.Medium, $"{ToPrettyString(user):user} has placed the item {ToPrettyString(held):item} in {ToPrettyString(component.Owner):target}'s hands");
|
||||||
// hand update will trigger strippable update
|
// hand update will trigger strippable update
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -336,6 +344,7 @@ namespace Content.Server.Strip
|
|||||||
RaiseLocalEvent(item.Value, new DroppedEvent(user), true);
|
RaiseLocalEvent(item.Value, new DroppedEvent(user), true);
|
||||||
|
|
||||||
_handsSystem.PickupOrDrop(user, item.Value);
|
_handsSystem.PickupOrDrop(user, item.Value);
|
||||||
|
_adminLogger.Add(LogType.Stripping, LogImpact.Medium, $"{ToPrettyString(user):user} has stripped the item {ToPrettyString(item.Value):item} from {ToPrettyString(component.Owner):target}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -399,6 +408,7 @@ namespace Content.Server.Strip
|
|||||||
_handsSystem.TryDrop(component.Owner, hand, checkActionBlocker: false, handsComp: hands);
|
_handsSystem.TryDrop(component.Owner, hand, checkActionBlocker: false, handsComp: hands);
|
||||||
_handsSystem.PickupOrDrop(user, held, handsComp: userHands);
|
_handsSystem.PickupOrDrop(user, held, handsComp: userHands);
|
||||||
// hand update will trigger strippable update
|
// hand update will trigger strippable update
|
||||||
|
_adminLogger.Add(LogType.Stripping, LogImpact.Medium, $"{ToPrettyString(user):user} has stripped the item {ToPrettyString(held):item} from {ToPrettyString(component.Owner):target}");
|
||||||
}
|
}
|
||||||
|
|
||||||
private sealed class OpenStrippingCompleteEvent
|
private sealed class OpenStrippingCompleteEvent
|
||||||
|
|||||||
@@ -77,4 +77,5 @@ public enum LogType
|
|||||||
CableCut = 72,
|
CableCut = 72,
|
||||||
StorePurchase = 73,
|
StorePurchase = 73,
|
||||||
LatticeCut = 74,
|
LatticeCut = 74,
|
||||||
|
Stripping = 75,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user