Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function redeemKey() returns undefined SubID #115

Closed
Revadike opened this issue Jul 1, 2017 · 8 comments
Closed

Function redeemKey() returns undefined SubID #115

Revadike opened this issue Jul 1, 2017 · 8 comments
Labels

Comments

@Revadike
Copy link
Contributor

Revadike commented Jul 1, 2017

Somewhere late of the 22nd of June, redeemKey started returning { undefined: 'GameTitle' } for me as package(s). The game titles are correct, but the subid's are not. I assumed it was because of the Summer Sale that just started, but it still hasn't been resolved. I have this bug across devices. I don't think there is anything wrong with the code. Even if the first line of the callback is console.log(packages); it prints the undefinied subid. Am I the only one with this issue? Or does it happen for others as well?

@PixLSteam
Copy link

As far as I know, Valve removed support for named subs: https://twitter.com/SteamDB/status/570951174028963840

@Revadike
Copy link
Contributor Author

Revadike commented Jul 1, 2017

It worked all fine before 22th of june.

@PixLSteam
Copy link

Might be a change made by Valve. I guess McKay might have a clue

@Revadike
Copy link
Contributor Author

Revadike commented Jul 1, 2017

Do you also experience this issue?
Here is a steam key to test with T0JT7-JTIDD-5JV8Y

@DoctorMcKay
Copy link
Owner

Cannot reproduce.

{ '0': 1, '1': 0, '2': { '128342': 'Guardian\'s Oath' } }

@Ne3tCode
Copy link
Contributor

Ne3tCode commented Jul 1, 2017

Patch:

diff --git a/components/apps.js b/components/apps.js
index 42c2f1b..4484c1c 100644
--- a/components/apps.js
+++ b/components/apps.js
@@ -499,7 +499,8 @@ SteamUser.prototype.redeemKey = function(key, callback) {
 		var recipeDetails = BinaryKVParser.parse(body.purchase_receipt_info).MessageObject;
 		if (recipeDetails.LineItemCount > 0) {
 			recipeDetails.lineitems.forEach(function(pkg) {
-				packageList[pkg.PackageID] = pkg.ItemDescription;
+				var packageID = pkg.PackageID || pkg.packageID || pkg.packageid;
+				packageList[packageID] = pkg.ItemDescription;
 			});
 		}

Also #36 (comment)

@DoctorMcKay
Copy link
Owner

I have no way of testing that patch, but I believe it. Classic Valve.

@Revadike
Copy link
Contributor Author

Revadike commented Jul 2, 2017

Look at that! It actually worked 😄
I guess it's similar to appinfo.type sometimes being "Game" and sometimes being "game".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants