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