Compare commits
1 Commits
master
...
renovate/p
Author | SHA1 | Date | |
---|---|---|---|
1ba79debb2 |
@ -17,5 +17,5 @@ jobs:
|
|||||||
- name: Push to dokku
|
- name: Push to dokku
|
||||||
uses: dokku/github-action@master
|
uses: dokku/github-action@master
|
||||||
with:
|
with:
|
||||||
git_remote_url: "ssh://dokku@10.0.50.65:22/scoresaber-reloadedv2"
|
git_remote_url: "ssh://dokku@10.0.3.39:22/scoresaber-reloadedv2"
|
||||||
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
|
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
48
pnpm-lock.yaml
generated
48
pnpm-lock.yaml
generated
@ -126,7 +126,7 @@ devDependencies:
|
|||||||
version: 1.0.10
|
version: 1.0.10
|
||||||
autoprefixer:
|
autoprefixer:
|
||||||
specifier: ^10.4.17
|
specifier: ^10.4.17
|
||||||
version: 10.4.17(postcss@8.4.33)
|
version: 10.4.17(postcss@8.4.38)
|
||||||
cross-env:
|
cross-env:
|
||||||
specifier: ^7.0.3
|
specifier: ^7.0.3
|
||||||
version: 7.0.3
|
version: 7.0.3
|
||||||
@ -138,7 +138,7 @@ devDependencies:
|
|||||||
version: 14.1.0(eslint@8.56.0)(typescript@5.3.3)
|
version: 14.1.0(eslint@8.56.0)(typescript@5.3.3)
|
||||||
postcss:
|
postcss:
|
||||||
specifier: ^8.4.33
|
specifier: ^8.4.33
|
||||||
version: 8.4.33
|
version: 8.4.38
|
||||||
prettier:
|
prettier:
|
||||||
specifier: ^3.2.4
|
specifier: ^3.2.4
|
||||||
version: 3.2.4
|
version: 3.2.4
|
||||||
@ -1611,7 +1611,7 @@ packages:
|
|||||||
resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
|
resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/autoprefixer@10.4.17(postcss@8.4.33):
|
/autoprefixer@10.4.17(postcss@8.4.38):
|
||||||
resolution: {integrity: sha512-/cpVNRLSfhOtcGflT13P2794gVSgmPgTR+erw5ifnMLZb0UnSlkK4tquLmkd3BhA+nLo5tX8Cu0upUsGKvKbmg==}
|
resolution: {integrity: sha512-/cpVNRLSfhOtcGflT13P2794gVSgmPgTR+erw5ifnMLZb0UnSlkK4tquLmkd3BhA+nLo5tX8Cu0upUsGKvKbmg==}
|
||||||
engines: {node: ^10 || ^12 || >=14}
|
engines: {node: ^10 || ^12 || >=14}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
@ -1623,7 +1623,7 @@ packages:
|
|||||||
fraction.js: 4.3.7
|
fraction.js: 4.3.7
|
||||||
normalize-range: 0.1.2
|
normalize-range: 0.1.2
|
||||||
picocolors: 1.0.0
|
picocolors: 1.0.0
|
||||||
postcss: 8.4.33
|
postcss: 8.4.38
|
||||||
postcss-value-parser: 4.2.0
|
postcss-value-parser: 4.2.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
@ -1837,7 +1837,7 @@ packages:
|
|||||||
dom-serializer: 2.0.0
|
dom-serializer: 2.0.0
|
||||||
domhandler: 5.0.3
|
domhandler: 5.0.3
|
||||||
htmlparser2: 8.0.2
|
htmlparser2: 8.0.2
|
||||||
postcss: 8.4.33
|
postcss: 8.4.38
|
||||||
pretty-bytes: 5.6.0
|
pretty-bytes: 5.6.0
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
@ -3471,27 +3471,27 @@ packages:
|
|||||||
resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==}
|
resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==}
|
||||||
engines: {node: '>= 6'}
|
engines: {node: '>= 6'}
|
||||||
|
|
||||||
/postcss-import@15.1.0(postcss@8.4.33):
|
/postcss-import@15.1.0(postcss@8.4.38):
|
||||||
resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==}
|
resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==}
|
||||||
engines: {node: '>=14.0.0'}
|
engines: {node: '>=14.0.0'}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
postcss: ^8.0.0
|
postcss: ^8.0.0
|
||||||
dependencies:
|
dependencies:
|
||||||
postcss: 8.4.33
|
postcss: 8.4.38
|
||||||
postcss-value-parser: 4.2.0
|
postcss-value-parser: 4.2.0
|
||||||
read-cache: 1.0.0
|
read-cache: 1.0.0
|
||||||
resolve: 1.22.8
|
resolve: 1.22.8
|
||||||
|
|
||||||
/postcss-js@4.0.1(postcss@8.4.33):
|
/postcss-js@4.0.1(postcss@8.4.38):
|
||||||
resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==}
|
resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==}
|
||||||
engines: {node: ^12 || ^14 || >= 16}
|
engines: {node: ^12 || ^14 || >= 16}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
postcss: ^8.4.21
|
postcss: ^8.4.21
|
||||||
dependencies:
|
dependencies:
|
||||||
camelcase-css: 2.0.1
|
camelcase-css: 2.0.1
|
||||||
postcss: 8.4.33
|
postcss: 8.4.38
|
||||||
|
|
||||||
/postcss-load-config@4.0.2(postcss@8.4.33):
|
/postcss-load-config@4.0.2(postcss@8.4.38):
|
||||||
resolution: {integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==}
|
resolution: {integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==}
|
||||||
engines: {node: '>= 14'}
|
engines: {node: '>= 14'}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@ -3504,16 +3504,16 @@ packages:
|
|||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
lilconfig: 3.0.0
|
lilconfig: 3.0.0
|
||||||
postcss: 8.4.33
|
postcss: 8.4.38
|
||||||
yaml: 2.3.4
|
yaml: 2.3.4
|
||||||
|
|
||||||
/postcss-nested@6.0.1(postcss@8.4.33):
|
/postcss-nested@6.0.1(postcss@8.4.38):
|
||||||
resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==}
|
resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==}
|
||||||
engines: {node: '>=12.0'}
|
engines: {node: '>=12.0'}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
postcss: ^8.2.14
|
postcss: ^8.2.14
|
||||||
dependencies:
|
dependencies:
|
||||||
postcss: 8.4.33
|
postcss: 8.4.38
|
||||||
postcss-selector-parser: 6.0.15
|
postcss-selector-parser: 6.0.15
|
||||||
|
|
||||||
/postcss-selector-parser@6.0.15:
|
/postcss-selector-parser@6.0.15:
|
||||||
@ -3532,16 +3532,16 @@ packages:
|
|||||||
dependencies:
|
dependencies:
|
||||||
nanoid: 3.3.7
|
nanoid: 3.3.7
|
||||||
picocolors: 1.0.0
|
picocolors: 1.0.0
|
||||||
source-map-js: 1.0.2
|
source-map-js: 1.2.0
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/postcss@8.4.33:
|
/postcss@8.4.38:
|
||||||
resolution: {integrity: sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==}
|
resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==}
|
||||||
engines: {node: ^10 || ^12 || >=14}
|
engines: {node: ^10 || ^12 || >=14}
|
||||||
dependencies:
|
dependencies:
|
||||||
nanoid: 3.3.7
|
nanoid: 3.3.7
|
||||||
picocolors: 1.0.0
|
picocolors: 1.0.0
|
||||||
source-map-js: 1.0.2
|
source-map-js: 1.2.0
|
||||||
|
|
||||||
/prelude-ls@1.2.1:
|
/prelude-ls@1.2.1:
|
||||||
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
|
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
|
||||||
@ -3946,8 +3946,8 @@ packages:
|
|||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/source-map-js@1.0.2:
|
/source-map-js@1.2.0:
|
||||||
resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==}
|
resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==}
|
||||||
engines: {node: '>=0.10.0'}
|
engines: {node: '>=0.10.0'}
|
||||||
|
|
||||||
/streamsearch@1.1.0:
|
/streamsearch@1.1.0:
|
||||||
@ -4105,11 +4105,11 @@ packages:
|
|||||||
normalize-path: 3.0.0
|
normalize-path: 3.0.0
|
||||||
object-hash: 3.0.0
|
object-hash: 3.0.0
|
||||||
picocolors: 1.0.0
|
picocolors: 1.0.0
|
||||||
postcss: 8.4.33
|
postcss: 8.4.38
|
||||||
postcss-import: 15.1.0(postcss@8.4.33)
|
postcss-import: 15.1.0(postcss@8.4.38)
|
||||||
postcss-js: 4.0.1(postcss@8.4.33)
|
postcss-js: 4.0.1(postcss@8.4.38)
|
||||||
postcss-load-config: 4.0.2(postcss@8.4.33)
|
postcss-load-config: 4.0.2(postcss@8.4.38)
|
||||||
postcss-nested: 6.0.1(postcss@8.4.33)
|
postcss-nested: 6.0.1(postcss@8.4.38)
|
||||||
postcss-selector-parser: 6.0.15
|
postcss-selector-parser: 6.0.15
|
||||||
resolve: 1.22.8
|
resolve: 1.22.8
|
||||||
sucrase: 3.35.0
|
sucrase: 3.35.0
|
||||||
|
@ -7,7 +7,7 @@ import { useScoresaberScoresStore } from "@/store/scoresaberScoresStore";
|
|||||||
export const WEIGHT_COEFFICIENT = 0.965;
|
export const WEIGHT_COEFFICIENT = 0.965;
|
||||||
|
|
||||||
const starMultiplier = 42.11;
|
const starMultiplier = 42.11;
|
||||||
const ppCurve: [number, number][] = [
|
const ppCurve = [
|
||||||
[1, 5.367394282890631],
|
[1, 5.367394282890631],
|
||||||
[0.9995, 5.019543595874787],
|
[0.9995, 5.019543595874787],
|
||||||
[0.999, 4.715470646416203],
|
[0.999, 4.715470646416203],
|
||||||
@ -63,53 +63,29 @@ function lerp(v0: number, v1: number, t: number) {
|
|||||||
return v0 + t * (v1 - v0);
|
return v0 + t * (v1 - v0);
|
||||||
}
|
}
|
||||||
|
|
||||||
function calculatePPModifier(
|
function calculatePPModifier(c1: Array<any>, c2: Array<any>, acc: number) {
|
||||||
c1: [number, number],
|
const distance = (c2[0] - acc) / (c2[0] - c1[0]);
|
||||||
c2: [number, number],
|
return lerp(c2[1], c1[1], distance);
|
||||||
acc: number,
|
|
||||||
): number {
|
|
||||||
const distance: number = (c2[0] - acc) / (c2[0] - c1[0]);
|
|
||||||
const interpolated: number = lerp(c2[1], c1[1], distance);
|
|
||||||
console.log(
|
|
||||||
`Acc: ${acc}, c1: ${c1}, c2: ${c2}, Distance: ${distance}, Interpolated: ${interpolated}`,
|
|
||||||
);
|
|
||||||
return interpolated;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function findPPModifier(
|
function findPPModifier(acc: number, curve: Array<any>) {
|
||||||
acc: number,
|
|
||||||
curve: [number, number][],
|
|
||||||
): number | undefined {
|
|
||||||
acc = clamp(acc, 0, 100) / 100;
|
acc = clamp(acc, 0, 100) / 100;
|
||||||
console.log("Clamped Accuracy:", acc);
|
|
||||||
|
|
||||||
let prev: [number, number] = curve[1];
|
let prev = curve[1];
|
||||||
for (const item of curve) {
|
for (const item of curve) {
|
||||||
console.log("Curve Point:", item[0], item[1]);
|
|
||||||
if (item[0] <= acc) {
|
if (item[0] <= acc) {
|
||||||
return calculatePPModifier(item, prev, acc);
|
return calculatePPModifier(item, prev, acc);
|
||||||
}
|
}
|
||||||
prev = item;
|
prev = item;
|
||||||
}
|
}
|
||||||
return undefined;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getScoreSaberPP(
|
export function getScoreSaberPP(acc: number, stars: number) {
|
||||||
acc: number,
|
const ppValue = stars * starMultiplier;
|
||||||
stars: number,
|
const modifier = findPPModifier(acc * 100, ppCurve);
|
||||||
): { pp: number | undefined } {
|
if (!modifier) return undefined;
|
||||||
console.log("Input Stars:", stars);
|
|
||||||
console.log("Input Accuracy:", acc);
|
|
||||||
|
|
||||||
const ppValue: number = stars * starMultiplier;
|
|
||||||
const modifier: number | undefined = findPPModifier(acc * 100, ppCurve);
|
|
||||||
console.log("Modifier:", modifier);
|
|
||||||
|
|
||||||
if (!modifier) return { pp: undefined };
|
|
||||||
|
|
||||||
const finalPP: number = modifier * ppValue;
|
|
||||||
console.log("Final PP:", finalPP);
|
|
||||||
|
|
||||||
|
const finalPP = modifier * ppValue;
|
||||||
return {
|
return {
|
||||||
pp: Number.isNaN(finalPP) ? undefined : finalPP,
|
pp: Number.isNaN(finalPP) ? undefined : finalPP,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user