playerProfile keeps the same data for every user.
See original GitHub issueHello. Me and my friend are trying to do a simple app that would take all the steam64ids from mysql and then use the id in playerProfileRequest.
`var j = schedule.scheduleJob(‘*/5 * * * * *’, function(){ var array = [];
con.query("SELECT * FROM counterStrikeGlobalOffensive", function (err, rows) {
for (var i = 0; i < rows.length; i++) {
console.log(rows[i].steam64ID);
CSGOCli.playerProfileRequest(CSGOCli.ToAccountID(rows[i].steam64ID));
CSGOCli.on("playerProfile", function(profile) {
console.log(profile.account_profiles[0].ranking.rank_id);
return;
});
}
});
return; });`
This is where my problem begins. When I do console.log(rows[i].steam64ID, it returns all of the ids that are in the mysql. Then I put the id in playerProfileRequest and then when I do console.log(profile), it keeps repeating the same data for each steamid.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Keep user and user profile in different tables?
User profile data, which includes users preferences, latest activity, status updates etc. Note that there are some attributes about the user ...
Read more >User profile and all of my data is gone / windows 10
My user profile and all my data, docs, photos, music, videos have disappeared from my laptop running windows 10. I was using my...
Read more >Supporting Multiple Users | Android Open Source Project
A profile is a subset of, and tied to, the existence of a user. A user can have multiple profiles. Profiles are created...
Read more >Best Practices for Identifying Users | Segment Documentation
The most important calls you make with Segment are the Track and Identify calls. With the Track call, you can attribute actions on...
Read more >Manage User Accounts and Settings in Windows 10
Every user account is also classified as either: ... The Windows 10 system of user profiles allows more than one person to use...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Something like this. I haven’t tested this code, so your mileage may vary. It’s not even the best way to go about it, but it should work. I specifically don’t like adding a new callback every time it iterates, but I don’t have any time to debug it or make it more efficient. This should help out a bit, though. The idea is that it’s similar to
forEachon an array, but because we have asynchronous callbacks, just usingforEachwill iterate over the entire array and disregard the asynchronous operations. By using theasyncpackage and theeachSeries, we don’t iterate untilcallback()is called from within our last asynchronous operation.Don’t spam the GC. Wait until you get a
playerProfile, then callplayerProfileRequestagain with the next steam ID you want info on.