From 8c65f89e55c3ccfc05dd22a03e5238ea0130717d Mon Sep 17 00:00:00 2001 From: undefined Date: Mon, 9 Nov 2020 13:13:03 +0800 Subject: [PATCH] =?UTF-8?q?judge:=20=E4=BC=98=E5=8C=96=E6=89=BE=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E6=95=B0=E6=8D=AE=E6=97=B6=E7=9A=84=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- packages/hydrojudge/package.json | 4 ++-- packages/hydrojudge/src/service.ts | 2 +- packages/hydrooj/package.json | 4 ++-- packages/hydrooj/src/model/contest.ts | 7 ++----- packages/login-with-qq/package.json | 2 +- 6 files changed, 9 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 5b0d49069..8206ca910 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "latest-version": "^5.1.0", "ora": "^5.1.0", "semver": "^7.3.2", - "ts-jest": "^26.4.3", + "ts-jest": "^26.4.4", "typescript": "^4.0.5" }, "dependencies": { diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index cd1cd7d5a..d659585e3 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -1,7 +1,7 @@ { "name": "@hydrooj/hydrojudge", "bin": "bin/hydrojudge.js", - "version": "2.1.20", + "version": "2.1.21", "main": "package.json", "author": "masnn", "repository": "https://github.com/hydro-dev/Hydro.git", @@ -15,7 +15,7 @@ "p-queue": "^6.6.1", "shell-quote": "^1.7.2", "supports-color": "^7.2.0", - "systeminformation": "^4.28.1", + "systeminformation": "^4.29.1", "yargs": "^16.1.0" }, "peerDependencies": { diff --git a/packages/hydrojudge/src/service.ts b/packages/hydrojudge/src/service.ts index 0cacac048..ba3b5da5d 100644 --- a/packages/hydrojudge/src/service.ts +++ b/packages/hydrojudge/src/service.ts @@ -208,7 +208,7 @@ async function postInit() { this.domainId = this.request.domainId; this.lang = this.request.lang; this.code = this.request.code; - this.data = this.request.data.toString(); + this.data = (this.request.data || '').toString(); this.config = this.request.config; this.next = getNext(this); this.end = getEnd(this.domainId, this.rid); diff --git a/packages/hydrooj/package.json b/packages/hydrooj/package.json index 6387fe7ed..0ef645225 100644 --- a/packages/hydrooj/package.json +++ b/packages/hydrooj/package.json @@ -1,6 +1,6 @@ { "name": "hydrooj", - "version": "2.13.46", + "version": "2.13.47", "bin": "bin/hydrooj.js", "main": "dist/loader.js", "typings": "dist/loader.d.ts", @@ -31,7 +31,7 @@ "sockjs": "^0.3.20", "superagent": "^6.1.0", "supports-color": "^7.2.0", - "systeminformation": "^4.28.1", + "systeminformation": "^4.29.1", "yargs": "^16.0.3" }, "devDependencies": { diff --git a/packages/hydrooj/src/model/contest.ts b/packages/hydrooj/src/model/contest.ts index 03810beca..b7d0b1e63 100644 --- a/packages/hydrooj/src/model/contest.ts +++ b/packages/hydrooj/src/model/contest.ts @@ -149,12 +149,9 @@ const oi: ContestRule = { const detail = {}; let score = 0; for (const j of journal) { - if (tdoc.pids.includes(j.pid)) { - detail[j.pid] = j; - if (detail[j.pid]) score -= detail[j.pid].score; - score += j.score; - } + if (tdoc.pids.includes(j.pid)) detail[j.pid] = j; } + for (const i in detail) score += detail[i].score; return { score, detail }; }, showScoreboard: (tdoc, now) => now > tdoc.endAt, diff --git a/packages/login-with-qq/package.json b/packages/login-with-qq/package.json index 1e3dbaddb..ea9836f27 100644 --- a/packages/login-with-qq/package.json +++ b/packages/login-with-qq/package.json @@ -13,7 +13,7 @@ "hydrooj": "^2.13.1" }, "dependencies": { - "ws": "^7.3.1" + "ws": "^7.4.0" }, "devDependencies": { "@types/ws": "^7.2.9"