This commit is contained in:
JustArchi
2016-10-27 22:51:44 +02:00
parent aba96e3d08
commit fcfbd2453d
3 changed files with 5 additions and 1 deletions

View File

@@ -7,7 +7,7 @@ namespace ArchiSteamFarm {
}
internal static void OnBotShutdown() {
if (Bot.Bots.Values.Any(bot => bot.KeepRunning)) {
if (Program.IsWCFRunning || Bot.Bots.Values.Any(bot => bot.KeepRunning)) {
return;
}

View File

@@ -52,6 +52,8 @@ namespace ArchiSteamFarm {
private static bool ShutdownSequenceInitialized;
internal static bool IsWCFRunning => WCF.IsServerRunning;
internal static void Exit(byte exitCode = 0) {
Shutdown();
Environment.Exit(exitCode);

View File

@@ -45,6 +45,8 @@ namespace ArchiSteamFarm {
private ServiceHost ServiceHost;
private Client Client;
internal bool IsServerRunning => ServiceHost != null;
internal static void Init() {
if (string.IsNullOrEmpty(Program.GlobalConfig.WCFHostname)) {
Program.GlobalConfig.WCFHostname = Program.GetUserInput(SharedInfo.EUserInputType.WCFHostname);