Adds like 17 new logs (#5499)

Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
This commit is contained in:
Moony
2021-11-24 16:52:31 -06:00
committed by GitHub
parent 078f3a7738
commit c576eb91d3
10 changed files with 116 additions and 5 deletions

View File

@@ -66,6 +66,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
if (environment is not null)
_atmosphereSystem.Merge(environment, canister.Air);
_adminLogSystem.Add(LogType.CanisterPurged, LogImpact.Medium, $"Canister {uid} purged its contents of {canister.Air} into the environment.");
canister.Air.Clear();
}
@@ -132,6 +133,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
if (container.ContainedEntities.Count == 0)
return;
_adminLogSystem.Add(LogType.CanisterTankEjected, LogImpact.Medium, $"Player {args.Session.AttachedEntity:player} ejected tank {container.ContainedEntities[0]:tank} from {uid}");
container.Remove(container.ContainedEntities[0]);
}
@@ -142,7 +144,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
var pressure = Math.Clamp(args.Pressure, canister.MinReleasePressure, canister.MaxReleasePressure);
_adminLogSystem.Add(LogType.CanisterPressure, LogImpact.Medium, $"{(args.Session as IPlayerSession):player} set the release pressure on {uid} to {args.Pressure:valveState}");
_adminLogSystem.Add(LogType.CanisterPressure, LogImpact.Medium, $"{args.Session.AttachedEntity:player} set the release pressure on {uid} to {args.Pressure}");
canister.ReleasePressure = pressure;
DirtyUI(uid, canister);
@@ -153,7 +155,12 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
if (!CheckInteract(args.Session))
return;
_adminLogSystem.Add(LogType.CanisterValve, LogImpact.High, $"{(args.Session as IPlayerSession):player} set the valve on {uid} to {args.Valve:valveState}");
var impact = LogImpact.High;
if (EntityManager.TryGetComponent(uid, out ContainerManagerComponent containerManager)
&& containerManager.TryGetContainer(canister.ContainerName, out var container))
impact = container.ContainedEntities.Count != 0 ? LogImpact.Medium : LogImpact.High;
_adminLogSystem.Add(LogType.CanisterValve, impact, $"{args.Session.AttachedEntity:player} set the valve on {uid} to {args.Valve:valveState}");
canister.ReleaseValve = args.Valve;
DirtyUI(uid, canister);
@@ -275,6 +282,8 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
if (!hands.Drop(args.Used, container))
return;
_adminLogSystem.Add(LogType.CanisterTankInserted, LogImpact.Medium, $"Player {args.User:player} inserted tank {container.ContainedEntities[0]} into {uid}");
args.Handled = true;
}