-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Checklist
- I read and understood ASF's Contributing guidelines
- I also read Setting-up and FAQ, I don't need help, this is a bug report
- This is not a duplicate of an existing issue
- I don't own more than 10 accounts in total
- I'm not using custom plugins
- This is not a question
- This is not a technical issue
- This is not ASF-ui problem
ASF version
Latest stable release
ASF variant
win-x64
Bug description
Putting an invalid Steam key in the BotName.keys file works as expected only if there is also at least one other valid key in the file. If the ONLY key in the file is an invalid key, then the BotName.keys file is not deleted, which is unexpected and against the documentation.
Expected behavior
When a BotNames.keys file is created, it should be detected by the ASF Background Games Redeemer, processed, and then deleted. There is no documented circumstance under which the file should remain after it is processed.
Actual behavior
If the BotName.keys file contains an invalid key but also a valid key, it is processed as expected. The file is deleted after processing.
If the file contains an invalid key or keys, but no valid keys are also in the file, then the file is NOT deleted and a message is printed to the log:
ImportKeysToRedeem() No valid keys were found in your .keys file for redemption. Please ensure your keys are in the correct format.
This behavior is undocumented and seems to have changed recently, as it did not do this in previous versions (not sure the exact version in which it changed).
Steps to reproduce
- Create a BotName.keys file containing an invalid key (an invalid FORMAT, not a key that is in a valid format but Steam returns as a Fail/BadActivationCode) such as "BOGUS_KEY".
- ASF will try to process the file and then log the error mentioned above and not delete the file.
- Edit the BotName.keys file by appending a VALID looking Steam key, such as AAAAA-FFFFF-HHHHH, while keeping the original invalid key "BOGUS_KEY", as the first line in the file.
- ASF will process the file, try to redeem the VALID looking key and then delete the file, even though the BOGUS_KEY line is still in there. It will not log anything regarding the invalid key.
Possible reason/solution
I believe the solution to this is to treat invalid keys the same way no matter if the file also contains valid keys.
This means that if an invalid key is found in the file, no matter what other keys are in the file, it should ignore them, try to redeem any valid keys, and then delete the file.
One possible enhancement would be to transfer these invalid keys to a new file called BotName.keys.invalid or some such appropriately named file, similar to the BotName.keys.unused and BotName.keys.used files, although this is not necessary.
Can you help us with this bug report?
Somehow, I can test and offer feedback, but can't code
Full log.txt recorded during reproducing the problem
The only log entry is the one I mentioned above.
Global ASF.json config file
NoneBotName.json config of all affected bot instances
{
"Enabled": true,
"FarmingPreferences": 8,
"OnlineStatus": 0,
"SteamLogin": "*********"
}Additional info
As mentioned, I only started having this problem recently, so it is most likely related to a recent change to the "Background games redeemer" code.