mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 22:20:52 +00:00
Prevent Windows from going to sleep only in headless mode
This commit is contained in:
@@ -31,14 +31,18 @@ namespace ArchiSteamFarm {
|
||||
internal static class OS {
|
||||
private static readonly PlatformID PlatformID = Environment.OSVersion.Platform;
|
||||
|
||||
internal static void Init() {
|
||||
internal static void Init(bool headless) {
|
||||
switch (PlatformID) {
|
||||
case PlatformID.Win32NT:
|
||||
case PlatformID.Win32S:
|
||||
case PlatformID.Win32Windows:
|
||||
case PlatformID.WinCE:
|
||||
DisableQuickEditMode();
|
||||
KeepWindowsSystemActive();
|
||||
|
||||
if (headless) {
|
||||
KeepWindowsSystemActive();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
ArchiWebHandler.Init();
|
||||
OS.Init();
|
||||
OS.Init(GlobalConfig.Headless);
|
||||
WCF.Init();
|
||||
WebBrowser.Init();
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
|
||||
ArchiWebHandler.Init();
|
||||
OS.Init();
|
||||
OS.Init(GlobalConfig.Headless);
|
||||
WebBrowser.Init();
|
||||
|
||||
WebBrowser = new WebBrowser(ASF.ArchiLogger);
|
||||
|
||||
Reference in New Issue
Block a user