19a1047 Posted July 21 Report Posted July 21 as title said. if the input of appId is 730 it returns the requested inventory perfectly. if the input of appId is 440 it always returns a blank array [] if it was from a different steam user; but return the inventory if the steamId passed in is the same with the initiated community object. wonder if the problem is only limited to tf2 Quote
19a1047 Posted July 21 Author Report Posted July 21 (edited) Quote /** * * @param {SteamCommunity} community * @param {*} steamId steamId array * @param {*} appId default by 730 * @param {*} contextId default by 2 * @returns {Array} partnerInventory */ export const loadInventoryCommunity = ( community, id64, appId = 730, contextId = 2, ) => { let partnerInventory = []; community.getUserInventoryContents( id64, appId, contextId, true, "english", (err, inventory, currency) => { if (err) { logger.error( `Error loading inventory ${appId}: ${JSON.stringify(err)}`, ); return false; } console.log(inventory[0]); partnerInventory = [...inventory]; }, ); return partnerInventory; }; Scenario 1: SteamCommunity of initiated from A's credentials; steamId = A's id64; appId 440: logged out succesfully; Scenario 2: SC of A's credentials, steamId = B's id64; appId 440: failed to log out first item; returned inventory was a blank array; Scenario 3: SC of A's credentials, steamId = B's id64; appId 730: succesfully logged out first item; environment: node.js 20.14.0 dependencies: "steam-user": "^5.0.8", "steamcommunity": "^3.48.2", I think I found the problem, the TF2 inventory I tried to fetch was actually blanked... my bad. Edited July 21 by 19a1047 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.