mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2024-12-29 16:10:12 +08:00
Added contextid property to CEconItem objects
This commit is contained in:
parent
c3f5b492b3
commit
82f1d490f9
@ -1,6 +1,6 @@
|
||||
module.exports = CEconItem;
|
||||
|
||||
function CEconItem(item, descriptions) {
|
||||
function CEconItem(item, descriptions, contextID) {
|
||||
var thing;
|
||||
for(thing in item) {
|
||||
if(item.hasOwnProperty(thing)) {
|
||||
@ -11,6 +11,7 @@ function CEconItem(item, descriptions) {
|
||||
this.assetid = this.id = (this.id || this.assetid);
|
||||
this.instanceid = this.instanceid || '0';
|
||||
this.amount = parseInt(this.amount, 10);
|
||||
this.contextid = contextID.toString();
|
||||
|
||||
// Merge the description
|
||||
var description = descriptions[this.classid + '_' + this.instanceid];
|
||||
|
@ -272,7 +272,7 @@ SteamCommunity.prototype.getUserInventory = function(userID, appID, contextID, t
|
||||
continue;
|
||||
}
|
||||
|
||||
inventory.push(new CEconItem(body.rgInventory[i], body.rgDescriptions));
|
||||
inventory.push(new CEconItem(body.rgInventory[i], body.rgDescriptions, contextID));
|
||||
}
|
||||
|
||||
for(i in body.rgCurrency) {
|
||||
@ -280,7 +280,7 @@ SteamCommunity.prototype.getUserInventory = function(userID, appID, contextID, t
|
||||
continue;
|
||||
}
|
||||
|
||||
currency.push(new CEconItem(body.rgInventory[i], body.rgDescriptions));
|
||||
currency.push(new CEconItem(body.rgInventory[i], body.rgDescriptions, contextID));
|
||||
}
|
||||
|
||||
if(body.more) {
|
||||
|
Loading…
Reference in New Issue
Block a user