mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 22:20:52 +00:00
Bot-related improvements
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user