Add machine logs (#13185)
* add material insert logs * add lathe queue logs * add grav gen power logs * fix count * replace SharedStackComponent with StackComponent and rm unused imports * use TryComp * fix import
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Construction;
|
||||
using Content.Server.Lathe.Components;
|
||||
using Content.Server.Materials;
|
||||
using Content.Server.Power.Components;
|
||||
using Content.Server.Power.EntitySystems;
|
||||
using Content.Server.UserInterface;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Lathe;
|
||||
using Content.Shared.Materials;
|
||||
using Content.Shared.Research.Components;
|
||||
@@ -22,6 +24,7 @@ namespace Content.Server.Lathe
|
||||
{
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] private readonly IPrototypeManager _proto = default!;
|
||||
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly UserInterfaceSystem _uiSys = default!;
|
||||
@@ -287,10 +290,15 @@ namespace Content.Server.Lathe
|
||||
{
|
||||
if (_proto.TryIndex(args.ID, out LatheRecipePrototype? recipe))
|
||||
{
|
||||
var count = 0;
|
||||
for (var i = 0; i < args.Quantity; i++)
|
||||
{
|
||||
TryAddToQueue(uid, recipe, component);
|
||||
if (TryAddToQueue(uid, recipe, component))
|
||||
count++;
|
||||
}
|
||||
if (count > 0 && args.Session.AttachedEntity != null)
|
||||
_adminLogger.Add(LogType.Action, LogImpact.Low,
|
||||
$"{ToPrettyString(args.Session.AttachedEntity.Value):player} queued {count} {recipe.Name} at {ToPrettyString(uid):lathe}");
|
||||
}
|
||||
TryStartProducing(uid, component);
|
||||
UpdateUserInterfaceState(uid, component);
|
||||
|
||||
Reference in New Issue
Block a user