Require to acknowledge Anti-Cheat impact on PowerControl

This commit is contained in:
Kamil Trzciński 2022-12-19 12:33:45 +01:00
parent 862bdd2dd3
commit 9c0a326d48
3 changed files with 56 additions and 5 deletions

View file

@ -252,6 +252,13 @@ namespace PowerControl
ActiveOption = "?",
ApplyValue = delegate(object selected)
{
if (!Settings.Default.AckAntiCheat(
Controller.TitleWithVersion,
"TDP",
"Changing TDP requires kernel access for a short period. Leave the game if it uses anti-cheat protection.")
)
return null;
uint mW = uint.Parse(selected.ToString().Replace("W", "")) * 1000;
if (VangoghGPU.IsSupported)
@ -301,6 +308,13 @@ namespace PowerControl
ResetValue = () => { return "Default"; },
ApplyValue = delegate(object selected)
{
if (!Settings.Default.AckAntiCheat(
Controller.TitleWithVersion,
"GPU",
"Changing GPU frequency requires kernel access for a short period. Leave the game if it uses anti-cheat protection.")
)
return null;
return Instance.WithGlobalMutex<object>(200, () =>
{
using (var sd = VangoghGPU.Open())
@ -330,6 +344,13 @@ namespace PowerControl
ResetValue = () => { return "Default"; },
ApplyValue = delegate(object selected)
{
if (!Settings.Default.AckAntiCheat(
Controller.TitleWithVersion,
"CPU",
"Changing GPU frequency requires kernel access for a short period. Leave the game if it uses anti-cheat protection.")
)
return null;
return Instance.WithGlobalMutex<object>(200, () =>
{
using (var sd = VangoghGPU.Open())

View file

@ -18,6 +18,12 @@ namespace PowerControl
{
if (Settings.Default.EnableExperimentalFeatures)
{
if (!Settings.Default.AckAntiCheat(
Controller.TitleWithVersion,
"ExperimentalFeatures",
"You are running EXPERIMENTAL build."))
return;
for (int i = 0; !VangoghGPU.IsSupported; i++)
{
Instance.WithGlobalMutex(1000, () => VangoghGPU.Detect());

View file

@ -49,11 +49,35 @@ namespace PowerControl
public bool EnableExperimentalFeatures
{
#if DEBUG
get { return true; }
#else
get { return false; }
#endif
get { return Instance.IsDEBUG; }
}
public bool AckAntiCheat(String title, String name, String message)
{
if (Get<bool>("AckAntiCheat" + name, false) && Settings.Default.EnableExperimentalFeatures)
return true;
var result = MessageBox.Show(
String.Join("\n",
"WARNING!!!!",
"",
message,
"This might result in kicking from the application or even be banned.",
"",
"CLICK YES TO ACKNOWLEDGE?",
"CLICK NO TO LEARN MORE."
), title, MessageBoxButtons.YesNo
);
if (result == DialogResult.Yes)
{
Set<bool>("AckAntiCheat" + name, true);
return true;
}
try { System.Diagnostics.Process.Start("explorer.exe", "https://steam-deck-tools.ayufan.dev/#anti-cheat-and-antivirus-software"); }
catch { }
return false;
}
}
}