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,32 +633,44 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
return; return;
} }
var hit = new EFClientKill() EFClientKill hit;
try
{ {
Active = true, hit = new EFClientKill
AttackerId = attacker.ClientId, {
VictimId = victim.ClientId, Active = true,
ServerId = serverId, AttackerId = attacker.ClientId,
DeathOrigin = vDeathOrigin, VictimId = victim.ClientId,
KillOrigin = vKillOrigin, ServerId = serverId,
DeathType = (int) ParseEnum<IW4Info.MeansOfDeath>.Get(type, typeof(IW4Info.MeansOfDeath)), DeathOrigin = vDeathOrigin,
Damage = int.Parse(damage), KillOrigin = vKillOrigin,
HitLoc = (int) ParseEnum<IW4Info.HitLocation>.Get(hitLoc, typeof(IW4Info.HitLocation)), DeathType = (int) ParseEnum<IW4Info.MeansOfDeath>.Get(type, typeof(IW4Info.MeansOfDeath)),
WeaponReference = weapon, Damage = int.Parse(damage),
ViewAngles = vViewAngles, HitLoc = (int) ParseEnum<IW4Info.HitLocation>.Get(hitLoc, typeof(IW4Info.HitLocation)),
TimeOffset = long.Parse(offset), WeaponReference = weapon,
When = time, ViewAngles = vViewAngles,
IsKillstreakKill = isKillstreakKill[0] != '0', TimeOffset = long.Parse(offset),
AdsPercent = float.Parse(Ads, System.Globalization.CultureInfo.InvariantCulture), When = time,
Fraction = double.Parse(fraction, System.Globalization.CultureInfo.InvariantCulture), IsKillstreakKill = isKillstreakKill[0] != '0',
VisibilityPercentage = double.Parse(visibilityPercentage, AdsPercent = float.Parse(Ads, System.Globalization.CultureInfo.InvariantCulture),
System.Globalization.CultureInfo.InvariantCulture), Fraction = double.Parse(fraction, System.Globalization.CultureInfo.InvariantCulture),
IsKill = !isDamage, VisibilityPercentage = double.Parse(visibilityPercentage,
AnglesList = snapshotAngles, System.Globalization.CultureInfo.InvariantCulture),
IsAlive = isAlive == "1", IsKill = !isDamage,
TimeSinceLastAttack = long.Parse(lastAttackTime), AnglesList = snapshotAngles,
GameName = (int) attacker.CurrentServer.GameName IsAlive = isAlive == "1",
}; TimeSinceLastAttack = long.Parse(lastAttackTime),
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); hit.SetAdditionalProperty("HitLocationReference", hitLoc);
@ -769,7 +781,7 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
} }
catch (Exception ex) 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); victim, serverId);
} }