-
-
Notifications
You must be signed in to change notification settings - Fork 55
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error on count rounds and player stats #135
Comments
Demo files are very often missing events. You have to interpolate them in some way. There is nothing this library can do to fix this. The same happens with demoinfo and c# demoinfo. |
If this also happens with demoinfo, unfortunately there's nothing we can do here. |
@basmoura I don't think they are missing events, just that the score updates after the next round, which means a GOTV pro game is often closed before the new score have updated, take a look at this screenshot where I thought that I was missing the last round too.
|
Instead of incrementing round count on round end, why not do it on round start (and start at 0)? Then you can treat the demo ending as end of the final round |
Do you have idea for fix? (final score 16:0) Code let roundNumber = 1;
demoFile.gameEvents.on("round_start", e => {
roundNumber += 1;
const teams = demoFile.teams;
const terrorists = teams[2];
const cts = teams[3];
const rounds = terrorists.score + cts.score
const tr_score = terrorists.score
const ct_score = cts.score
console.log(`ROUND NUMBER: ${rounds}`)
console.log(`CT : ${ct_score} vs T : ${tr_score}`);
console.log('\n');
}); Output
|
See my previous comment - you're not treating the demo ending as the end of the final round |
What should I put instead of |
Something like: let roundNumber = 1;
function logScores() {
const teams = demoFile.teams;
const terrorists = teams[2];
const cts = teams[3];
const rounds = terrorists.score + cts.score;
const tr_score = terrorists.score;
const ct_score = cts.score;
console.log(`ROUND NUMBER: ${rounds}`);
console.log(`CT : ${ct_score} vs T : ${tr_score}`);
console.log("\n");
}
demoFile.gameEvents.on("round_start", (e) => {
roundNumber += 1;
logScores();
});
demoFile.on("end", (e) => {
if (e.error) {
console.error("Error during parsing:", e.error);
} else {
logScores();
}
console.log("Finished.");
}); |
Genius thanks it's work :) |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Describe the bug
When I get the player stats like Kills, Deaths, Assists, and MPVs, some data differs from the game's scoreboard. The same happens with the rounds. My last demos, for example, the final result is 15x11 instead of 16x11.
Code to reproduce
Expected behaviour
The results for score should be 16x11 instead of 15x11 and the player stats differs from scoreboard
The text was updated successfully, but these errors were encountered: