Merge pull request #462 from TNG-dev/zkldi/issue-449-Update-USC-IR-version

This commit is contained in:
zkldi
2021-11-23 07:47:45 +00:00
committed by GitHub
5 changed files with 8 additions and 1 deletions
@@ -1,6 +1,6 @@
import db from "external/mongo/db";
import { KtLogger } from "lib/logger/logger";
import { ScoreImportJob, ScoreImportProgress } from "lib/score-import/worker/types";
import { ScoreImportJob } from "lib/score-import/worker/types";
import {
Game,
IDStrings,
@@ -122,6 +122,7 @@ export const ConverterIRUSC: ConverterFunction<USCClientScore, IRUSCContext> = a
gauge: data.gauge,
fast: data.early,
slow: data.late,
maxCombo: data.combo,
},
},
scoreMeta: {
@@ -16,6 +16,7 @@ const PR_USCIRScore: PrudenceSchema = {
error: p.isPositiveInteger,
early: p.optional(p.isPositiveInteger),
late: p.optional(p.isPositiveInteger),
combo: p.optional(p.isPositiveInteger),
options: {
gaugeType: p.isIn(0, 1),
mirror: "boolean",
@@ -51,8 +52,11 @@ export function ParseIRUSC(
const score = body.score as USCClientScore;
// Enforce null for this instead of undefined.
// This is because FJSH cannot handle undefined properly.
// Maybe fjsh should handle that, lol...
score.early ??= null;
score.late ??= null;
score.combo ??= null;
return {
context: {
@@ -22,6 +22,7 @@ export interface USCClientScore {
error: integer;
early: integer | null;
late: integer | null;
combo: integer | null;
options: {
gaugeType: 0 | 1;
gaugeOpt: integer;
+1
View File
@@ -228,6 +228,7 @@ export const uscScore: USCClientScore = {
gauge: 0.8,
early: 50,
late: 20,
combo: 5,
options: {
autoFlags: 0,
gaugeOpt: 0,