Bot-related improvements

This commit is contained in:
JustArchi
2019-04-03 18:57:25 +02:00
parent a39b5108eb
commit 947c9e9f23
2 changed files with 3 additions and 18 deletions

View File

@@ -41,8 +41,6 @@ namespace ArchiSteamFarm {
private readonly ConcurrentHashSet<ulong> HandledGifts = new ConcurrentHashSet<ulong>();
private readonly SemaphoreSlim TradingSemaphore = new SemaphoreSlim(1, 1);
internal bool SkipFirstShutdown { get; set; }
private Timer CardsFarmerResumeTimer;
private bool ProcessingGiftsScheduled;
private bool TradingScheduled;
@@ -294,7 +292,6 @@ namespace ArchiSteamFarm {
return (false, Strings.BotAlreadyRunning);
}
SkipFirstShutdown = true;
Utilities.InBackground(Bot.Start);
return (true, Strings.Done);

View File

@@ -982,26 +982,14 @@ namespace ArchiSteamFarm {
internal async Task OnFarmingFinished(bool farmedSomething) {
await OnFarmingStopped().ConfigureAwait(false);
if (farmedSomething || !FirstTradeSent) {
if (BotConfig.SendOnFarmingFinished && (farmedSomething || !FirstTradeSent)) {
FirstTradeSent = true;
if (BotConfig.SendOnFarmingFinished) {
await Actions.SendTradeOffer(wantedTypes: BotConfig.LootableTypes).ConfigureAwait(false);
}
await Actions.SendTradeOffer(wantedTypes: BotConfig.LootableTypes).ConfigureAwait(false);
}
if (BotConfig.ShutdownOnFarmingFinished) {
if (farmedSomething || (ASF.GlobalConfig.IdleFarmingPeriod == 0)) {
Stop();
return;
}
if (Actions.SkipFirstShutdown) {
Actions.SkipFirstShutdown = false;
} else {
Stop();
}
Stop();
}
}