fix: lower accuracy requirement for accounts that have opted out of the leaderboards

actually closes #5858
This commit is contained in:
Miodec 2024-09-10 23:10:02 +02:00
parent c7b3e2c916
commit 3478c21aa9
2 changed files with 5 additions and 1 deletions

View file

@ -200,6 +200,10 @@ export async function addResult(
throw new MonkeyError(status.code, status.message);
}
if (user.lbOptOut !== true && completedEvent.acc < 75) {
throw new MonkeyError(400, "Accuracy too low");
}
const resulthash = completedEvent.hash;
if (req.ctx.configuration.results.objectHashCheckEnabled) {
const objectToHash = omit(completedEvent, "hash");

View file

@ -53,7 +53,7 @@ const ResultBaseSchema = z.object({
wpm: WpmSchema,
rawWpm: WpmSchema,
charStats: CharStatsSchema,
acc: PercentageSchema.min(75),
acc: PercentageSchema.min(50),
mode: ModeSchema,
mode2: Mode2Schema,
quoteLength: z.number().int().nonnegative().max(3).optional(),