Say plainly that there is no player limit, and stop one classroom hitting it

The README heading read 'Two people, two browsers', which sounds like a
cap. It is not one: the server holds no game state at all, so any number
of people play independent games and the server only ever sees a
finished score. The only real cap is four to a game, and that is a
keyboard sharing the same stand rather than anything technical.

Checking that turned up a case where it would not have been true. A
classroom, an office or a household all arrive from one address, and the
submission limit of thirty an hour was low enough that a class finishing
together would have started losing scores to a 429. Raised to 120 and
verified with a burst of 130: the first 120 land, the rest are refused.
What actually keeps rubbish off the board is the plausibility check, not
this limit.
This commit is contained in:
2026-09-08 17:58:40 -07:00
parent f2e084ef7a
commit 87474ad5ec
3 changed files with 28 additions and 10 deletions
+8 -1
View File
@@ -53,7 +53,14 @@ interface Bucket {
}
const posts = new Map<string, Bucket>()
const POST_WINDOW_MS = 60 * 60 * 1000
const POST_LIMIT = 30
/*
* Per address, per hour. Generous on purpose: a classroom, an office or a
* household all arrive from one address, and thirty was low enough that a
* class finishing a season together would have started losing scores to a
* 429. What actually keeps rubbish off the board is the plausibility check
* in validate.ts, not this - this only stops the database being hammered.
*/
const POST_LIMIT = 120
function overPostLimit(ip: string): boolean {
const now = Date.now()