-
Notifications
You must be signed in to change notification settings - Fork 191
Suggestion - Callback on GetMatchDetails #2
Comments
Callbacks would indeed be preferable, however I hadn't though much on how to implement then because I was under the impression there was no way to track which replies were associated with which query. Looking into it further however it appears the Steam message headers allow the inclusion of job ids and node-steam's toGC function is already equipped to deal with these. It should be rather trivial to move node-dota2 over to using callbacks for methods where responses are expected; I'll play around with it and see where I get. |
Awesome! |
There we go. For simplicity all of the callbacks just return (error, response), but you can find the response data structure within the protobuf docs - though bear in mind the protobuf docs have parameters noted in underscore case, but the compiled descriptors are camelCase - e.g. where the doc says |
I am a complete noob (but working my way through this), and one thing that struck me as odd is the lack of a way to callback on the getMatchDetails. Feel free to ignore, but aren't there many use cases where it is preferable to simply wait for the callback instead of waiting for an event?
The scenario I am currently working on:
On receiving a steam message with a matchID, the bot looks up the matchID and responds with some of the match data. Without the callback, you need to now keep track of who is requesting what, so that you know where to send the match details when you get them.
Perhaps I am approaching this wrong, and I'm not even sure if this is the right place to be making suggestions.
The text was updated successfully, but these errors were encountered: