mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-16 08:25:28 +00:00
Move OnTimeChanged event from ASF to OS
This commit is contained in:
@@ -32,7 +32,6 @@ using System.Threading;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using ArchiSteamFarm.JSON;
|
using ArchiSteamFarm.JSON;
|
||||||
using ArchiSteamFarm.Localization;
|
using ArchiSteamFarm.Localization;
|
||||||
using Microsoft.Win32;
|
|
||||||
|
|
||||||
namespace ArchiSteamFarm {
|
namespace ArchiSteamFarm {
|
||||||
internal static class ASF {
|
internal static class ASF {
|
||||||
@@ -243,8 +242,6 @@ namespace ArchiSteamFarm {
|
|||||||
FileSystemWatcher.Renamed += OnRenamed;
|
FileSystemWatcher.Renamed += OnRenamed;
|
||||||
|
|
||||||
FileSystemWatcher.EnableRaisingEvents = true;
|
FileSystemWatcher.EnableRaisingEvents = true;
|
||||||
|
|
||||||
SystemEvents.TimeChanged += OnTimeChanged;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task CreateBot(string botName) {
|
private static async Task CreateBot(string botName) {
|
||||||
@@ -386,8 +383,6 @@ namespace ArchiSteamFarm {
|
|||||||
CreateBot(newBotName).Forget();
|
CreateBot(newBotName).Forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async void OnTimeChanged(object sender, EventArgs e) => await MobileAuthenticator.OnTimeChanged().ConfigureAwait(false);
|
|
||||||
|
|
||||||
private static async Task RestartOrExit() {
|
private static async Task RestartOrExit() {
|
||||||
if (Program.GlobalConfig.AutoRestart) {
|
if (Program.GlobalConfig.AutoRestart) {
|
||||||
ArchiLogger.LogGenericInfo(Strings.Restarting);
|
ArchiLogger.LogGenericInfo(Strings.Restarting);
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using ArchiSteamFarm.Localization;
|
using ArchiSteamFarm.Localization;
|
||||||
|
using Microsoft.Win32;
|
||||||
|
|
||||||
namespace ArchiSteamFarm {
|
namespace ArchiSteamFarm {
|
||||||
internal static class OS {
|
internal static class OS {
|
||||||
@@ -39,6 +40,8 @@ namespace ArchiSteamFarm {
|
|||||||
KeepWindowsSystemActive();
|
KeepWindowsSystemActive();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SystemEvents.TimeChanged += OnTimeChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void KeepWindowsSystemActive() {
|
private static void KeepWindowsSystemActive() {
|
||||||
@@ -53,6 +56,8 @@ namespace ArchiSteamFarm {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static async void OnTimeChanged(object sender, EventArgs e) => await MobileAuthenticator.OnTimeChanged().ConfigureAwait(false);
|
||||||
|
|
||||||
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||||
private static extern EExecutionState SetThreadExecutionState(EExecutionState executionState);
|
private static extern EExecutionState SetThreadExecutionState(EExecutionState executionState);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user