From 7ae220886964cae537df5dfd5c30747cfa081b11 Mon Sep 17 00:00:00 2001 From: zkldi Date: Thu, 2 Sep 2021 16:58:38 +0100 Subject: [PATCH] Add style_2p and some warning messages --- .../lib/score-import/import-types/ir/fervidex/parser.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server/src/lib/score-import/import-types/ir/fervidex/parser.ts b/server/src/lib/score-import/import-types/ir/fervidex/parser.ts index 9d4aac5b4..6fa1b2fcf 100644 --- a/server/src/lib/score-import/import-types/ir/fervidex/parser.ts +++ b/server/src/lib/score-import/import-types/ir/fervidex/parser.ts @@ -47,6 +47,7 @@ const PR_Fervidex: PrudenceSchema = { p.isIn("SUDDEN_PLUS", "HIDDEN_PLUS", "SUD_PLUS_HID_PLUS", "LIFT", "LIFT_SUD_PLUS") ), style: optNull(p.isIn("RANDOM", "R_RANDOM", "S_RANDOM", "MIRROR")), + style_2p: optNull(p.isIn("RANDOM", "R_RANDOM", "S_RANDOM", "MIRROR")), assist: optNull(p.isIn("AUTO_SCRATCH", "LEGACY_NOTE", "ASCR_LEGACY", "FULL_ASSIST")), }, @@ -65,7 +66,7 @@ const PR_Fervidex: PrudenceSchema = { * Converts a string of the form LDJ:X:X:X:2020092900 into a game version. * I don't really understand the software model format, so this is lazy. */ -export function SoftwareIDToVersion(model: string) { +export function SoftwareIDToVersion(model: string, logger: KtLogger) { try { const data = ParseEA3SoftID(model); @@ -85,9 +86,11 @@ export function SoftwareIDToVersion(model: string) { } } + logger.warn(`Unsupported Software Model ${model}.`); throw new ScoreImportFatalError(400, `Unsupported Software Model ${model}.`); } catch (err) { - throw new ScoreImportFatalError(400, `Unsupported Software Model ${model}`); + logger.warn(`Unsupported Software Model ${model}.`, { err }); + throw new ScoreImportFatalError(400, `Unsupported Software Model ${model}.`); } } @@ -100,7 +103,7 @@ export function ParseFervidexSingle( headers: FerHeaders, logger: KtLogger ): ParserFunctionReturns { - const version = SoftwareIDToVersion(headers.model); + const version = SoftwareIDToVersion(headers.model, logger); // more mods may be added in the future, so lets ignore excess keys. const err = p(body, PR_Fervidex, undefined, { allowExcessKeys: true });