Skip to content

Commit

Permalink
Suspects: Ensure no games were played before suspect start
Browse files Browse the repository at this point in the history
  • Loading branch information
mia-pi-git committed Oct 22, 2024
1 parent 1486ae1 commit ccea2db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,14 @@ export const actions: {[k: string]: QueryHandler} = {
}
}
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)
(regtime && regtime > suspects[formatid].startDate) &&
// did not play games before the test began
(ratingData?.first_played && ratingData.first_played > suspects[formatid].startDate)
) {
const data = JSON.stringify({
userid: rating.userid,
Expand Down

0 comments on commit ccea2db

Please sign in to comment.