Add InteractUsing admin logs. (#29514)
Apparently we did not have these.
This commit is contained in:
parent
cd95737190
commit
2114817108
|
|
@ -107,4 +107,9 @@ public enum LogType
|
|||
/// This is a default value used by <c>PlayerRateLimitManager</c>, though users can use different log types.
|
||||
/// </remarks>
|
||||
RateLimited = 91,
|
||||
|
||||
/// <summary>
|
||||
/// A player did an item-use interaction of an item they were holding onto another object.
|
||||
/// </summary>
|
||||
InteractUsing = 92,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -486,6 +486,21 @@ namespace Content.Shared.Interaction
|
|||
public void InteractUsingRanged(EntityUid user, EntityUid used, EntityUid? target,
|
||||
EntityCoordinates clickLocation, bool inRangeUnobstructed)
|
||||
{
|
||||
if (target != null)
|
||||
{
|
||||
_adminLogger.Add(
|
||||
LogType.InteractUsing,
|
||||
LogImpact.Low,
|
||||
$"{ToPrettyString(user):user} interacted with {ToPrettyString(target):target} using {ToPrettyString(used):used}");
|
||||
}
|
||||
else
|
||||
{
|
||||
_adminLogger.Add(
|
||||
LogType.InteractUsing,
|
||||
LogImpact.Low,
|
||||
$"{ToPrettyString(user):user} interacted with *nothing* using {ToPrettyString(used):used}");
|
||||
}
|
||||
|
||||
if (RangedInteractDoBefore(user, used, target, clickLocation, inRangeUnobstructed))
|
||||
return;
|
||||
|
||||
|
|
@ -926,6 +941,11 @@ namespace Content.Shared.Interaction
|
|||
if (checkCanUse && !_actionBlockerSystem.CanUseHeldEntity(user, used))
|
||||
return;
|
||||
|
||||
_adminLogger.Add(
|
||||
LogType.InteractUsing,
|
||||
LogImpact.Low,
|
||||
$"{ToPrettyString(user):user} interacted with {ToPrettyString(target):target} using {ToPrettyString(used):used}");
|
||||
|
||||
if (RangedInteractDoBefore(user, used, target, clickLocation, true))
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue