Skip to content

Commit

Permalink
Push some code from the box
Browse files Browse the repository at this point in the history
  • Loading branch information
mia-pi-git committed Oct 22, 2024
1 parent 1094b0a commit e597942
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,13 +390,10 @@ export const actions: {[k: string]: QueryHandler} = {
break;
}
}
const regtime = (await tables.users.get(rating.userid))?.registertime;
const ratingData = await ladder.getRating(rating.userid);
if (
// sanity check for reqs existing just to be totally safe
(reqsMet >= 1 && reqsMet === reqCount) &&
// regged after the test began
(regtime && regtime > suspects[formatid].startDate) &&
// did not play games before the test began
(ratingData?.first_played && ratingData.first_played > suspects[formatid].startDate)
) {
Expand Down Expand Up @@ -1054,7 +1051,7 @@ export const actions: {[k: string]: QueryHandler} = {
if (Config.suspectpath) {
await fs.writeFile(Config.suspectpath, JSON.stringify(suspects));
}
return true;
return {success: true};
},
async 'suspects/end'(params) {
if (this.getIp() !== Config.restartip) {
Expand All @@ -1067,7 +1064,7 @@ export const actions: {[k: string]: QueryHandler} = {
if (Config.suspectpath) {
await fs.writeFile(Config.suspectpath, JSON.stringify(suspects));
}
return true;
return {success: true};
},
};

Expand Down

0 comments on commit e597942

Please sign in to comment.