Fix wallet code redeeming due to Steam changes (#1358)

* Fix wallet code redeeming due to Steam changes

* Revert "Fix wallet code redeeming due to Steam changes"

This reverts commit a993b26e

* Add AssumeWalletKeyOnBadActivationCode parameter to RedeemingPreferences, add according flags for redeem^
This commit is contained in:
Vitaliy
2019-08-05 15:41:37 +03:00
committed by Łukasz Domeradzki
parent 5fe8631e4f
commit 737aa622b7
3 changed files with 21 additions and 5 deletions

View File

@@ -2793,6 +2793,8 @@ namespace ArchiSteamFarm {
ArchiLogger.LogGenericInfo(Strings.Starting);
bool assumeWalletKeyOnBadActivationCode = BotConfig.RedeemingPreferences.HasFlag(BotConfig.ERedeemingPreferences.AssumeWalletKeyOnBadActivationCode);
while (IsConnectedAndLoggedOn && BotDatabase.HasGamesToRedeemInBackground) {
(string key, string name) = BotDatabase.GetGameToRedeemInBackground();
@@ -2808,7 +2810,7 @@ namespace ArchiSteamFarm {
continue;
}
if ((result.PurchaseResultDetail == EPurchaseResultDetail.CannotRedeemCodeFromClient) && (WalletCurrency != ECurrencyCode.Invalid)) {
if (((result.PurchaseResultDetail == EPurchaseResultDetail.CannotRedeemCodeFromClient) || ((result.PurchaseResultDetail == EPurchaseResultDetail.BadActivationCode) && assumeWalletKeyOnBadActivationCode)) && (WalletCurrency != ECurrencyCode.Invalid)) {
// If it's a wallet code, we try to redeem it first, then handle the inner result as our primary one
(EResult Result, EPurchaseResultDetail? PurchaseResult)? walletResult = await ArchiWebHandler.RedeemWalletKey(key).ConfigureAwait(false);