From d68141d1ae0cb6294de21706fd0efa1dd8522ceb Mon Sep 17 00:00:00 2001 From: Citrinate Date: Sun, 24 Mar 2024 09:23:23 -0400 Subject: [PATCH] Revert back to using AWH for inventory fetching New method randomly returns an empty inventory which is something the old method never did --- BoosterManager/Handlers/GemHandler.cs | 4 ++-- BoosterManager/Handlers/InventoryHandler.cs | 4 ++-- BoosterManager/Handlers/KeyHandler.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/BoosterManager/Handlers/GemHandler.cs b/BoosterManager/Handlers/GemHandler.cs index 77b3e23..7a07e79 100644 --- a/BoosterManager/Handlers/GemHandler.cs +++ b/BoosterManager/Handlers/GemHandler.cs @@ -14,7 +14,7 @@ internal static class GemHandler { internal static async Task GetGemCount(Bot bot) { HashSet inventory; try { - inventory = await bot.ArchiHandler.GetMyInventoryAsync().Where(item => ItemIdentifier.GemAndSackIdentifier.IsItemMatch(item)).ToHashSetAsync().ConfigureAwait(false); + inventory = await bot.ArchiWebHandler.GetInventoryAsync().Where(item => ItemIdentifier.GemAndSackIdentifier.IsItemMatch(item)).ToHashSetAsync().ConfigureAwait(false); } catch (Exception e) { bot.ArchiLogger.LogGenericException(e); return Commands.FormatBotResponse(bot, ArchiSteamFarm.Localization.Strings.WarningFailed); @@ -53,7 +53,7 @@ internal static async Task GetGemCount(Bot bot) { internal static async Task UnpackGems(Bot bot) { HashSet sacks; try { - sacks = await bot.ArchiHandler.GetMyInventoryAsync().Where(item => ItemIdentifier.SackIdentifier.IsItemMatch(item) && (BoosterHandler.AllowCraftUntradableBoosters || item.Tradable)).ToHashSetAsync().ConfigureAwait(false); + sacks = await bot.ArchiWebHandler.GetInventoryAsync().Where(item => ItemIdentifier.SackIdentifier.IsItemMatch(item) && (BoosterHandler.AllowCraftUntradableBoosters || item.Tradable)).ToHashSetAsync().ConfigureAwait(false); } catch (Exception e) { bot.ArchiLogger.LogGenericException(e); return Commands.FormatBotResponse(bot, ArchiSteamFarm.Localization.Strings.WarningFailed); diff --git a/BoosterManager/Handlers/InventoryHandler.cs b/BoosterManager/Handlers/InventoryHandler.cs index 6bce0fc..d54d088 100644 --- a/BoosterManager/Handlers/InventoryHandler.cs +++ b/BoosterManager/Handlers/InventoryHandler.cs @@ -15,7 +15,7 @@ internal static async Task SendItemToMultipleBots(Bot sender, List<(Bot HashSet itemStacks; try { - itemStacks = await sender.ArchiHandler.GetMyInventoryAsync(appID: appID, contextID: contextID).Where(item => item.Tradable && itemIdentifier.IsItemMatch(item)).ToHashSetAsync().ConfigureAwait(false); + itemStacks = await sender.ArchiWebHandler.GetInventoryAsync(appID: appID, contextID: contextID).Where(item => item.Tradable && itemIdentifier.IsItemMatch(item)).ToHashSetAsync().ConfigureAwait(false); } catch (Exception e) { sender.ArchiLogger.LogGenericException(e); return Commands.FormatBotResponse(sender, ArchiSteamFarm.Localization.Strings.WarningFailed); @@ -80,7 +80,7 @@ internal static async Task SendMultipleItemsToMultipleBots(Bot sender, H HashSet inventory; try { - inventory = await sender.ArchiHandler.GetMyInventoryAsync(appID: appID, contextID: contextID).ToHashSetAsync().ConfigureAwait(false); + inventory = await sender.ArchiWebHandler.GetInventoryAsync(appID: appID, contextID: contextID).ToHashSetAsync().ConfigureAwait(false); } catch (Exception e) { sender.ArchiLogger.LogGenericException(e); return Commands.FormatBotResponse(sender, ArchiSteamFarm.Localization.Strings.WarningFailed); diff --git a/BoosterManager/Handlers/KeyHandler.cs b/BoosterManager/Handlers/KeyHandler.cs index 697da58..11e8d2c 100644 --- a/BoosterManager/Handlers/KeyHandler.cs +++ b/BoosterManager/Handlers/KeyHandler.cs @@ -15,7 +15,7 @@ internal static class KeyHandler { internal static async Task GetKeyCount(Bot bot) { HashSet inventory; try { - inventory = await bot.ArchiHandler.GetMyInventoryAsync(appID: KeyAppID, contextID: KeyContextID).Where(item => ItemIdentifier.KeyIdentifier.IsItemMatch(item)).ToHashSetAsync().ConfigureAwait(false); + inventory = await bot.ArchiWebHandler.GetInventoryAsync(appID: KeyAppID, contextID: KeyContextID).Where(item => ItemIdentifier.KeyIdentifier.IsItemMatch(item)).ToHashSetAsync().ConfigureAwait(false); } catch (Exception e) { bot.ArchiLogger.LogGenericException(e); return Commands.FormatBotResponse(bot, ArchiSteamFarm.Localization.Strings.WarningFailed);