This commit is contained in:
JustArchi
2020-01-01 12:45:32 +01:00
parent 67f29ed765
commit f0292a07b9
4 changed files with 10 additions and 4 deletions

View File

@@ -241,6 +241,12 @@ namespace ArchiSteamFarm {
return (false, string.Format(Strings.ErrorObjectIsNull, nameof(appID) + " || " + nameof(contextID)));
}
if ((wantedRealAppIDs?.Count == 0) || (unwantedRealAppIDs?.Count == 0) || (wantedTypes?.Count == 0)) {
Bot.ArchiLogger.LogNullError(nameof(wantedRealAppIDs) + " || " + nameof(unwantedRealAppIDs) + " || " + nameof(wantedTypes));
return (false, string.Format(Strings.ErrorObjectIsNull, nameof(wantedRealAppIDs) + " || " + nameof(unwantedRealAppIDs) + " || " + nameof(wantedTypes)));
}
if (!Bot.IsConnectedAndLoggedOn) {
return (false, Strings.BotNotConnected);
}

View File

@@ -1018,7 +1018,7 @@ namespace ArchiSteamFarm {
internal async Task OnFarmingFinished(bool farmedSomething) {
await OnFarmingStopped().ConfigureAwait(false);
if (BotConfig.SendOnFarmingFinished && (farmedSomething || !FirstTradeSent)) {
if (BotConfig.SendOnFarmingFinished && (BotConfig.LootableTypes.Count > 0) && (farmedSomething || !FirstTradeSent)) {
FirstTradeSent = true;
await Actions.SendTradeOffer(wantedTypes: BotConfig.LootableTypes).ConfigureAwait(false);
@@ -1800,7 +1800,7 @@ namespace ArchiSteamFarm {
SendItemsTimer = null;
}
if ((BotConfig.SendTradePeriod > 0) && BotConfig.SteamUserPermissions.Values.Any(permission => permission >= BotConfig.EPermission.Master)) {
if ((BotConfig.SendTradePeriod > 0) && (BotConfig.LootableTypes.Count > 0) && BotConfig.SteamUserPermissions.Values.Any(permission => permission >= BotConfig.EPermission.Master)) {
SendItemsTimer = new Timer(
async e => await Actions.SendTradeOffer(wantedTypes: BotConfig.LootableTypes).ConfigureAwait(false),
null,

View File

@@ -189,7 +189,7 @@ namespace ArchiSteamFarm {
// If we're not farming, and we got new items, it's likely to be a booster pack or likewise
// In this case, perform a loot if user wants to do so
if (Bot.BotConfig.SendOnFarmingFinished) {
if (Bot.BotConfig.SendOnFarmingFinished && (Bot.BotConfig.LootableTypes.Count > 0)) {
await Bot.Actions.SendTradeOffer(wantedTypes: Bot.BotConfig.LootableTypes).ConfigureAwait(false);
}
}

View File

@@ -358,7 +358,7 @@ namespace ArchiSteamFarm {
lootableTypesReceived = await ParseActiveTrades().ConfigureAwait(false);
}
if (lootableTypesReceived && Bot.BotConfig.SendOnFarmingFinished) {
if (lootableTypesReceived && Bot.BotConfig.SendOnFarmingFinished && (Bot.BotConfig.LootableTypes.Count > 0)) {
await Bot.Actions.SendTradeOffer(wantedTypes: Bot.BotConfig.LootableTypes).ConfigureAwait(false);
}
} finally {