Jump to content
McKay Development

Recommended Posts

Posted

How do I get the names of all available games on steam displaying on the website? Here's my code. It just displays a blank page for like 5 seconds and displays an "Already logged on, cannot log on again" error. How do I properly display it?

client.on("appOwnershipCached", () => {
    let gameArr = client.getOwnedApps();

    client.getProductInfo(
      gameArr,
      [],
      (err, apps, packages, unknownApps, unknownPackages) => {
        for (var appid in apps) {
          res.send(apps[appid].appinfo.common.name);
        }
      }
    );
  });
Posted

I would assume that you're only supposed to call res.send once.

Yes you're right. So what you're suggesting it I store the values in an array and res.send it once? Wouldn't it be the same since you're still looping it?

Posted

Yes you're right. So what you're suggesting it I store the values in an array and res.send it once? Wouldn't it be the same since you're still looping it?

 

Yes, store the results in an array during the loop then call res.send at the end.

 

I figured a way to do it. Thanks

 

It would help future people if you posted your solution.

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...