mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-06 17:10:13 +00:00
Improve refundable games check
Free promos like Cortex Command added as "Complimentary" were previously skipped as being refundable.
This commit is contained in:
@@ -374,7 +374,7 @@ namespace ArchiSteamFarm {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((packageData.PaymentMethod != EPaymentMethod.ActivationCode) && (packageData.TimeCreated > mostRecent)) {
|
||||
if (IsRefundable(packageData.PaymentMethod) && (packageData.TimeCreated > mostRecent)) {
|
||||
mostRecent = packageData.TimeCreated;
|
||||
}
|
||||
}
|
||||
@@ -1474,6 +1474,23 @@ namespace ArchiSteamFarm {
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool IsRefundable(EPaymentMethod method) {
|
||||
if (method == EPaymentMethod.None) {
|
||||
ASF.ArchiLogger.LogNullError(nameof(method));
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (method) {
|
||||
case EPaymentMethod.ActivationCode:
|
||||
case EPaymentMethod.Complimentary:
|
||||
case EPaymentMethod.GuestPass:
|
||||
case EPaymentMethod.HardwarePromo:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private static bool IsValidCdKey(string key) {
|
||||
if (!string.IsNullOrEmpty(key)) {
|
||||
return Regex.IsMatch(key, @"^[0-9A-Z]{4,7}-[0-9A-Z]{4,7}-[0-9A-Z]{4,7}(?:(?:-[0-9A-Z]{4,7})?(?:-[0-9A-Z]{4,7}))?$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
|
||||
Reference in New Issue
Block a user