feat(masterpieces): daily limit, a day's wait, the same picture approved again

- accounts under a day old cannot paint for a frame: the easel's token is
  refused and a message box says how long is left
  (AJ_MASTERPIECE_MIN_AGE, 86400; the tests use 0).
- 10 new pictures an account in any 24 hours (config.masterpiecesPerDay),
  counted in the database (masterpiece_uploads) so a restart does not
  forget them; past it HQ says when the next one may go. a picture
  approved before is not a new one.
- a picture a moderator or the admin approved is approved again as it is
  framed, and the same picture waiting is approved with it, its makers
  told: the same file (SHA-256), or the same painting saved and painted
  again, which comes back as other bytes. lib/jpegprint.js reads every
  8x8 block's average from a baseline JPEG's DC coefficients (~2.6 ms for
  the Art Studio's 711x434); the same size with no block more than 2 of
  255 apart is the same picture (a saved .ajart painted again: 1).
- staff taking a painting back forgets its picture.
- paintings from before get their hash and fingerprint a few at a time
  after start; those a person approved make their pictures approved ones.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
BurrowdevandClaude Opus 5.5 committed 2026-10-20 16:21:20 +03:00
1 parent 096ceafea7
commit 0c3bfd97b3
7 files changed
+460 -36

No files matched your search

+5
View File
@@ -330,6 +330,11 @@ module.exports = {
// how often at most the packs with custom items in are made again after
// one changes (lib/defpacks.js clientPack); the tests use 0, made at once.
packRemakeMs: env.AJ_PACK_REMAKE_MS === undefined ? 15000 : Number(env.AJ_PACK_REMAKE_MS),
// masterpieces (lib/masterpieces.js): seconds an account must have had
// before it paints one (AJ_MASTERPIECE_MIN_AGE; the tests use 0), and new
// pictures an account may post in any 24 hours.
masterpieceMinAccountAge: env.AJ_MASTERPIECE_MIN_AGE === undefined ? 86400 : Number(env.AJ_MASTERPIECE_MIN_AGE),
masterpiecesPerDay: 10,
maxConnections: 2000,
maxHttpConnections: 2000, // open at once, in all
maxHttpConnectionsPerAddress: 40, // the game opens a good many at once while it loads