Make AdminLogsSystem an IoC manager (#8492)

* Make log not entity system

* Fixes
This commit is contained in:
wrexbe
2022-05-28 23:41:17 -07:00
committed by GitHub
parent 0f99a0dd1d
commit 1e0babbd50
79 changed files with 653 additions and 572 deletions

View File

@@ -479,7 +479,7 @@ namespace Content.Server.Atmos.EntitySystems
}
if(tileCount > 10 && (totalMolesRemoved / tileCount) > 20)
_adminLog.Add(LogType.ExplosiveDepressurization, LogImpact.High,
_adminLogger.Add(LogType.ExplosiveDepressurization, LogImpact.High,
$"Explosive depressurization removed {totalMolesRemoved} moles from {tileCount} tiles starting from position {tile.GridIndices:position} on grid ID {tile.GridIndex:grid}");
Array.Clear(_depressurizeTiles, 0, Atmospherics.MonstermosHardTileLimit);

View File

@@ -16,7 +16,7 @@ namespace Content.Server.Atmos.EntitySystems
public sealed partial class AtmosphereSystem : SharedAtmosphereSystem
{
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly AdminLogSystem _adminLog = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly SharedContainerSystem _containers = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;

View File

@@ -15,7 +15,7 @@ namespace Content.Server.Atmos.EntitySystems
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
[Dependency] private readonly AlertsSystem _alertsSystem = default!;
[Dependency] private readonly AdminLogSystem _logSystem = default!;
[Dependency] private readonly IAdminLogManager _adminLogger= default!;
[Dependency] private readonly InventorySystem _inventorySystem = default!;
private const float UpdateTimer = 1f;
@@ -172,7 +172,7 @@ namespace Content.Server.Atmos.EntitySystems
if (!barotrauma.TakingDamage)
{
barotrauma.TakingDamage = true;
_logSystem.Add(LogType.Barotrauma, $"{ToPrettyString(barotrauma.Owner):entity} started taking low pressure damage");
_adminLogger.Add(LogType.Barotrauma, $"{ToPrettyString(barotrauma.Owner):entity} started taking low pressure damage");
}
if (pressure <= Atmospherics.HazardLowPressure)
@@ -199,7 +199,7 @@ namespace Content.Server.Atmos.EntitySystems
if (!barotrauma.TakingDamage)
{
barotrauma.TakingDamage = true;
_logSystem.Add(LogType.Barotrauma, $"{ToPrettyString(barotrauma.Owner):entity} started taking high pressure damage");
_adminLogger.Add(LogType.Barotrauma, $"{ToPrettyString(barotrauma.Owner):entity} started taking high pressure damage");
}
if (pressure >= Atmospherics.HazardHighPressure)
@@ -216,7 +216,7 @@ namespace Content.Server.Atmos.EntitySystems
if (barotrauma.TakingDamage)
{
barotrauma.TakingDamage = false;
_logSystem.Add(LogType.Barotrauma, $"{ToPrettyString(barotrauma.Owner):entity} stopped taking pressure damage");
_adminLogger.Add(LogType.Barotrauma, $"{ToPrettyString(barotrauma.Owner):entity} stopped taking pressure damage");
}
_alertsSystem.ClearAlertCategory(barotrauma.Owner, AlertCategory.Pressure);
break;

View File

@@ -24,7 +24,7 @@ namespace Content.Server.Atmos.EntitySystems
[Dependency] private readonly TemperatureSystem _temperatureSystem = default!;
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
[Dependency] private readonly AlertsSystem _alertsSystem = default!;
[Dependency] private readonly AdminLogSystem _logSystem = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
private const float MinimumFireStacks = -10f;
private const float MaximumFireStacks = 20f;
@@ -151,7 +151,7 @@ namespace Content.Server.Atmos.EntitySystems
if (!flammable.OnFire)
return;
_logSystem.Add(LogType.Flammable, $"{ToPrettyString(flammable.Owner):entity} stopped being on fire damage");
_adminLogger.Add(LogType.Flammable, $"{ToPrettyString(flammable.Owner):entity} stopped being on fire damage");
flammable.OnFire = false;
flammable.FireStacks = 0;
@@ -167,7 +167,7 @@ namespace Content.Server.Atmos.EntitySystems
if (flammable.FireStacks > 0 && !flammable.OnFire)
{
_logSystem.Add(LogType.Flammable, $"{ToPrettyString(flammable.Owner):entity} is on fire");
_adminLogger.Add(LogType.Flammable, $"{ToPrettyString(flammable.Owner):entity} is on fire");
flammable.OnFire = true;
}
@@ -243,7 +243,7 @@ namespace Content.Server.Atmos.EntitySystems
{
// TODO FLAMMABLE: further balancing
var damageScale = Math.Min((int)flammable.FireStacks, 5);
if(TryComp(uid, out TemperatureComponent? temp))
_temperatureSystem.ChangeHeat(uid, 12500 * damageScale, false, temp);