Make all current admin logs use ToPrettyString

This commit is contained in:
Vera Aguilera Puerto
2021-12-11 16:00:10 +01:00
parent 8239d392d4
commit f6371c6e62
23 changed files with 47 additions and 47 deletions

View File

@@ -97,7 +97,7 @@ namespace Content.Server.Actions.Actions
entMan.EventBus.RaiseLocalEvent(args.Target, eventArgs); entMan.EventBus.RaiseLocalEvent(args.Target, eventArgs);
EntitySystem.Get<AdminLogSystem>().Add(LogType.DisarmedAction, LogImpact.Low, $"{args.Performer:performer} used disarm on {args.Target:target}"); EntitySystem.Get<AdminLogSystem>().Add(LogType.DisarmedAction, LogImpact.Low, $"{entMan.ToPrettyString(args.Performer):performer} used disarm on {entMan.ToPrettyString(args.Target):target}");
// Check if the event has been handled, and if so, do nothing else! // Check if the event has been handled, and if so, do nothing else!
if (eventArgs.Handled) if (eventArgs.Handled)

View File

@@ -115,7 +115,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
{ {
pump.Enabled = args.Enabled; pump.Enabled = args.Enabled;
_adminLogSystem.Add(LogType.AtmosPowerChanged, LogImpact.Medium, _adminLogSystem.Add(LogType.AtmosPowerChanged, LogImpact.Medium,
$"{EntityManager.ToPrettyString(args.Session.AttachedEntity!.Value):player} set the power on {EntityManager.ToPrettyString(uid):device} to {args.Enabled}"); $"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the power on {ToPrettyString(uid):device} to {args.Enabled}");
DirtyUI(uid, pump); DirtyUI(uid, pump);
} }
@@ -123,7 +123,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
{ {
pump.TargetPressure = Math.Clamp(args.Pressure, 0f, Atmospherics.MaxOutputPressure); pump.TargetPressure = Math.Clamp(args.Pressure, 0f, Atmospherics.MaxOutputPressure);
_adminLogSystem.Add(LogType.AtmosPressureChanged, LogImpact.Medium, _adminLogSystem.Add(LogType.AtmosPressureChanged, LogImpact.Medium,
$"{EntityManager.ToPrettyString(args.Session.AttachedEntity!.Value):player} set the pressure on {EntityManager.ToPrettyString(uid):device} to {args.Pressure}kPa"); $"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the pressure on {ToPrettyString(uid):device} to {args.Pressure}kPa");
DirtyUI(uid, pump); DirtyUI(uid, pump);
} }

View File

@@ -120,7 +120,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
{ {
pump.Enabled = args.Enabled; pump.Enabled = args.Enabled;
_adminLogSystem.Add(LogType.AtmosPowerChanged, LogImpact.Medium, _adminLogSystem.Add(LogType.AtmosPowerChanged, LogImpact.Medium,
$"{EntityManager.ToPrettyString(args.Session.AttachedEntity!.Value):player} set the power on {EntityManager.ToPrettyString(uid):device} to {args.Enabled}"); $"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the power on {ToPrettyString(uid):device} to {args.Enabled}");
DirtyUI(uid, pump); DirtyUI(uid, pump);
} }
@@ -128,7 +128,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
{ {
pump.TransferRate = Math.Clamp(args.TransferRate, 0f, Atmospherics.MaxTransferRate); pump.TransferRate = Math.Clamp(args.TransferRate, 0f, Atmospherics.MaxTransferRate);
_adminLogSystem.Add(LogType.AtmosVolumeChanged, LogImpact.Medium, _adminLogSystem.Add(LogType.AtmosVolumeChanged, LogImpact.Medium,
$"{EntityManager.ToPrettyString(args.Session.AttachedEntity!.Value):player} set the transfer rate on {EntityManager.ToPrettyString(uid):device} to {args.TransferRate}"); $"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the transfer rate on {ToPrettyString(uid):device} to {args.TransferRate}");
DirtyUI(uid, pump); DirtyUI(uid, pump);
} }

View File

