Add missing program shutdown

This commit is contained in:
JustArchi
2016-10-26 19:44:35 +02:00
parent f8f1f8ce18
commit 09f22153e1
2 changed files with 13 additions and 1 deletions

View File

@@ -449,6 +449,8 @@ namespace ArchiSteamFarm {
if (SteamClient.IsConnected) {
Disconnect();
}
Events.OnBotShutdown();
}
internal async Task LootIfNeeded() {

View File

@@ -1,8 +1,18 @@
using SteamKit2;
using System.Linq;
using SteamKit2;
namespace ArchiSteamFarm {
internal static class Events {
internal static void OnStateUpdated(Bot bot, SteamFriends.PersonaStateCallback callback) {
}
internal static void OnBotShutdown() {
if (Bot.Bots.Values.Any(bot => bot.KeepRunning)) {
return;
}
Logging.LogGenericInfo("No bots are running, exiting");
Program.Exit();
}
}
}