1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-07 13:48:00 -05:00
IW4M-Admin/Plugins/Stats/Config/AnticheatConfiguration.cs
google-labs-jules[bot] c2cce14ad3 Add shouldIgnoreDetection check for DetectionType.Bone
This commit updates the cheat detection logic to allow ignoring specific weapons for DetectionType.Bone.

- Modified Detection.cs to include the shouldIgnoreDetection check for DetectionType.Bone, similar to how it's handled for Recoil and Chest detection types.
- Updated AnticheatConfiguration.cs to add an entry for DetectionType.Bone under Game.IW4 in the IgnoredDetectionSpecification, allowing you to configure weapon regexes to ignore for this detection type.
2025-05-27 21:43:00 -05:00

36 lines
1.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using static IW4MAdmin.Plugins.Stats.Cheat.Detection;
using static SharedLibraryCore.Server;
namespace Stats.Config
{
public class AnticheatConfiguration
{
public bool Enable { get; set; }
[Obsolete]
public IDictionary<long, DetectionType[]> ServerDetectionTypes { get; set; } = new Dictionary<long, DetectionType[]>();
public IDictionary<Game, DetectionType[]> GameDetectionTypes { get; set; } =
new Dictionary<Game, DetectionType[]>()
{
{ Game.IW4, Enum.GetValues(typeof(DetectionType)).Cast<DetectionType>().ToArray() },
{ Game.T6, new[] { DetectionType.Offset, DetectionType.Snap, DetectionType.Strain } }
};
public IList<long> IgnoredClientIds { get; set; } = new List<long>();
public IDictionary<Game, IDictionary<DetectionType, string[]>> IgnoredDetectionSpecification{ get; set; } = new Dictionary<Game, IDictionary<DetectionType, string[]>>
{
{
Game.IW4, new Dictionary<DetectionType, string[]>
{
{ DetectionType.Chest, new[] { "m21.+" } },
{ DetectionType.Recoil, new[] { "ranger.*_mp", "model1887.*_mp", ".+shotgun.*_mp", "turret_minigun_mp" } },
{ DetectionType.Button, new[] { ".*akimbo.*" } },
{ DetectionType.Bone, new string[0] }
}
}
};
}
}