Skip to content

Leaderboards: storage, endpoints and portal read (flag off by default) - #104

Merged
AlxcBTW merged 13 commits into
mainfrom
feat/leaderboards
Oct 28, 2026
Merged

AlxcBTW merged 13 commits into
mainfrom
feat/leaderboards

Conversation

@AlxcBTW

@AlxcBTW AlxcBTW commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Cloud side of network ADR 0041 (anyplaynet/network#133). Behind ANYPLAY_CLOUD_LEADERBOARDS_ENABLED, off by default: every score/board route answers forbidden, the portal reads not_found; the audience setting still works.

  • Migration 0033 (SQLite and Postgres): boards, scores, score_privacy.
  • leaderboards.rs: best-score entries, boards made by the first score (order/bounds/status are data a moderator sets), ranks counted among the entries the viewer may see (ties share a rank), top / around / friends views, one visibility rule (own, friend unless nobody, stranger only if everyone, blocks both ways, bans out).
  • /v1: PUT /me/scores/{title}/{board}, GET /boards/{title}/{board}[/around|/friends], GET /titles/{title}/boards, GET|PUT /me/score-privacy; moderators: configure a board, remove and restore an entry.
  • Portal: GET /web/api/v1/boards/{title}/{board} and /titles/{title}/boards, read-only, visitors see only everyone entries.
  • Anti-abuse: 60 submissions / account / 10 min, 64 boards per title, 16 boards made per account, 1000 scores per account, bounds per board (default 0..2^53-1), moderator removal that blocks resubmitting until restored.
  • Export includes scores and the audience; rows go with the account.
  • Tests: crates/cloud/tests/leaderboards.rs (17 tests: flag off, best score, order as data, tied ranks, audiences, no rank gap for hidden players, friends view, around window, blocks, bounds, closed board, removal/restore, moderator account, limits and rate limit, ban, title list, portal visitor vs member, export and deletion).
  • network.ref points at the network PR branch head until that PR is merged; I bump it to the merge commit before merging this.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@AlxcBTW
AlxcBTW merged commit 7032b65 into main Oct 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant