joshuaferrara / node-csgo

A node-steam plugin for Counter-Strike: Global Offensive.
MIT License
460 stars 82 forks source link

SharecodeDecoder not working #73

Closed peterfranzo closed 4 years ago

peterfranzo commented 4 years ago

The sharecode decover is not working for me:

`

var Steam = require('steam'); var csgo = require('csgo')

var steamClient = new Steam.SteamClient(); var steamUser = new Steam.SteamUser(steamClient); steamClient.connect(); steamClient.on('connected', function() { steamUser.logOn({ account_name: 'redacted', password: 'redacted' }); });

steamClient.on('logOnResponse', function() { steamGC = new Steam.SteamGameCoordinator(steamClient, 730); CSGO = new csgo.CSGOClient(steamUser, steamGC, false);

console.log(CSGO.SharecodeDecoder("CSGO-U6MWi-hYFWJ-opPwD-JciHm-qOijD").decode()); });

`

this results in image

joshuaferrara commented 4 years ago

You should be making a new instance of the SharecodeDecoder from the csgo import (not your CSGO instance).

You're also missing a new before csgo.SharecodeDecoder; from the example.js file:

/* Decoding Share Codes */
var scDecoder = new csgo.SharecodeDecoder("CSGO-U6MWi-hYFWJ-opPwD-JciHm-qOijD");
console.log("Sharecode CSGO-U6MWi-hYFWJ-opPwD-JciHm-qOijD decodes into: ");
console.log(scDecoder.decode());