diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index 85644af3a..461d0eb3a 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -1,7 +1,7 @@ { "name": "@hydrooj/hydrojudge", "bin": "bin/hydrojudge.js", - "version": "2.8.6", + "version": "2.8.7", "main": "package.json", "author": "undefined ", "repository": "https://github.com/hydro-dev/Hydro.git", diff --git a/packages/hydrojudge/src/judge/interactive.ts b/packages/hydrojudge/src/judge/interactive.ts index 0d9aa3fec..770be327a 100644 --- a/packages/hydrojudge/src/judge/interactive.ts +++ b/packages/hydrojudge/src/judge/interactive.ts @@ -41,7 +41,7 @@ function judgeCase(c) { status = STATUS.STATUS_TIME_LIMIT_EXCEEDED; } else if (memory_usage_kb > ctxSubtask.subtask.memory * 1024) { status = STATUS.STATUS_MEMORY_LIMIT_EXCEEDED; - } else if (code !== 13/* Broken Pipe */ || (code === 13 && !resInteractor.code)) { + } else if ((code && code !== 13/* Broken Pipe */) || (code === 13 && !resInteractor.code)) { status = STATUS.STATUS_RUNTIME_ERROR; if (code < 32) message = signals[code]; else message = { message: 'Your program returned {0}.', params: [code] }; @@ -50,7 +50,7 @@ function judgeCase(c) { status = result.status; score = result.score; message = result.message; - if (resInteractor.code) message += ` (Interactor exited with code ${resInteractor.code})`; + if (resInteractor.code && resInteractor.code !== 1) message += ` (Interactor exited with code ${resInteractor.code})`; } ctxSubtask.score = Score[ctxSubtask.subtask.type](ctxSubtask.score, score); ctxSubtask.status = Math.max(ctxSubtask.status, status); diff --git a/packages/hydrojudge/src/sandbox.ts b/packages/hydrojudge/src/sandbox.ts index 4d1c57950..fe8d7f7d7 100644 --- a/packages/hydrojudge/src/sandbox.ts +++ b/packages/hydrojudge/src/sandbox.ts @@ -95,9 +95,9 @@ export async function runMultiple(execute) { body.cmd[1].files[0] = null; body.cmd[1].files[1] = null; const id = callId++; - if (argv.options['show-sandbox-call']) logger.debug('%d %s', id, JSON.stringify(body)); + if (argv.options.showSandbox) logger.debug('%d %s', id, JSON.stringify(body)); res = await Axios.create({ baseURL: getConfig('sandbox_host') }).post('/run', body); - if (argv.options['show-sandbox-call']) logger.debug('%d %s', id, JSON.stringify(res.data)); + if (argv.options.showSandbox) logger.debug('%d %s', id, JSON.stringify(res.data)); } catch (e) { if (e instanceof FormatError) throw e; throw new SystemError('Sandbox Error'); @@ -123,9 +123,9 @@ export async function run(execute, params?) { } const body = { cmd: [proc({ execute, ...params })] }; const id = callId++; - if (argv.options['show-sandbox-call']) logger.debug('%d %s', id, JSON.stringify(body)); + if (argv.options.showSandbox) logger.debug('%d %s', id, JSON.stringify(body)); const res = await Axios.create({ baseURL: getConfig('sandbox_host') }).post('/run', body); - if (argv.options['show-sandbox-call']) logger.debug('%d %s', id, JSON.stringify(res.data)); + if (argv.options.showSandbox) logger.debug('%d %s', id, JSON.stringify(res.data)); [result] = res.data; } catch (e) { if (e instanceof FormatError) throw e;