Skip to content
This repository has been archived by the owner on Jun 11, 2022. It is now read-only.

Suggestion - Callback on GetMatchDetails #2

Closed
jimmydorry opened this issue Aug 16, 2013 · 3 comments
Closed

Suggestion - Callback on GetMatchDetails #2

jimmydorry opened this issue Aug 16, 2013 · 3 comments

Comments

@jimmydorry
Copy link
Member

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.

@rjackson
Copy link
Member

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.

@jimmydorry
Copy link
Member Author

Awesome!

rjackson added a commit that referenced this issue Aug 16, 2013
@rjackson
Copy link
Member

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 channel_name you will have to use channelName.

rjackson pushed a commit that referenced this issue Mar 18, 2014
Crazy-Duck pushed a commit that referenced this issue Aug 11, 2016
Crazy-Duck pushed a commit that referenced this issue Dec 12, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants