All: Improve Anti-Cheat protection

This commit is contained in:
Kamil Trzciński 2023-01-12 22:58:40 +01:00
parent 5a7ad0b766
commit 02d68af216
15 changed files with 164 additions and 145 deletions

View file

@ -18,28 +18,27 @@ namespace PowerControl
{
Instance.WithSentry(() =>
{
if (Settings.Default.EnableExperimentalFeatures)
{
if (!Settings.Default.AckAntiCheat(
Controller.TitleWithVersion,
"ExperimentalFeatures",
"You are running EXPERIMENTAL build."))
return;
for (int i = 0; !VangoghGPU.IsSupported && i < MAX_GPU_RETRIES; i++)
{
var status = Instance.WithGlobalMutex(1000, () => VangoghGPU.Detect());
if (status != VangoghGPU.DetectionStatus.Retryable)
break;
Thread.Sleep(300);
}
}
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
if (Settings.Default.EnableExperimentalFeatures)
{
if (!AntiCheatSettings.Default.AckAntiCheat(
Controller.TitleWithVersion,
"You are running EXPERIMENTAL build.", null, false))
return;
}
for (int i = 0; !VangoghGPU.IsSupported && i < MAX_GPU_RETRIES; i++)
{
var status = Instance.WithGlobalMutex(1000, () => VangoghGPU.Detect());
if (status != VangoghGPU.DetectionStatus.Retryable)
break;
Thread.Sleep(300);
}
using (var controller = new Controller())
{
Application.Run();