reduce logging for failed anticheat log parsing

This commit is contained in:
RaidMax 2022-05-22 18:04:38 -05:00
parent 2230036d45
commit dd8c4f438f

View File

@ -633,7 +633,10 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
return;
}
var hit = new EFClientKill()
EFClientKill hit;
try
{
hit = new EFClientKill
{
Active = true,
AttackerId = attacker.ClientId,
@ -660,6 +663,15 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
GameName = (int) attacker.CurrentServer.GameName
};
}
catch (Exception ex)
{
_log.LogError(ex, "Could not parse script hit data. Damage={Damage}, TimeOffset={Offset}, TimeSinceLastAttack={LastAttackTime}",
damage, offset, lastAttackTime);
return;
}
hit.SetAdditionalProperty("HitLocationReference", hitLoc);
if (hit.HitLoc == (int) IW4Info.HitLocation.shield)
@ -769,7 +781,7 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
}
catch (Exception ex)
{
_log.LogError(ex, "Could not save hit or anti-cheat info {@attacker} {@victim} {server}", attacker,
_log.LogError(ex, "Could not save hit or anti-cheat info {Attacker} {Victim} {Server}", attacker,
victim, serverId);
}