@@ -114,7 +114,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
{ {
filter.Enabled = args.Enabled; filter.Enabled = args.Enabled;
_adminLogSystem.Add(LogType.AtmosPowerChanged, LogImpact.Medium, _adminLogSystem.Add(LogType.AtmosPowerChanged, LogImpact.Medium,
$"{EntityManager.ToPrettyString(args.Session.AttachedEntity!.Value):player} set the power on {EntityManager.ToPrettyString(uid):device} to {args.Enabled}"); $"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the power on {ToPrettyString(uid):device} to {args.Enabled}");
DirtyUI(uid, filter); DirtyUI(uid, filter);
} }
@@ -123,7 +123,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
{ {
filter.TransferRate = Math.Clamp(args.Rate, 0f, Atmospherics.MaxTransferRate); filter.TransferRate = Math.Clamp(args.Rate, 0f, Atmospherics.MaxTransferRate);
_adminLogSystem.Add(LogType.AtmosVolumeChanged, LogImpact.Medium, _adminLogSystem.Add(LogType.AtmosVolumeChanged, LogImpact.Medium,
$"{EntityManager.ToPrettyString(args.Session.AttachedEntity!.Value):player} set the transfer rate on {EntityManager.ToPrettyString(uid):device} to {args.Rate}"); $"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the transfer rate on {ToPrettyString(uid):device} to {args.Rate}");
DirtyUI(uid, filter); DirtyUI(uid, filter);
} }

View File

@@ -139,7 +139,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
{ {
mixer.Enabled = args.Enabled; mixer.Enabled = args.Enabled;
_adminLogSystem.Add(LogType.AtmosPowerChanged, LogImpact.Medium, _adminLogSystem.Add(LogType.AtmosPowerChanged, LogImpact.Medium,
$"{EntityManager.ToPrettyString(args.Session.AttachedEntity!.Value):player} set the power on {EntityManager.ToPrettyString(uid):device} to {args.Enabled}"); $"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the power on {ToPrettyString(uid):device} to {args.Enabled}");
DirtyUI(uid, mixer); DirtyUI(uid, mixer);
} }
@@ -147,7 +147,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
{ {
mixer.TargetPressure = Math.Clamp(args.Pressure, 0f, Atmospherics.MaxOutputPressure); mixer.TargetPressure = Math.Clamp(args.Pressure, 0f, Atmospherics.MaxOutputPressure);
_adminLogSystem.Add(LogType.AtmosPressureChanged, LogImpact.Medium, _adminLogSystem.Add(LogType.AtmosPressureChanged, LogImpact.Medium,
$"{EntityManager.ToPrettyString(args.Session.AttachedEntity!.Value):player} set the pressure on {EntityManager.ToPrettyString(uid):device} to {args.Pressure}kPa"); $"{ToPrettyString(args.Session.AttachedEntity!.Value):player} set the pressure on {ToPrettyString(uid):device} to {args.Pressure}kPa");
DirtyUI(uid, mixer); DirtyUI(uid, mixer);
} }

View File

