-
Posts
3628 -
Joined
-
Last visited
Everything posted by Dr. McKay
-
You can't use await like that. In order for it to do anything, you need to return a Promise in the functions you're awaiting, and resolve that Promise with your score once they're complete.
-
Question Need help getting names of all available games on steam account
Dr. McKay replied to ThePlata's topic in node-steam-user
Yes, store the results in an array during the loop then call res.send at the end. It would help future people if you posted your solution. -
With the way your code is currently set up, I would recommend doing it sequentially instead of in parallel. That is, when checkProfile finishes, call checkHours with that score. And when that finishes, do whatever you need to with the score.
-
When you pass a primitive (number, string, etc.) variable to a function like that, changing it inside the function only changes it inside the function. It doesn't change everywhere.
-
Question Need help getting names of all available games on steam account
Dr. McKay replied to ThePlata's topic in node-steam-user
I would assume that you're only supposed to call res.send once. -
BREAKING CHANGES: steam-user v4 now available on npm
Dr. McKay replied to Dr. McKay's topic in node-steam-user
v4 is now out of beta and is live on npm. -
https://api.steampowered.com/IPlayerService/GetOwnedGames/v1/?key=xxx&steamid=76561098044947296&include_played_free_games=1 Something is making Steam choke on this profile, so Steam is returning a 500 response. You should either check the status code (response.statusCode == 200), or wrap your JSON.parse call in a try/catch block (or ideally, both).
-
I'm sure there is.
-
Question Why is apps returning null in getProductInfo?
Dr. McKay replied to ThePlata's topic in node-steam-user
Okay, so there's your problem. As of v4, the first argument in all callbacks is err. Check out the full release notes for all the breaking changes. -
timecreated is Unix time, which is the number of seconds that have elapsed since January 1, 1970 00:00:00 (UTC). In JavaScript, Date.now() gives you the current Unix time in milliseconds, so to get the current Unix time in seconds, you'll do Math.floor(Date.now() / 1000). So to get the seconds since the account was created, you'd do Math.floor(Date.now() / 1000) - player.timecreated.
-
=1, not =true.
-
SnaBe is right, you'll want to use the WebAPI. There's no way to get a player's game time from a CM (via node-steam-user), and scraping the web is futile if there's just an API for it.
-
Question Why is apps returning null in getProductInfo?
Dr. McKay replied to ThePlata's topic in node-steam-user
Are you on v3 or v4? -
BREAKING CHANGES: steam-user v4 now available on npm
Dr. McKay replied to Dr. McKay's topic in node-steam-user
Chat code will never be ported to node-steamcommunity. The new webchat is just a CM WebSocket connection established using a nonce retrieved from a web API. The same CM WebSocket connection is used by steam-user, so porting it to node-steamcommunity would basically just be copying and pasting all of node-steam-user. I may, in the future, add a way to get the nonce from node-steamcommunity in order to login to node-steam-user, but that's about all that would make sense to be done. -
Question Why is apps returning null in getProductInfo?
Dr. McKay replied to ThePlata's topic in node-steam-user
Works fine for me. -
Need some help about checking Steam level
Dr. McKay replied to TextDynasty's topic in node-steam-user
You seem to not have an understanding of how async JavaScript code works. Just because logOn was called doesn't mean you're actually logged on. You need to wait for the loggedOn event. -
Tradeoffer manager not working for me.
Dr. McKay replied to KubekSzklany's topic in node-steam-tradeoffer-manager
Check the setCookies callback for errors. -
Need some help about checking Steam level
Dr. McKay replied to TextDynasty's topic in node-steam-user
It doesn't look like you ever logged on. -
Tradeoffer manager not working for me.
Dr. McKay replied to KubekSzklany's topic in node-steam-tradeoffer-manager
You never called TradesManager.setCookies -
Question How to add only 1 item type to offer
Dr. McKay replied to roughnecks's topic in node-steam-tradeoffer-manager
You are still getting an array. tags: [ [Object], [Object], [Object], [Object] ] is just how console.log represents an array containing 4 objects. -
Question How to add only 1 item type to offer
Dr. McKay replied to roughnecks's topic in node-steam-tradeoffer-manager
let tag; if ((tag = item.getTag('item_class')) && tag.internal_name == 'item_class_2') { ... } -
BREAKING CHANGES: steam-user v4 now available on npm
Dr. McKay replied to Dr. McKay's topic in node-steam-user
Yes, that's normal. Originally v4 was going to fill in all values not sent by Steam with their defaults (e.g. 0 or empty string) but I decided against that and switched those values back to null (which is how it works in v3). Null means that those values were not sent to us by Steam at all, which is more correct than "assuming" 0 or empty string. -
BREAKING CHANGES: steam-user v4 now available on npm
Dr. McKay replied to Dr. McKay's topic in node-steam-user
What is the bug?