Bingo Guides

Bingo · Release 2.0.0

Website Integration Guide

This uses the same integration approach as the Death Swap and Fishing plugins: a versioned public JSON feed, optional authenticated HTTPS POST upload, a PHP receiver, and a plain JavaScript display widget. Bingo uses its own endpoint and data directory so it cannot overwrite the other games' leaderboards.

What is included

  • web/leaderboards.json, generated locally beneath plugins/Bingo when website.enabled is true.
  • website/receive.php: receiver for PHP 8.1+ hosting.
  • website/leaderboards.js: accessible table display using safe text insertion.
  • website/index.html and example-leaderboards.json: a clearly labeled sample page, not real results.

Leaderboard rules

Each of classic, blackout, timed, and lockout has wins, score, time, and solo arrays. A row contains rank, UUID, name, multiplayer wins, best multiplayer team score (0–25), fastest full win in milliseconds, solo finishes, and fastest full solo completion in milliseconds. Missing times use -1. The time board only gets real completed Classic/Blackout Bingo wins; timeout victories are not speed records. Solo results never count as multiplayer wins. Each teammate receives the team's score/result. Aborted matches are excluded. A tied completed match can still contribute a best score but no win.

The server exports up to website.top-players (default 100, maximum 250) for each ranking. Names and UUIDs are public leaderboard data; inventories, player recovery snapshots, locations, and upload credentials are never exported. Do not serve the whole plugins/Bingo directory publicly.

Event-driven updates

Bingo publishes at startup/reconfiguration and after saved statistics change, but compares public ranking content before sending. Unchanged public data creates no additional upload. Changes are coalesced by one background worker, so only the newest queued snapshot needs delivery. No network request blocks the game thread. Failures keep the local feed and retry the latest snapshot at website.retry-seconds (default 30). Console warnings omit secrets.

The public widget separately checks your website's JSON every 30 seconds and redraws only changed records. Server-to-website updates happen on changes; visitor browsers still need a way to retrieve changes. A quiet server's old last-change timestamp does not mean the connection is broken.

Host setup

  1. Put receive.php and leaderboards.js in a dedicated /bingo/ directory on your website. Give PHP permission to write files in this directory. It writes leaderboards.json atomically and keeps the last valid feed if a request fails.
  2. Have your host set BINGO_FEED_TOKEN to a unique random secret of 32–256 letters, digits, underscores, or hyphens. Keep it out of JavaScript, public HTML, URLs, and source control. Configure HTTPS. Some hosting configurations must explicitly pass the Authorization header to PHP; ask your host if valid requests receive 401 responses.
  3. In Bingo config.yml, set website.upload.enabled to true, website.upload.url to your HTTPS /bingo/receive.php endpoint, and website.upload.token to the exact same secret. No query strings, fragments, redirects, or credentials in the URL.
  4. With no arenas open, use /bingo reload, or restart. This sends the current feed even before another match finishes.
  5. Embed a board using the examples below. Use your real /bingo/leaderboards.json URL. The included example index.html deliberately points at sample data; change its data-feed-url values and remove the sample-data notice when deploying it for live results.
<section data-bingo-board="classic" data-sort="wins"
         data-feed-url="/bingo/leaderboards.json"></section>
<section data-bingo-board="blackout" data-sort="time"
         data-feed-url="/bingo/leaderboards.json"></section>
<section data-bingo-board="timed" data-sort="score"
         data-feed-url="/bingo/leaderboards.json"></section>
<section data-bingo-board="classic" data-sort="solo"
         data-feed-url="/bingo/leaderboards.json"></section>
<script src="/bingo/leaderboards.js" defer></script>

Display colors match the other games' examples: red headings, yellow column labels, white results on a dark background. Modify website CSS as needed.

Without PHP or without upload access yet

Keep upload.enabled false. Local export still works. Your host can sync only web/leaderboards.json to a public location with its existing secure transfer process. Point the widget at that JSON. No host access is required to prepare this package, but a host must install/configure the receiver before remote updates work. This release does not connect to or modify ChillVilleMC.com automatically.

Troubleshooting

A 401 indicates a token/header mismatch. A 503 indicates host configuration or write-permission failure. Check console warnings for connection errors and inspect the local JSON first. Never paste the private token into a screenshot or support chat. Website failure does not stop games or player recovery. One receiver directory is intended for one server; use separate endpoints for multiple servers.

Validation

Automated checks cover leaderboard ordering, solo separation, JSON fields, escaping, queue coalescing, local atomic writes, and authenticated HTTPS transport. The PHP receiver and the real hosting configuration still require deployment testing. See VALIDATION.md for the protected-JAR live server smoke tests and remaining acceptance work.

Support: https://www.chillvillemc.com/ | http://discord.chillvillemc.com