update values for snap and offset

fix some issues from .NET Core 3.0 upgrade
This commit is contained in:
RaidMax
2019-10-07 10:26:07 -05:00
parent c4e0b0272c
commit 068e943fd3
14 changed files with 1522 additions and 265 deletions

View File

@ -125,32 +125,32 @@ namespace IW4MAdmin.Plugins.Stats.Cheat
//var marginOfError = Thresholds.GetMarginOfError(sessionSnapHits);
//var marginOfErrorLifetime = Thresholds.GetMarginOfError(ClientStats.SnapHitCount);
if (sessionSnapHits >= Thresholds.LowSampleMinKills &&
if (sessionSnapHits >= Thresholds.MediumSampleMinKills &&
sessionAverageSnapAmount >= Thresholds.SnapFlagValue/* + marginOfError*/)
{
results.Add(new DetectionPenaltyResult()
{
ClientPenalty = EFPenalty.PenaltyType.Flag,
Value = sessionAverageSnapAmount,
HitCount = ClientStats.SnapHitCount,
HitCount = sessionSnapHits,
Type = DetectionType.Snap
});
}
if (sessionSnapHits >= Thresholds.LowSampleMinKills &&
if (sessionSnapHits >= Thresholds.MediumSampleMinKills &&
sessionAverageSnapAmount >= Thresholds.SnapBanValue/* + marginOfError*/)
{
results.Add(new DetectionPenaltyResult()
{
ClientPenalty = EFPenalty.PenaltyType.Ban,
Value = sessionAverageSnapAmount,
HitCount = ClientStats.SnapHitCount,
HitCount = sessionSnapHits,
Type = DetectionType.Snap
});
}
// lifetime
if (ClientStats.SnapHitCount >= Thresholds.MediumSampleMinKills &&
if (ClientStats.SnapHitCount >= Thresholds.MediumSampleMinKills * 2 &&
ClientStats.AverageSnapValue >= Thresholds.SnapFlagValue/* + marginOfErrorLifetime*/)
{
results.Add(new DetectionPenaltyResult()
@ -162,7 +162,7 @@ namespace IW4MAdmin.Plugins.Stats.Cheat
});
}
if (ClientStats.SnapHitCount >= Thresholds.MediumSampleMinKills &&
if (ClientStats.SnapHitCount >= Thresholds.MediumSampleMinKills * 2 &&
ClientStats.AverageSnapValue >= Thresholds.SnapBanValue/* + marginOfErrorLifetime*/)
{
results.Add(new DetectionPenaltyResult()
@ -183,7 +183,6 @@ namespace IW4MAdmin.Plugins.Stats.Cheat
int angleOffsetIndex = totalUsableAngleCount / 2;
if (hit.AnglesList.Count == 5)
{
double realAgainstPredict = Vector3.ViewAngleDistance(hit.AnglesList[angleOffsetIndex - 1], hit.AnglesList[angleOffsetIndex + 1], hit.ViewAngles);
// LIFETIME
@ -201,15 +200,15 @@ namespace IW4MAdmin.Plugins.Stats.Cheat
if (weightedLifetimeAverage > Thresholds.MaxOffset(totalHits) &&
hitLoc.HitCount > 100)
{
Log.WriteDebug("*** Reached Max Lifetime Average for Angle Difference ***");
Log.WriteDebug($"Lifetime Average = {newAverage}");
Log.WriteDebug($"Bone = {hitLoc.Location}");
Log.WriteDebug($"HitCount = {hitLoc.HitCount}");
Log.WriteDebug($"ID = {hit.AttackerId}");
//Log.WriteDebug("*** Reached Max Lifetime Average for Angle Difference ***");
//Log.WriteDebug($"Lifetime Average = {newAverage}");
//Log.WriteDebug($"Bone = {hitLoc.Location}");
//Log.WriteDebug($"HitCount = {hitLoc.HitCount}");
//Log.WriteDebug($"ID = {hit.AttackerId}");
results.Add(new DetectionPenaltyResult()
{
ClientPenalty = EFPenalty.PenaltyType.Flag,
ClientPenalty = EFPenalty.PenaltyType.Ban,
Value = hitLoc.HitOffsetAverage,
HitCount = hitLoc.HitCount,
Type = DetectionType.Offset
@ -236,7 +235,7 @@ namespace IW4MAdmin.Plugins.Stats.Cheat
results.Add(new DetectionPenaltyResult()
{
ClientPenalty = EFPenalty.PenaltyType.Flag,
ClientPenalty = EFPenalty.PenaltyType.Ban,
Value = weightedSessionAverage,
HitCount = HitCount,
Type = DetectionType.Offset,

View File

@ -48,13 +48,13 @@ namespace IW4MAdmin.Plugins.Stats.Cheat
public const int HighSampleMinKills = 100;
public const double KillTimeThreshold = 0.2;
public const int LowSampleMinKillsRecoil = 5;
public const double SnapFlagValue = 6.12;
public const double SnapBanValue = 9.67;
public const double SnapFlagValue = 5.5;
public const double SnapBanValue = 8.7;
public const double MaxStrainBan = 0.9;
private const double _offsetMeanLog = -2.727273;
private const double _offsetSdLog = 0.458325;
private const double _offsetMeanLog = -2.3243889;
private const double _offsetSdLog = 0.5851351;
public static double MaxOffset(int sampleSize) => Math.Exp(Math.Max(_offsetMeanLog + (_offsetMeanLog / Math.Sqrt(sampleSize)), _offsetMeanLog - (_offsetMeanLog / Math.Sqrt(sampleSize))) + 4 * (_offsetSdLog));
public const double MaxStrainFlag = 0.36;