Closed lenovouser closed 7 years ago
Are you receiving the zeros for msgrequestid, accountid & servertime
or were those added for privacy when posting the issue? If you're getting zeros, that's definitely a new one for me.
Furthermore, is that the whole program you're running, or are there definitions above steamFriends.setPersonaState(steam.EPersonaState.Busy);
for steamUser
, steamCoordinator
, etc...
The zeros were added for privacy reasons.
A more complete part of the code:
const steamClient = new steam.SteamClient();
const steamUser = new steam.SteamUser(steamClient);
const steamCoordinator = new steam.SteamGameCoordinator(steamClient, 730);
const steamFriends = new steam.SteamFriends(steamClient);
const sharecode = this.sharecode;
const account = this.account;
const login = {
account_name: account.id,
password: account.password,
};
fs.access(`${__dirname}/sentry/${account.id}.sentry`, fs.F_OK, (err) => {
if (!err) {
login.sha_sentryfile = fs.readFileSync(`${__dirname}/sentry/${account.id}.sentry`);
}
});
steamClient.connect();
steamClient.on('connected', () => {
steamUser.logOn(login);
});
steamClient.on('logOnResponse', (response) => {
if (response.eresult === steam.EResult.OK) {
steamFriends.setPersonaState(steam.EPersonaState.Busy);
const counterstrike = new csgo.CSGOClient(steamUser, steamCoordinator, false);
counterstrike.launch();
const decode = new csgo.SharecodeDecoder(sharecode);
counterstrike.on('ready', () => {
counterstrike.requestGame(decode.matchId, decode.outcomeId, decode.tokenId);
});
counterstrike.on('matchList', (matchResponse) => {
console.log(JSON.stringify(matchResponse));
counterstrike.exit();
steamClient.disconnect();
});
} else if (response.eresult === steam.EResult.AccountLoginDeniedNeedTwoFactor) {
logger.error(`Account needs Mobile Auth Code: ${login.account_name}: ${JSON.stringify(response)}`);
utils.account.disable(login.account_name);
} else if (response.eresult === steam.EResult.AccountLogonDenied) {
logger.error(`Account needs Steam Guard Code or the Credentials are wrong: ${login.account_name}: ${JSON.stringify(response)}`);
utils.account.disable(login.account_name);
} else if (response.eresult === steam.EResult.RateLimitExceeded) {
logger.error(`Rate limit was exceeded using ${login.account_name}: ${JSON.stringify(response)}`);
utils.account.disable(login.account_name);
} else {
logger.error(`Login unsuccessful using ${login.account_name}: ${JSON.stringify(response)}`);
utils.account.disable(login.account_name);
}
});
Could you provide the sharecode you are using with this script? We've had issues in the past with the SharecodeDecoder
providing weird values, and the implementation could have possibly changed in the engine since the JS port was written.
If you'd prefer to keep the sharecode private, send me an email at csgo@ferrara.space
It doesn't seem to work with any sharecode. Dumb question, must the account getting the match info have been in that game too? AFAIK no, because you can also watch other demos in CSGO if your friend gives you the sharecode.
Example Sharecode:
CSGO-qdZYs-pEcib-CqwiO-kU3KG-CKxbE
I'm able to poll the match results from my account. Please try this: counterstrike.requestGame(decode.matchId, decode.outcomeId, parseInt(decode.tokenId));
Usually you'll get a protobuf error when you try and pass tokenId as a string when it should be an int.
Here's more or less what I did within example.js:
CSGOCli.on("ready", function() {
util.log("node-csgo ready.");
CSGOCli.matchmakingStatsRequest();
CSGOCli.on("matchmakingStatsData", function(matchmakingStatsResponse) {
util.log("Avg. Wait Time: " + matchmakingStatsResponse.global_stats.search_time_avg);
util.log("Players Online: " + matchmakingStatsResponse.global_stats.players_online);
util.log("Players Searching: " + matchmakingStatsResponse.global_stats.players_searching);
util.log("Servers Online: " + matchmakingStatsResponse.global_stats.servers_online);
util.log("Servers Available: " + matchmakingStatsResponse.global_stats.servers_available);
util.log("Matches in Progress: " + matchmakingStatsResponse.global_stats.ongoing_matches);
console.log(JSON.stringify(matchmakingStatsResponse, null, 4));
CSGOCli.on("matchList", function(list) {
console.log("Match List");
if (list.matches && list.matches.length > 0) {
console.log(list.matches[0]);
}
});
var scDecoder = new csgo.SharecodeDecoder("CSGO-qdZYs-pEcib-CqwiO-kU3KG-CKxbE");
const decoded = scDecoder.decode();
setTimeout(function() {
console.log("Requesting game");
CSGOCli.requestGame(decoded.matchId, decoded.outcomeId, parseInt(decoded.tokenId));
}, 2500);
});
});
@joshuaferrara yep, with the parseInt()
it worked, thanks!
Sorry to reopen this, but does anything changed? Right now, I've got the same problem like lenovouser on the first time. Also parseInt() does not work.
Just getting
27 Jan 00:40:33 - CS:GO fromGC: 9139 27 Jan 00:40:33 - Received match list Match List { msgrequestid: 9147, accountid: 1277797466, servertime: 1643240433, matches: [], streams: [], tournamentinfo: null }
I am using this snippet for testing:
which always returns
Am I doing something wrong? The matches are always very recent (A few hours ago) - so they should definitely be returned? Or am I missing something?