vjudge: add VERDICT.WAITING

This commit is contained in:
undefined committed 2023-04-11 22:51:26 +08:00
1 parent 41a20bddbe
commit 7af3083c56
2 files changed
+7 -6

No files matched your search

+4 -4
View File
@@ -168,12 +168,12 @@ export class HUSTOJ extends BasicFetcher implements IBasicProvider {
// if (res.text.includes(this.config.submit.tooFrequent)) throw new TooFrequentError(); // if (res.text.includes(this.config.submit.tooFrequent)) throw new TooFrequentError();
console.log(res.text); console.log(res.text);
if (this.config.submit.noRefetch) { if (this.config.submit.noRefetch) {
return this.config.submit.rid.exec(res.text)[1]; return res.text.match(this.config.submit.rid)[0].split('=')[1];
} }
const url = this.config.monit.endpoint.replace('{uid}', this.state.username).replace('{pid}', id); const url = this.config.monit.endpoint.replace('{uid}', this.state.username).replace('{pid}', id);
this.state.pid = id; this.state.pid = id;
const r = await this.get(url); const r = await this.get(url);
return this.config.submit.rid.exec(r.text)[1]; return r.text.match(this.config.submit.rid)[0].split('=')[1];
} }
async waitForSubmission(rid, next, end) { async waitForSubmission(rid, next, end) {
@@ -381,7 +381,7 @@ export class YBTBAS extends YBT {
codeField: 'source', codeField: 'source',
extra: { submit: '提交', user_id: this.account.handle }, extra: { submit: '提交', user_id: this.account.handle },
tooFrequent: '提交频繁啦!', tooFrequent: '提交频繁啦!',
rid: /runidx=([0-9]+)/gmi, rid: /runidx=([0-9]+)/mi,
noRefetch: true, noRefetch: true,
}; };
this.config.ceInfo = { this.config.ceInfo = {
@@ -402,7 +402,7 @@ export class BZOJ extends HUSTOJ {
}; };
this.config.submit.tooFrequent = 'You should not submit more than twice in 10 seconds.....'; this.config.submit.tooFrequent = 'You should not submit more than twice in 10 seconds.....';
this.config.submit.rid = /Submit_Time<\/td><\/tr>\n<tr align="center" class="evenrow"><td>([0-9]+)/igm; this.config.submit.rid = /Submit_Time<\/td><\/tr>\n<tr align="center" class="evenrow"><td>([0-9]+)/igm;
this.config.ceInfo.matcher = /<pre>([\s\S]*?)<\/pre>/igm; this.config.ceInfo.matcher = /<pre>([\s\S]*?)<\/pre>/im;
} }
} }
+3 -2
View File
@@ -40,6 +40,7 @@ export const VERDICT = new Proxy<Record<string, STATUS>>({
SUBMIT_FAILED_TEMP: STATUS.STATUS_SYSTEM_ERROR, SUBMIT_FAILED_TEMP: STATUS.STATUS_SYSTEM_ERROR,
// HustOJ // HustOJ
WAITING: STATUS.STATUS_WAITING,
等待: STATUS.STATUS_WAITING, 等待: STATUS.STATUS_WAITING,
运行并评判: STATUS.STATUS_JUDGING, 运行并评判: STATUS.STATUS_JUDGING,
正在评测中: STATUS.STATUS_JUDGING, 正在评测中: STATUS.STATUS_JUDGING,
@@ -66,8 +67,8 @@ export const VERDICT = new Proxy<Record<string, STATUS>>({
get(self, key) { get(self, key) {
if (typeof key === 'symbol') return null; if (typeof key === 'symbol') return null;
key = normalize(key); key = normalize(key);
if (STATUS[key]) return STATUS[key]; if (typeof STATUS[key] === 'number') return STATUS[key];
if (self[key]) return self[key]; if (typeof self[key] === 'number') return self[key];
return null; return null;
}, },
}); });