@@ -63,7 +63,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
if (environment is not null) if (environment is not null)
_atmosphereSystem.Merge(environment, canister.Air); _atmosphereSystem.Merge(environment, canister.Air);
_adminLogSystem.Add(LogType.CanisterPurged, LogImpact.Medium, $"Canister {uid} purged its contents of {canister.Air} into the environment."); _adminLogSystem.Add(LogType.CanisterPurged, LogImpact.Medium, $"Canister {ToPrettyString(uid)} purged its contents of {canister.Air} into the environment.");
canister.Air.Clear(); canister.Air.Clear();
} }
@@ -130,7 +130,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
if (container.ContainedEntities.Count == 0) if (container.ContainedEntities.Count == 0)
return; return;
_adminLogSystem.Add(LogType.CanisterTankEjected, LogImpact.Medium, $"Player {args.Session.AttachedEntity:player} ejected tank {container.ContainedEntities[0]:tank} from {uid}"); _adminLogSystem.Add(LogType.CanisterTankEjected, LogImpact.Medium, $"Player {ToPrettyString(args.Session.AttachedEntity.GetValueOrDefault()):player} ejected tank {container.ContainedEntities[0]:tank} from {uid}");
container.Remove(container.ContainedEntities[0]); container.Remove(container.ContainedEntities[0]);
} }
@@ -141,7 +141,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
var pressure = Math.Clamp(args.Pressure, canister.MinReleasePressure, canister.MaxReleasePressure); var pressure = Math.Clamp(args.Pressure, canister.MinReleasePressure, canister.MaxReleasePressure);
_adminLogSystem.Add(LogType.CanisterPressure, LogImpact.Medium, $"{args.Session.AttachedEntity:player} set the release pressure on {uid} to {args.Pressure}"); _adminLogSystem.Add(LogType.CanisterPressure, LogImpact.Medium, $"{ToPrettyString(args.Session.AttachedEntity.GetValueOrDefault()):player} set the release pressure on {uid} to {args.Pressure}");
canister.ReleasePressure = pressure; canister.ReleasePressure = pressure;
DirtyUI(uid, canister); DirtyUI(uid, canister);
@@ -157,7 +157,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
&& containerManager.TryGetContainer(canister.ContainerName, out var container)) && containerManager.TryGetContainer(canister.ContainerName, out var container))
impact = container.ContainedEntities.Count != 0 ? LogImpact.Medium : LogImpact.High; 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}"); _adminLogSystem.Add(LogType.CanisterValve, impact, $"{ToPrettyString(args.Session.AttachedEntity.GetValueOrDefault()):player} set the valve on {uid} to {args.Valve:valveState}");
canister.ReleaseValve = args.Valve; canister.ReleaseValve = args.Valve;
DirtyUI(uid, canister); DirtyUI(uid, canister);
@@ -278,7 +278,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
if (!hands.Drop(args.Used, container)) if (!hands.Drop(args.Used, container))
return; return;
_adminLogSystem.Add(LogType.CanisterTankInserted, LogImpact.Medium, $"Player {args.User:player} inserted tank {container.ContainedEntities[0]} into {canister}"); _adminLogSystem.Add(LogType.CanisterTankInserted, LogImpact.Medium, $"Player {ToPrettyString(args.User):player} inserted tank {container.ContainedEntities[0]} into {canister}");
args.Handled = true; args.Handled = true;
} }

View File

@@ -165,7 +165,7 @@ namespace Content.Server.Body.Systems
{ {
var entity = args.SolutionEntity; var entity = args.SolutionEntity;
_logSystem.Add(LogType.ReagentEffect, effect.LogImpact, _logSystem.Add(LogType.ReagentEffect, effect.LogImpact,
$"Metabolism effect {effect.GetType().Name} of reagent {args.Reagent.Name:reagent} applied on entity {entity} at {EntityManager.GetComponent<TransformComponent>(entity).Coordinates}"); $"Metabolism effect {effect.GetType().Name} of reagent {args.Reagent.Name:reagent} applied on entity {entity} at {Transform(entity).Coordinates}");
} }
effect.Effect(args); effect.Effect(args);

View File

@@ -15,10 +15,10 @@ namespace Content.Server.Chemistry.EntitySystems
{ {
base.OnReaction(solution, reaction, randomReagent, Owner, unitReactions); base.OnReaction(solution, reaction, randomReagent, Owner, unitReactions);
var coordinates = EntityManager.GetComponent<TransformComponent>(Owner).Coordinates; var coordinates = Transform(Owner).Coordinates;
_logSystem.Add(LogType.ChemicalReaction, reaction.Impact, _logSystem.Add(LogType.ChemicalReaction, reaction.Impact,
$"Chemical reaction {reaction.ID} occurred with strength {unitReactions:strength} on entity {Owner} at {coordinates}"); $"Chemical reaction {reaction.ID} occurred with strength {unitReactions:strength} on entity {ToPrettyString(Owner)} at {coordinates}");
SoundSystem.Play(Filter.Pvs(Owner, entityManager:EntityManager), reaction.Sound.GetSound(), Owner); SoundSystem.Play(Filter.Pvs(Owner, entityManager:EntityManager), reaction.Sound.GetSound(), Owner);
} }

View File

