Add InteractUsing admin logs. (#29514)
Apparently we did not have these.
This commit is contained in:
committed by
GitHub
parent
0896edf06c
commit
45cc19f315
@@ -105,4 +105,9 @@ public enum LogType
|
|||||||
/// This is a default value used by <c>PlayerRateLimitManager</c>, though users can use different log types.
|
/// This is a default value used by <c>PlayerRateLimitManager</c>, though users can use different log types.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
RateLimited = 91,
|
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,
|
public void InteractUsingRanged(EntityUid user, EntityUid used, EntityUid? target,
|
||||||
EntityCoordinates clickLocation, bool inRangeUnobstructed)
|
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))
|
if (RangedInteractDoBefore(user, used, target, clickLocation, inRangeUnobstructed))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -926,6 +941,11 @@ namespace Content.Shared.Interaction
|
|||||||
if (checkCanUse && !_actionBlockerSystem.CanUseHeldEntity(user, used))
|
if (checkCanUse && !_actionBlockerSystem.CanUseHeldEntity(user, used))
|
||||||
return;
|
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))
|
if (RangedInteractDoBefore(user, used, target, clickLocation, true))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user