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