Jump to content
McKay Development

getUserInventoryContents works with some appId and not with some appId


Recommended Posts

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

Link to comment
Share on other sites

Posted (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 by 19a1047
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...