@@ -138,9 +138,9 @@ namespace Content.Server.GameTicking
_stationSystem.TryAssignJobToStation(station, jobPrototype); _stationSystem.TryAssignJobToStation(station, jobPrototype);
if (lateJoin) if (lateJoin)
_adminLogSystem.Add(LogType.LateJoin, LogImpact.Medium, $"Player {player.Name} late joined as {character.Name:characterName} on station {_stationSystem.StationInfo[station].Name:stationName} with {mob} as a {job.Name:jobName}."); _adminLogSystem.Add(LogType.LateJoin, LogImpact.Medium, $"Player {player.Name} late joined as {character.Name:characterName} on station {_stationSystem.StationInfo[station].Name:stationName} with {ToPrettyString(mob)} as a {job.Name:jobName}.");
else else
_adminLogSystem.Add(LogType.RoundStartJoin, LogImpact.Medium, $"Player {player.Name} joined as {character.Name:characterName} on station {_stationSystem.StationInfo[station].Name:stationName} with {mob} as a {job.Name:jobName}."); _adminLogSystem.Add(LogType.RoundStartJoin, LogImpact.Medium, $"Player {player.Name} joined as {character.Name:characterName} on station {_stationSystem.StationInfo[station].Name:stationName} with {ToPrettyString(mob)} as a {job.Name:jobName}.");
Preset?.OnSpawnPlayerCompleted(player, mob, lateJoin); Preset?.OnSpawnPlayerCompleted(player, mob, lateJoin);
} }

View File

@@ -394,7 +394,7 @@ namespace Content.Server.Interaction
// all interactions should only happen when in range / unobstructed, so no range check is needed // all interactions should only happen when in range / unobstructed, so no range check is needed
var message = new InteractHandEvent(user, target); var message = new InteractHandEvent(user, target);
RaiseLocalEvent(target, message); RaiseLocalEvent(target, message);
_adminLogSystem.Add(LogType.InteractHand, LogImpact.Low, $"{user} interacted with {target}"); _adminLogSystem.Add(LogType.InteractHand, LogImpact.Low, $"{ToPrettyString(user)} interacted with {ToPrettyString(target)}");
if (message.Handled) if (message.Handled)
return; return;
@@ -482,7 +482,7 @@ namespace Content.Server.Interaction
if (ev.Handled) if (ev.Handled)
{ {
_adminLogSystem.Add(LogType.AttackArmedWide, LogImpact.Medium, $"{user} wide attacked with {item} at {coordinates}"); _adminLogSystem.Add(LogType.AttackArmedWide, LogImpact.Medium, $"{ToPrettyString(user)} wide attacked with {ToPrettyString(item)} at {coordinates}");
return; return;
} }
} }
@@ -496,12 +496,12 @@ namespace Content.Server.Interaction
if (targetUid != default) if (targetUid != default)
{ {
_adminLogSystem.Add(LogType.AttackArmedClick, LogImpact.Medium, _adminLogSystem.Add(LogType.AttackArmedClick, LogImpact.Medium,
$"{user} attacked {targetUid} with {item} at {coordinates}"); $"{ToPrettyString(user)} attacked {ToPrettyString(targetUid)} with {ToPrettyString(item)} at {coordinates}");
} }
else else
{ {
_adminLogSystem.Add(LogType.AttackArmedClick, LogImpact.Medium, _adminLogSystem.Add(LogType.AttackArmedClick, LogImpact.Medium,
$"{user} attacked with {item} at {coordinates}"); $"{ToPrettyString(user)} attacked with {ToPrettyString(item)} at {coordinates}");
} }
return; return;
@@ -534,12 +534,12 @@ namespace Content.Server.Interaction
if (targetUid != default) if (targetUid != default)
{ {
_adminLogSystem.Add(LogType.AttackUnarmedClick, LogImpact.Medium, _adminLogSystem.Add(LogType.AttackUnarmedClick, LogImpact.Medium,
$"{user} attacked {targetUid} at {coordinates}"); $"{ToPrettyString(user)} attacked {ToPrettyString(targetUid)} at {coordinates}");
} }
else else
{ {
_adminLogSystem.Add(LogType.AttackUnarmedClick, LogImpact.Medium, _adminLogSystem.Add(LogType.AttackUnarmedClick, LogImpact.Medium,
$"{user} attacked at {coordinates}"); $"{ToPrettyString(user)} attacked at {coordinates}");
} }
} }
} }

View File

@@ -379,7 +379,7 @@ namespace Content.Server.Nutrition.EntitySystems
}); });
// logging // logging
_logSystem.Add(LogType.ForceFeed, LogImpact.Medium, $"{userUid} is forcing {targetUid} to drink {uid}"); _logSystem.Add(LogType.ForceFeed, LogImpact.Medium, $"{ToPrettyString(userUid)} is forcing {ToPrettyString(targetUid)} to drink {ToPrettyString(uid)}");
return true; return true;
} }

