Revert "Admin logs (#5419)"

This reverts commit 319aec109d.
This commit is contained in:
DrSmugleaf
2021-11-22 18:55:17 +01:00
parent edeccabb36
commit c18d07538a
65 changed files with 236 additions and 7021 deletions

View File

@@ -1,7 +1,8 @@
using System.Collections.Generic;
using System.Linq;
using Content.Shared.Administration.Logs;
using Content.Shared.Damage.Prototypes;
using Content.Shared.FixedPoint;
using Content.Shared.Movement.EntitySystems;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
@@ -14,8 +15,6 @@ namespace Content.Shared.Damage
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly SharedAdminLogSystem _logs = default!;
public override void Initialize()
{
SubscribeLocalEvent<DamageableComponent, ComponentInit>(DamageableInit);
@@ -23,17 +22,6 @@ namespace Content.Shared.Damage
SubscribeLocalEvent<DamageableComponent, ComponentGetState>(DamageableGetState);
}
protected virtual void SetTotalDamage(DamageableComponent damageable, FixedPoint2 @new)
{
var owner = damageable.Owner;
var old = damageable.TotalDamage;
var change = @new - old;
_logs.Add(LogType.DamageChange, $"{owner} received {change} damage. Old: {old} | New: {@new}");
damageable.TotalDamage = @new;
}
/// <summary>
/// Initialize a damageable component
/// </summary>
@@ -95,7 +83,7 @@ namespace Content.Shared.Damage
public void DamageChanged(DamageableComponent component, DamageSpecifier? damageDelta = null)
{
component.DamagePerGroup = component.Damage.GetDamagePerGroup();
SetTotalDamage(component, component.Damage.Total);
component.TotalDamage = component.Damage.Total;
component.Dirty();
if (EntityManager.TryGetComponent<SharedAppearanceComponent>(component.OwnerUid, out var appearance) && damageDelta != null)