[add] spawn logs
This commit is contained in:
@@ -293,7 +293,7 @@ namespace Content.Server.Communications
|
|||||||
|
|
||||||
if (message.Session.AttachedEntity is not {Valid: true} mob)
|
if (message.Session.AttachedEntity is not {Valid: true} mob)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//WD-EDIT
|
//WD-EDIT
|
||||||
if (!OnStationCallOrRecall(uid))
|
if (!OnStationCallOrRecall(uid))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ using Content.Server.GameTicking;
|
|||||||
using Content.Shared.Access;
|
using Content.Shared.Access;
|
||||||
using Content.Shared.Access.Components;
|
using Content.Shared.Access.Components;
|
||||||
using Content.Shared.Access.Systems;
|
using Content.Shared.Access.Systems;
|
||||||
|
using Content.Shared.Administration.Logs;
|
||||||
using Content.Shared.Containers.ItemSlots;
|
using Content.Shared.Containers.ItemSlots;
|
||||||
|
using Content.Shared.Database;
|
||||||
using Content.Shared.Hands.Components;
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Hands.EntitySystems;
|
using Content.Shared.Hands.EntitySystems;
|
||||||
using Content.Shared.Inventory;
|
using Content.Shared.Inventory;
|
||||||
@@ -29,6 +31,10 @@ namespace Content.Server.Sandbox
|
|||||||
[Dependency] private readonly GameTicker _ticker = default!;
|
[Dependency] private readonly GameTicker _ticker = default!;
|
||||||
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
|
||||||
|
|
||||||
|
//WD-EDIT
|
||||||
|
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||||
|
//WD-EDIT
|
||||||
|
|
||||||
private bool _isSandboxEnabled;
|
private bool _isSandboxEnabled;
|
||||||
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
@@ -56,6 +62,33 @@ namespace Content.Server.Sandbox
|
|||||||
|
|
||||||
_placementManager.AllowPlacementFunc = placement =>
|
_placementManager.AllowPlacementFunc = placement =>
|
||||||
{
|
{
|
||||||
|
//WD-EDIT
|
||||||
|
|
||||||
|
//Logger.Info($"{placement.MsgChannel.UserName} spawned {placement.EntityTemplateName} on position {placement.EntityCoordinates}");
|
||||||
|
var data = _playerManager.GetSessionByUserId(placement.MsgChannel.UserId);
|
||||||
|
var playerUid = data.AttachedEntity.GetValueOrDefault();
|
||||||
|
var coordinates = placement.EntityCoordinates;
|
||||||
|
switch (placement.PlaceType)
|
||||||
|
{
|
||||||
|
case PlacementManagerMessage.StartPlacement:
|
||||||
|
break;
|
||||||
|
case PlacementManagerMessage.CancelPlacement:
|
||||||
|
break;
|
||||||
|
case PlacementManagerMessage.RequestPlacement:
|
||||||
|
_adminLogger.Add(LogType.EntitySpawn, LogImpact.High, $"{placement.EntityTemplateName} was spawned by" +
|
||||||
|
$" {ToPrettyString(playerUid):player} at " +
|
||||||
|
$"{ToPrettyString(coordinates.EntityId):entity} X={coordinates.X}, Y={coordinates.Y}");
|
||||||
|
break;
|
||||||
|
case PlacementManagerMessage.RequestEntRemove:
|
||||||
|
_adminLogger.Add(LogType.EntitySpawn, LogImpact.High, $"{ToPrettyString(placement.EntityUid):entity} was deleted by {ToPrettyString(playerUid):player}");
|
||||||
|
break;
|
||||||
|
case PlacementManagerMessage.RequestRectRemove:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_adminLogger.Add(LogType.EntitySpawn, $"{ToPrettyString(placement.EntityUid):entity} spawned");
|
||||||
|
|
||||||
|
//WD-EDIT
|
||||||
|
|
||||||
if (IsSandboxEnabled)
|
if (IsSandboxEnabled)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user