Skip to content

Commit

Permalink
chore: update rg-stats
Browse files Browse the repository at this point in the history
  • Loading branch information
Gyoo committed Aug 7, 2024
1 parent 38c9648 commit 9e2f426
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"react-router-bootstrap": "^0.25.0",
"react-router-dom": "5.1.2",
"react-select": "^5.6.1",
"rg-stats": "0.5.6",
"rg-stats": "0.5.8",
"sync-fetch": "^0.3.1",
"tachi-common": "workspace:../common",
"vite-plugin-html": "^3.2.0"
Expand All @@ -91,4 +91,4 @@
"node": "20",
"pnpm": "8"
}
}
}
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"prudence": "0.10.0",
"rate-limit-redis": "2.1.0",
"redis": "3.1.2",
"rg-stats": "0.5.6",
"rg-stats": "0.5.8",
"rimraf": "3.0.2",
"safe-json-stringify": "1.2.0",
"semver": "^7.3.7",
Expand Down Expand Up @@ -129,4 +129,4 @@
"node": "20",
"pnpm": "8"
}
}
}
5 changes: 3 additions & 2 deletions server/src/game-implementations/games/ddr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import db from "../../external/mongo/db";
import { IsNullish } from "../../utils/misc";
import { CreatePBMergeFor } from "../utils/pb-merge";
import { SessionAvgBest10For } from "../utils/session-calc";
import { DDRFlare } from "rg-stats";
import {
DDR_GBOUNDARIES,
FmtNum,
Expand Down Expand Up @@ -325,13 +326,13 @@ export const DDR_IMPL: GPTServerImplementation<"ddr:DP" | "ddr:SP"> = {
return 0;
}

const flareIndex = scoreData.optional.flare
const flareLevel = scoreData.optional.flare
? GetSpecificGPTConfig("ddr:SP").optionalMetrics.flare.values.indexOf(
scoreData.optional.flare
)
: 0;

return Math.floor((FLARE_0_POINTS[chart.levelNum - 1]! * (100 + flareIndex * 6)) / 100);
return DDRFlare.calculate(chart.levelNum, flareLevel);
},
},
scoreValidators: DDR_SCORE_VALIDATORS,
Expand Down

0 comments on commit 9e2f426

Please sign in to comment.