These moved from the Coffey-Labs org to jcoffey-dev, where they belong.
GitHub redirects a transferred repository, so nothing was broken by
leaving them -- but a source link that lands via a redirect is still
naming an owner that no longer holds the code, and the redirect only
lasts as long as nobody creates a repository of the same name in the
old place.
Only the seven repositories that actually moved are rewritten. Every
other Coffey-Labs URL is left alone: ihasmail, cairnobs and the rest
are still there.
The leaderboard started in this repository because when it was written there
was one game. It was already being treated as shared -- games.jcoffey.dev
calls it "the shared leaderboard" in its compose file and nginx proxies it at
a site-wide /api/ rather than under /lemonade/ -- but it was still this game's
code, and the second game would have meant a second container, a second volume
and a second database to back up for every game after that.
It lives in https://github.com/Coffey-Labs/games-scores now, which is its own
repository rather than either game's. A shared board belongs to no game, and
leaving it here would have made every future game depend on the lemonade stand
for its leaderboard.
What changes here is smaller than the diff suggests. server/ goes, and with it
scripts/dev-all.mjs and two package scripts. The client names the game on every
call and is otherwise untouched: rows still come back as assets, days, glasses
and broke, because the shared service hands each game its own field names back.
Nothing about the deployed board moves. The volume keeps its name, the rows are
migrated in place on first boot, and the original table is kept alongside as
scores_lemonade_v1 rather than dropped -- it is the only copy of a board real
people are on. Bundles already in browsers keep working too: a post with no
game at all is treated as this one, deliberately, until this build has been out
long enough that nobody is running the old one.
Build clean.
The high score table moves out of the browser and into a service, so
every player is on one board. It is a Node process with SQLite, no build
step and no native modules - node:sqlite ships with the runtime and Node
runs the TypeScript directly.
Everything in a request is treated as hostile: names forced to a
printable subset, every number range-checked, and scores refused if they
could not have happened in the days claimed. Bodies capped, submissions
rate limited per address. It still cannot prove a score is real, and
server/README.md says so plainly rather than implying otherwise.
The game degrades properly without it: the board says it cannot reach
town, posting happens behind the closing standings, and play is
untouched.
Deployment is three containers behind the host's nginx - the hub at /,
the game at /lemonade/, the scores service at /api/ - so the game keeps
its own container and a second game is just another service.
Licensing: AGPL-3.0-or-later, Affero because the leaderboard is a network
service. NOTICE.md credits Bob Jamison and Charlie Kellner, records that
this is clean-room work, and is honest about the one thing it is not:
some on-screen wording is quoted from the original and cannot be
licensed by us.
The street can now get better as well as worse. The summer fair brings
the town out and lifts what they will pay; a rival on the next corner
takes a share and lingers. Both show in the art and in the crowd. Over
500 seasons a player who reads the briefing survives every time and
finishes around $25.80; one who ignores it goes broke 70% of the time.
Two skins over one game. 1979 is the machine as it was; the remaster is
the same rules in cel-shaded vector art with a modern palette. The
simulation is untouched - only the paint differs - and the toggle sits
under the set.
The street is now driven by the game. Before prices are in, the number
of people walking on comes from the forecast; afterwards it comes from
the glasses that actually sold, so the report shows the crowd you
earned. A heat wave has them fanning themselves; a downpour leaves one
figure hurrying past under an umbrella.
Selling no longer snaps straight to the books. The stand trades for a
few seconds first, tally climbing and till filling, which is where that
crowd animation pays off. Skippable.
The synth grew a kit (pitched-sine kick, snare with body, hats), a
sweeping resonant lowpass for the bass, chords and a shuffle - enough
for a funk band. The chiptunes stay for the 1979 skin.
Boot is now a cassette load, which doubles as the gesture browsers
require before audio will play.
Fixes found on the way: the picture scaled about its centre while flex
auto-margins collapsed to zero on overflow, which pushed the report's
buttons off the bottom; and the validation line moved the button when
it appeared, so it is now reserved and faded. Sibling tabs in one
browser also keep their score tables in step.
The table was clearable behind a confirm. It should not be: a stand
earns its place and loses it only to a better summer, so the control
and clearScores() are gone and the screen says so.
Retiring writes each player's closing balance to a top-ten table in
localStorage, reachable from the title screen and the standings, with
the summer just finished picked out in yellow.
Stored rows are user-editable, so every field is validated on load and
malformed entries are dropped. Storage being unavailable is a normal
case, not an error: the game plays on with an empty table.
Also stops the status line claiming DAY 00 on screens that have no day.