Jump to content


Photo
Question

Need help getting names of all available games on steam account

node.js node-steam-user

  • Please log in to reply
4 replies to this topic

#1 ThePlata

ThePlata

    Newbie

  • Member
  • Pip
  • 8 posts

Posted 30 January 2019 - 07:36 AM

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);
        }
      }
    );
  });


#2 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,040 posts

Posted 30 January 2019 - 03:35 PM

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



#3 ThePlata

ThePlata

    Newbie

  • Member
  • Pip
  • 8 posts

Posted 30 January 2019 - 09:29 PM

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?

#4 ThePlata

ThePlata

    Newbie

  • Member
  • Pip
  • 8 posts

Posted 30 January 2019 - 09:32 PM

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


I figured a way to do it. Thanks

#5 Dr. McKay

Dr. McKay

    Developer

  • Administrator
  • 2,040 posts

Posted 30 January 2019 - 11:38 PM

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.







Also tagged with one or more of these keywords: Question, node.js, node-steam-user

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users