View File

@@ -325,7 +325,7 @@ namespace Content.Server.Nutrition.EntitySystems
}); });
// logging // logging
_logSystem.Add(LogType.ForceFeed, LogImpact.Medium, $"{user} is forcing {target} to eat {uid}"); _logSystem.Add(LogType.ForceFeed, LogImpact.Medium, $"{ToPrettyString(user)} is forcing {ToPrettyString(target)} to eat {ToPrettyString(uid)}");
return true; return true;
} }

View File

@@ -58,7 +58,7 @@ namespace Content.Server.Projectiles
if (dmg is not null && EntityManager.EntityExists(component.Shooter)) if (dmg is not null && EntityManager.EntityExists(component.Shooter))
_adminLogSystem.Add(LogType.BulletHit, LogImpact.Low, _adminLogSystem.Add(LogType.BulletHit, LogImpact.Low,
$"Projectile {component.Owner} shot by {component.Shooter:shooter} hit {otherEntity} and dealt {dmg.Total} damage"); $"Projectile {ToPrettyString(component.Owner)} shot by {ToPrettyString(component.Shooter):shooter} hit {ToPrettyString(otherEntity)} and dealt {dmg.Total} damage");
} }
// Damaging it can delete it // Damaging it can delete it

View File

@@ -95,7 +95,7 @@ namespace Content.Server.RoundEnd
if (requester != default) if (requester != default)
{ {
_adminLog.Add(LogType.ShuttleCalled, LogImpact.High, $"Shuttle called by {requester}"); _adminLog.Add(LogType.ShuttleCalled, LogImpact.High, $"Shuttle called by {ToPrettyString(requester.Value)}");
} }
else else
{ {
@@ -128,7 +128,7 @@ namespace Content.Server.RoundEnd
if (requester != default) if (requester != default)
{ {
_adminLog.Add(LogType.ShuttleRecalled, LogImpact.High, $"Shuttle recalled by {requester}"); _adminLog.Add(LogType.ShuttleRecalled, LogImpact.High, $"Shuttle recalled by {ToPrettyString(requester.Value)}");
} }
else else
{ {

View File

@@ -53,7 +53,7 @@ namespace Content.Server.Stunnable
} }
} }
_adminLogSystem.Add(LogType.DisarmedKnockdown, LogImpact.Medium, $"{args.Source:performer} knocked down {args.Target:target}"); _adminLogSystem.Add(LogType.DisarmedKnockdown, LogImpact.Medium, $"{ToPrettyString(args.Source):performer} knocked down {ToPrettyString(args.Target):target}");
args.Handled = true; args.Handled = true;
} }

View File

@@ -187,7 +187,7 @@ namespace Content.Shared.Chemistry.Reaction
{ {
var entity = args.SolutionEntity; var entity = args.SolutionEntity;
_logSystem.Add(LogType.ReagentEffect, effect.LogImpact, _logSystem.Add(LogType.ReagentEffect, effect.LogImpact,
$"Reaction effect {effect.GetType().Name} of reaction ${reaction.ID:reaction} applied on entity {entity} at {EntityManager.GetComponent<TransformComponent>(entity).Coordinates}"); $"Reaction effect {effect.GetType().Name} of reaction ${reaction.ID:reaction} applied on entity {ToPrettyString(entity)} at {Transform(entity).Coordinates}");
} }
effect.Effect(args); effect.Effect(args);

View File

@@ -66,7 +66,7 @@ namespace Content.Shared.Chemistry
{ {
var entity = args.SolutionEntity; var entity = args.SolutionEntity;
_logSystem.Add(LogType.ReagentEffect, effect.LogImpact, _logSystem.Add(LogType.ReagentEffect, effect.LogImpact,
$"Reactive effect {effect.GetType().Name} of reagent {reagent.ID:reagent} with method {method} applied on entity {entity} at {EntityManager.GetComponent<TransformComponent>(entity).Coordinates}"); $"Reactive effect {effect.GetType().Name} of reagent {reagent.ID:reagent} with method {method} applied on entity {ToPrettyString(entity)} at {Transform(entity).Coordinates}");
} }
effect.Effect(args); effect.Effect(args);
@@ -94,7 +94,7 @@ namespace Content.Shared.Chemistry
{ {
var entity = args.SolutionEntity; var entity = args.SolutionEntity;
_logSystem.Add(LogType.ReagentEffect, effect.LogImpact, _logSystem.Add(LogType.ReagentEffect, effect.LogImpact,
$"Reactive effect {effect.GetType().Name} of {entity} using reagent {reagent.ID} with method {method} at {EntityManager.GetComponent<TransformComponent>(entity).Coordinates}"); $"Reactive effect {effect.GetType().Name} of {ToPrettyString(entity)} using reagent {reagent.ID} with method {method} at {Transform(entity).Coordinates}");
} }
effect.Effect(args); effect.Effect(args);

