mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: set spj return status whitelist
This commit is contained in:
1 parent
671d8077b3
commit
7faf8ca30c
2 files changed
+13
-4
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/hydrojudge",
|
"name": "@hydrooj/hydrojudge",
|
||||||
"bin": "bin/hydrojudge.js",
|
"bin": "bin/hydrojudge.js",
|
||||||
"version": "2.14.5",
|
"version": "2.14.6",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
@@ -35,12 +35,21 @@ export function parse(output: string, fullscore: number) {
|
|||||||
}
|
}
|
||||||
while (operation.test(message)) {
|
while (operation.test(message)) {
|
||||||
const [, op, val, rest] = message.match(operation);
|
const [, op, val, rest] = message.match(operation);
|
||||||
|
message = rest;
|
||||||
if (op === 'status') {
|
if (op === 'status') {
|
||||||
status = +val;
|
const s = +val;
|
||||||
message = rest;
|
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') {
|
} else if (op === 'score') {
|
||||||
score = +val;
|
score = +val;
|
||||||
message = rest;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return { status, score, message: builder(message) };
|
return { status, score, message: builder(message) };
|
||||||
|
|||||||
Reference in new issue
Block a user