diff --git a/server/src/lib/score-import/import-types/ir/beatoraja/parser.ts b/server/src/lib/score-import/import-types/ir/beatoraja/parser.ts index 4e786f50d..2729c3de3 100644 --- a/server/src/lib/score-import/import-types/ir/beatoraja/parser.ts +++ b/server/src/lib/score-import/import-types/ir/beatoraja/parser.ts @@ -126,18 +126,17 @@ export function ParseBeatorajaSingle( const score = body.score as BeatorajaScore; const chart = body.chart as BeatorajaChart; - if (chart.mode === "BEAT_14K" || chart.mode === "BEAT_7K") { - if (!SUPPORTED_BMS_CLIENTS.includes(client)) { - throw new ScoreImportFatalError(400, `Unsupported BMS client ${client}`); - } - } else if (chart.mode === "POPN_9K") { - if (!SUPPORTED_PMS_CLIENTS.includes(client)) { - throw new ScoreImportFatalError(400, `Unsupported PMS client ${client}`); - } - } - const isPMS = chart.mode === "POPN_9K"; + const expectedClient = isPMS ? "beatoraja" : "LR2oraja"; + + if (!client.startsWith(expectedClient)) { + throw new ScoreImportFatalError( + 400, + `Unsupported client ${client} -- Expected a variant of ${expectedClient}.` + ); + } + return { context: { client: isPMS ? "beatoraja" : "lr2oraja", diff --git a/server/src/server/router/ir/beatoraja/router.test.ts b/server/src/server/router/ir/beatoraja/router.test.ts index 2254cec43..58d3dfe0b 100644 --- a/server/src/server/router/ir/beatoraja/router.test.ts +++ b/server/src/server/router/ir/beatoraja/router.test.ts @@ -150,7 +150,7 @@ t.test("POST /ir/beatoraja/submit-score", (t) => { t.equal(res.status, 400); t.equal(res.body.success, false); - t.match(res.body.description, /Unsupported BMS client/u); + t.match(res.body.description, /Unsupported client/u); t.end(); }); @@ -165,7 +165,7 @@ t.test("POST /ir/beatoraja/submit-score", (t) => { t.equal(res.status, 400); t.equal(res.body.success, false); - t.match(res.body.description, /Unsupported BMS client/u); + t.match(res.body.description, /Unsupported client/u); t.end(); }); @@ -180,7 +180,7 @@ t.test("POST /ir/beatoraja/submit-score", (t) => { t.equal(res.status, 400); t.equal(res.body.success, false); - t.match(res.body.description, /Unsupported PMS client/u); + t.match(res.body.description, /Unsupported client/u); t.end(); });