View File

@@ -123,7 +123,7 @@ namespace Content.Shared.Chemistry.Reagent
{ {
var entity = args.SolutionEntity; var entity = args.SolutionEntity;
EntitySystem.Get<SharedAdminLogSystem>().Add(LogType.ReagentEffect, plantMetabolizable.LogImpact, EntitySystem.Get<SharedAdminLogSystem>().Add(LogType.ReagentEffect, plantMetabolizable.LogImpact,
$"Plant metabolism effect {plantMetabolizable.GetType().Name:effect} of reagent {ID} applied on entity {entity} at {IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity).Coordinates}"); $"Plant metabolism effect {plantMetabolizable.GetType().Name:effect} of reagent {ID} applied on entity {entMan.ToPrettyString(entity)} at {entMan.GetComponent<TransformComponent>(entity).Coordinates}");
plantMetabolizable.Effect(args); plantMetabolizable.Effect(args);
} }
} }

View File

@@ -673,7 +673,7 @@ namespace Content.Shared.Hands.Components
HandlePickupAnimation(entity); HandlePickupAnimation(entity);
PutEntityIntoHand(hand, entity); PutEntityIntoHand(hand, entity);
EntitySystem.Get<SharedAdminLogSystem>().Add(LogType.Pickup, LogImpact.Low, $"{Owner} picked up {entity}"); EntitySystem.Get<SharedAdminLogSystem>().Add(LogType.Pickup, LogImpact.Low, $"{_entMan.ToPrettyString(Owner)} picked up {_entMan.ToPrettyString(entity)}");
return true; return true;
} }

View File

@@ -468,7 +468,7 @@ namespace Content.Shared.Interaction
RaiseLocalEvent(used, activateMsg); RaiseLocalEvent(used, activateMsg);
if (activateMsg.Handled) if (activateMsg.Handled)
{ {
_adminLogSystem.Add(LogType.InteractActivate, LogImpact.Low, $"{user} activated {used}"); _adminLogSystem.Add(LogType.InteractActivate, LogImpact.Low, $"{ToPrettyString(user)} activated {ToPrettyString(used)}");
return; return;
} }
@@ -477,7 +477,7 @@ namespace Content.Shared.Interaction
var activateEventArgs = new ActivateEventArgs(user, used); var activateEventArgs = new ActivateEventArgs(user, used);
activateComp.Activate(activateEventArgs); activateComp.Activate(activateEventArgs);
_adminLogSystem.Add(LogType.InteractActivate, LogImpact.Low, $"{user} activated {used}"); // No way to check success. _adminLogSystem.Add(LogType.InteractActivate, LogImpact.Low, $"{ToPrettyString(user)} activated {ToPrettyString(used)}"); // No way to check success.
} }
#endregion #endregion
@@ -556,7 +556,7 @@ namespace Content.Shared.Interaction
RaiseLocalEvent(thrown, throwMsg); RaiseLocalEvent(thrown, throwMsg);
if (throwMsg.Handled) if (throwMsg.Handled)
{ {
_adminLogSystem.Add(LogType.Throw, LogImpact.Low,$"{user} threw {thrown}"); _adminLogSystem.Add(LogType.Throw, LogImpact.Low,$"{ToPrettyString(user)} threw {ToPrettyString(thrown)}");
return; return;
} }
@@ -568,7 +568,7 @@ namespace Content.Shared.Interaction
{ {
comp.Thrown(args); comp.Thrown(args);
} }
_adminLogSystem.Add(LogType.Throw, LogImpact.Low,$"{user} threw {thrown}"); _adminLogSystem.Add(LogType.Throw, LogImpact.Low,$"{ToPrettyString(user)} threw {ToPrettyString(thrown)}");
} }
#endregion #endregion
@@ -677,7 +677,7 @@ namespace Content.Shared.Interaction
RaiseLocalEvent(item, dropMsg); RaiseLocalEvent(item, dropMsg);
if (dropMsg.Handled) if (dropMsg.Handled)
{ {
_adminLogSystem.Add(LogType.Drop, LogImpact.Low, $"{user} dropped {item}"); _adminLogSystem.Add(LogType.Drop, LogImpact.Low, $"{ToPrettyString(user)} dropped {ToPrettyString(item)}");
return; return;
} }
@@ -690,7 +690,7 @@ namespace Content.Shared.Interaction
{ {
comp.Dropped(new DroppedEventArgs(user)); comp.Dropped(new DroppedEventArgs(user));
} }
_adminLogSystem.Add(LogType.Drop, LogImpact.Low, $"{user} dropped {item}"); _adminLogSystem.Add(LogType.Drop, LogImpact.Low, $"{ToPrettyString(user)} dropped {ToPrettyString(item)}");
} }
#endregion #endregion

