DoctorMcKay / node-globaloffensive

A Node.js module to connect to and interact with the CS2 game coordinator. Mostly used to get item data.
https://www.npmjs.com/package/globaloffensive
MIT License
262 stars 61 forks source link

How can I get the LiveGame? #56

Closed Wurstfach404 closed 4 years ago

Wurstfach404 commented 4 years ago

I want to get the live game of a specific steam user. With csgo.requestLiveGameForUser(account_id) I get:

Sending GC message MatchListRequestLiveGameForUser
Got unhandled GC message 9173
Got handled GC message MatchmakingGC2ClientHello
Got unhandled GC message 9194
Got unhandled GC message 9173
Got handled GC message MatchList

But how can I see the data, that I received from the GC?

Wurstfach404 commented 4 years ago

Okay, I got it with:

csgo.on('matchList', async (data) => {
    console.log(data);
});

Can I somehow get all connected player with this information?

Bl4CkGuuN commented 4 years ago

That should work: console.log( data[0].roundstats_legacy.reservation.account_ids);

Wurstfach404 commented 4 years ago

Oh yeah, that works. Thank you :)