Add present logs (#13144)

* add logs for SpawnItemsOnUse

* add logs for RandomGift

* add and use EntitySpawn log type
This commit is contained in:
Chief-Engineer
2022-12-24 18:59:49 -06:00
committed by GitHub
parent a88d437f52
commit 5eadce16ec
3 changed files with 10 additions and 1 deletions

View File

@@ -1,4 +1,6 @@
using Content.Server.Administration.Logs;
using Content.Server.Storage.Components;
using Content.Shared.Database;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Interaction.Events;
using Content.Shared.Storage;
@@ -11,6 +13,7 @@ namespace Content.Server.Storage.EntitySystems
public sealed class SpawnItemsOnUseSystem : EntitySystem
{
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
public override void Initialize()
@@ -32,6 +35,7 @@ namespace Content.Server.Storage.EntitySystems
foreach (var proto in spawnEntities)
{
entityToPlaceInHands = Spawn(proto, coords);
_adminLogger.Add(LogType.EntitySpawn, LogImpact.Low, $"{ToPrettyString(args.User)} used {ToPrettyString(component.Owner)} which spawned {ToPrettyString(entityToPlaceInHands.Value)}");
}
if (component.Sound != null)