judge: set spj return status whitelist

This commit is contained in:
undefined committed 2022-03-11 13:40:51 +08:00
1 parent 671d8077b3
commit 7faf8ca30c
2 files changed
+13 -4

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "2.14.5",
"version": "2.14.6",
"main": "package.json",
"author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git",
+12 -3
View File
@@ -35,12 +35,21 @@ export function parse(output: string, fullscore: number) {
}
while (operation.test(message)) {
const [, op, val, rest] = message.match(operation);
message = rest;
if (op === 'status') {
status = +val;
message = rest;
const s = +val;
if ([
STATUS.STATUS_ACCEPTED,
STATUS.STATUS_WRONG_ANSWER,
STATUS.STATUS_COMPILE_ERROR,
STATUS.STATUS_RUNTIME_ERROR,
STATUS.STATUS_MEMORY_LIMIT_EXCEEDED,
STATUS.STATUS_TIME_LIMIT_EXCEEDED,
STATUS.STATUS_OUTPUT_LIMIT_EXCEEDED,
STATUS.STATUS_FORMAT_ERROR,
].includes(s)) status = +val;
} else if (op === 'score') {
score = +val;
message = rest;
}
}
return { status, score, message: builder(message) };