Compare commits

...

7 Commits

Author SHA1 Message Date
Alexander Corn
2d86f81142 3.9.6 2015-10-06 18:53:33 -04:00
Alexander Corn
f37bff4a57 Make the error in getWebApiKey an Error object 2015-10-06 18:53:25 -04:00
Alexander Corn
c700b7663b 3.9.5 2015-10-04 19:47:06 -04:00
Alexander Corn
c26e548c64 Fixed some dumb code 2015-10-04 19:46:38 -04:00
Alexander Corn
658d8fb708 Merge pull request #6 from JorisD33/patch-get-inventory
Patch getInventory
2015-10-04 19:43:59 -04:00
Joris
cd68841d1d Fix getInventory issue 2015-10-04 23:28:40 +02:00
Joris
5853968661 Fix CSteamUser constructor 2015-10-04 23:20:30 +02:00
3 changed files with 17 additions and 17 deletions

View File

@@ -55,26 +55,26 @@ function CSteamUser(community, userData, customurl) {
this._community = community;
this.steamID = new SteamID(userData.steamID64[0]);
this.name = processItem(userData, 'steamID');
this.onlineState = processItem(userData, 'onlineState');
this.stateMessage = processItem(userData, 'stateMessage');
this.privacyState = processItem(userData, 'privacyState', 'uncreated');
this.visibilityState = processItem(userData, 'visibilityState');
this.avatarHash = processItem(userData, 'avatarIcon', '').match(/([0-9a-f]+)\.[a-z]+$/);
this.name = processItem('steamID');
this.onlineState = processItem('onlineState');
this.stateMessage = processItem('stateMessage');
this.privacyState = processItem('privacyState', 'uncreated');
this.visibilityState = processItem('visibilityState');
this.avatarHash = processItem('avatarIcon', '').match(/([0-9a-f]+)\.[a-z]+$/);
if(this.avatarHash) {
this.avatarHash = this.avatarHash[1];
}
this.vacBanned = !!processItem(userData, 'vacBanned', false);
this.tradeBanState = processItem(userData, 'tradeBanState', 'None');
this.isLimitedAccount = !!processItem(userData, 'isLimitedAccount');
this.customURL = processItem(userData, 'customURL', customurl);
this.vacBanned = !!processItem('vacBanned', false);
this.tradeBanState = processItem('tradeBanState', 'None');
this.isLimitedAccount = !!processItem('isLimitedAccount');
this.customURL = processItem('customURL', customurl);
if(this.visibilityState == 3) {
this.memberSince = new Date(processItem(userData, 'memberSince', '0').replace(/(\d{1,2})(st|nd|th)/, "$1"));
this.location = processItem(userData, 'location');
this.realName = processItem(userData, 'realname');
this.summary = processItem(userData, 'summary');
this.memberSince = new Date(processItem('memberSince', '0').replace(/(\d{1,2})(st|nd|th)/, "$1"));
this.location = processItem('location');
this.realName = processItem('realname');
this.summary = processItem('summary');
} else {
this.memberSince = null;
this.location = null;
@@ -157,5 +157,5 @@ CSteamUser.prototype.getInventoryContexts = function(callback) {
};
CSteamUser.prototype.getInventory = function(appID, contextID, tradableOnly, callback) {
this._community.getInventory(appID, contextID, tradableOnly, callback);
this._community.getUserInventory(this.steamID, appID, contextID, tradableOnly, callback);
};

View File

@@ -158,7 +158,7 @@ SteamCommunity.prototype.getWebApiKey = function(domain, callback) {
}
if(body.match(/<h2>Access Denied<\/h2>/)) {
return callback("Access Denied");
return callback(new Error("Access Denied"));
}
var match = body.match(/<p>Key: ([0-9A-F]+)<\/p>/);

View File

@@ -1,6 +1,6 @@
{
"name": "steamcommunity",
"version": "3.9.4",
"version": "3.9.6",
"description": "Provides an interface for logging into and interacting with the Steam Community website",
"keywords": ["steam", "steam community"],
"homepage": "https://github.com/DoctorMcKay/node-steamcommunity",