View File

@@ -106,7 +106,7 @@ namespace Content.Shared.Slippery
PlaySound(component); PlaySound(component);
} }
_adminLog.Add(LogType.Slip, LogImpact.Low, $"{otherBody.Owner} slipped on collision with {component.Owner}"); _adminLog.Add(LogType.Slip, LogImpact.Low, $"{ToPrettyString(otherBody.Owner)} slipped on collision with {ToPrettyString(component.Owner)}");
return true; return true;
} }

View File

@@ -128,7 +128,7 @@ namespace Content.Shared.Throwing
// Assume it's uninteresting if it has no thrower. For now anyway. // Assume it's uninteresting if it has no thrower. For now anyway.
if (thrownItem.Thrower is not null) if (thrownItem.Thrower is not null)
_adminLogSystem.Add(LogType.Landed, LogImpact.Low, $"{landing} thrown by {thrownItem.Thrower:thrower} landed."); _adminLogSystem.Add(LogType.Landed, LogImpact.Low, $"{ToPrettyString(landing)} thrown by {ToPrettyString(thrownItem.Thrower.Value):thrower} landed.");
var landMsg = new LandEvent {User = thrownItem.Thrower}; var landMsg = new LandEvent {User = thrownItem.Thrower};
RaiseLocalEvent(landing, landMsg, false); RaiseLocalEvent(landing, landMsg, false);
@@ -141,7 +141,7 @@ namespace Content.Shared.Throwing
{ {
if (user is not null) if (user is not null)
_adminLogSystem.Add(LogType.ThrowHit, LogImpact.Low, _adminLogSystem.Add(LogType.ThrowHit, LogImpact.Low,
$"{thrown.Owner:thrown} thrown by {user:thrower} hit {target.Owner:target}."); $"{ToPrettyString(thrown.Owner):thrown} thrown by {ToPrettyString(user.Value):thrower} hit {ToPrettyString(target.Owner):target}.");
// TODO: Just pass in the bodies directly // TODO: Just pass in the bodies directly
RaiseLocalEvent(target.Owner, new ThrowHitByEvent(user, thrown.Owner, target.Owner)); RaiseLocalEvent(target.Owner, new ThrowHitByEvent(user, thrown.Owner, target.Owner));
RaiseLocalEvent(thrown.Owner, new ThrowDoHitEvent(user, thrown.Owner, target.Owner)); RaiseLocalEvent(thrown.Owner, new ThrowDoHitEvent(user, thrown.Owner, target.Owner));

View File

@@ -139,10 +139,10 @@ namespace Content.Shared.Verbs
// then log with entity information // then log with entity information
if (used != null) if (used != null)
_logSystem.Add(LogType.Verb, verb.Impact, _logSystem.Add(LogType.Verb, verb.Impact,
$"{user} {logText} {target} while holding {used}"); $"{ToPrettyString(user)} {logText} {ToPrettyString(target)} while holding {ToPrettyString(used.Value)}");
else else
_logSystem.Add(LogType.Verb, verb.Impact, _logSystem.Add(LogType.Verb, verb.Impact,
$"{user} {logText} {target}"); $"{ToPrettyString(user)} {logText} {ToPrettyString(target)}");
} }
} }
} }