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:
+8
-1
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user