Arcana / node-dota2

A node-steam plugin for Dota 2.
MIT License
542 stars 191 forks source link

Sending Client Hello to the dota2 game co-ordinator #665

Closed c00kie17 closed 5 years ago

c00kie17 commented 5 years ago

Hi Im trying to re create node-dota2 functionality to learn how it works but I cant get past sending the clientHello.I think im making a mistake somewhere because I am not getting a response back from the game co-ordinator. My code is attached below.

I know this ist the best place to ask this question. If there is a forum or any other communication channel I will be happy to pursue that.

const steam_resources = require("steam-resources")

const steamClient = new steam.SteamClient()
const steamUser = new steam.SteamUser(steamClient)
const steamGameCoordinator = new steam.SteamGameCoordinator(steamClient, 570)
const dota_proto = steam_resources.GC.Dota.Internal

steamClient.connect();
steamClient.on('connected', function() {
  steamUser.logOn({
    account_name: username,
    password: password,
  });
});

steamClient.on('logOnResponse', function(logonResp) {
  if(logonResp.eresult == steam.EResult.OK){
    console.log('logged in')
    send_client_hello()
  }
});

steamGameCoordinator.on("message", function(header, body, callback) {
  console.log(header)
  console.log(body)
});

function send_client_hello(){
  steamGameCoordinator.send(
    {msg: dota_proto.EGCBaseClientMsg.k_EMsgGCClientHello, proto: {}},
    new dota_proto.CMsgClientHello({}).toBuffer()
  )
  console.log('sent hello')
} 

I know this ist the best place to ask this question. If there is a forum or any other communication channel I will be happy to pursue that.

c00kie17 commented 5 years ago

You need to call SteamUser#gamesPlayed