Skip to content

Commit

Permalink
add fix for invalid warband stats
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastientromp committed Mar 25, 2022
1 parent 9c36295 commit ba94af2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 234 deletions.
9 changes: 4 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"elementtree": "^0.1.7",
"immutable": "3.8.2",
"jszip": "^3.7.1",
"lodash-es": "4.17.15",
"lodash-es": "^4.17.21",
"mysql": "^2.17.1",
"node-fetch": "^2.6.7",
"sax": "1.2.4",
Expand Down
5 changes: 4 additions & 1 deletion src/build-battlegrounds-hero-stats-new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ const buildWarbandStats = (
rows: readonly InternalBgsRow[],
): readonly { turn: number; dataPoints: number; totalStats: number }[] => {
const data: { [turn: string]: { dataPoints: number; totalStats: number } } = {};
for (const row of rows) {
// Before that, there was an issue with disconnects, where the first turn after the
// reconnect would be turn 0, leading to an inflation of early turn stats
const validRows = rows.filter(row => row.id > 5348374);
for (const row of validRows) {
if (!row.warbandStats?.length) {
continue;
}
Expand Down
227 changes: 0 additions & 227 deletions src/retrieve-bgs-global-stats.ts

This file was deleted.

0 comments on commit ba94af2

Please sign in to comment.