Jump to content
McKay Development

Getting follower count of a game


Recommended Posts

Not sure if it is possible, but I would like to get game's follower count using node-steam-user.

What I have tried, is creating a similar method to getPlayerCount, but replacing the message. So, what I came up with looks like this:
 

SteamUser.prototype.getFollowerCount = function(appid, callback) {
  return StdLib.Promises.timeoutCallbackPromise(10000, [], callback, (resolve, reject) => {
    this._send(SteamUser.EMsg.ClientFSGetFollowerCount, [730], (body) => {
      console.log(body);
      resolve('done');
    });
  });
};

But with this approach, calling the new method gets me a Type Error:

TypeError [ERR_INVALID_ARG_TYPE]: The "list[1]" argument must be one of type Array, Buffer, or Uint8Array. Received type object
    at Function.concat (buffer.js:479:13)
    at SteamUser._send (/home/harry/steam-tools/node_modules/steam-user/components/messages.js:456:31)
    at StdLib.Promises.timeoutCallbackPromise (/home/harry/steam-tools/src/steam-client.js:8:8)
    at Promise (/home/harry/steam-tools/node_modules/@doctormckay/stdlib/components/promises.js:22:25)
    at new Promise (<anonymous>)
    at Object.Promises.timeoutPromise (/home/harry/steam-tools/node_modules/@doctormckay/stdlib/components/promises.js:10:9)
    at Object.Promises.timeoutCallbackPromise (/home/harry/steam-tools/node_modules/@doctormckay/stdlib/components/promises.js:83:25)
    at SteamUser.getHarryTest (/home/harry/steam-tools/src/steam-client.js:7:25)
    at SteamUser.<anonymous> (/home/harry/steam-tools/src/steam-client.js:44:12)
    at SteamUser.emit (events.js:198:13)

 

So, this raises me a few questions:

1. Am I even able to create new methods in this way (sending a different message with appropriate body) or are there some limitations that I am not aware of?
2. If the approach is fine, then how can I figure out the correct message body that I need to send? Is it documented somewhere or is there some method of figuring it out? (I am assuming that my issue is coming from invalid message body).
3. Of course, I would be very thankful for the help of resolving the actual issue here or some directions to solving it :)

 

Edited by Harry
Link to post
Share on other sites

Some progress. I added this to messages.js:

protobufs[EMsg.ClientFSGetFollowerCount] = Schema.CMsgFSGetFollowerCount;
protobufs[EMsg.ClientFSGetFollowerCountResponse] = Schema.CMsgFSGetFollowerCountResponse;

And changed my new method to:

SteamUser.prototype.getFollowerCount = function(appid, callback) {
  return StdLib.Promises.timeoutCallbackPromise(10000, [], callback, (resolve, reject) => {
    this._send(SteamUser.EMsg.ClientFSGetFollowerCount, {'steam_id': '103582791432902485'}, (body) => {
      console.log(body);
      resolve('done');
    });
  });
};

Value of body in the callback:

{ eresult: 1, count: 0 }

 

So, seems that I am sending the message correctly now, but either using wrong ID for CS:GO or misusing the library somehow.

Link to post
Share on other sites
Posted (edited)

Thank you! Seems so... Do You know if it is possible to get the follower count somehow?

Searching from the list of messages, I found AMGetClanMembers, but I haven't been able to try it yet, because it isn't as simple to add it as the follower count.

For ClientFSGetFollowerCount I found CMsgFSGetFollowerCount, but for AMGetClanMembers I can't find the counterpart - maybe You can give me an advice on this sort of situation as well or point me to the right direction?

Edited by Harry
Link to post
Share on other sites

AMGetClanMembers might not be a protobuf message. In any case, it might not work at all, and even if it does it's most likely only going to give you either a list or a count of members in a Steam group, not followers of an app.

It may not be possible to get the number of followers of an app.

Link to post
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...