Commit graph

58 commits

Author SHA1 Message Date
WiseDev
e43f3fc02c unwind panics instead of aborting the process
a panic in a session task now kills that connection, tokio catches it and the
accept loop carries on. with abort it took the whole server down.

the data table RwLock is std so it poisons on panic, and every lookup went
through expect(). one panic would have bricked every later table read, which is
worse than the abort was. it reads the inner value now, the table is read only
once installed.
2026-08-23 09:42:44 +03:00
WiseDev
ca8e41c2c5 roll chest loot from the csv instead of a fixed config
RandomSpells / DifferentSpells / RareChance / EpicChance / MinGold / MaxGold all
come off the chest row now, gold is scaled by the player's arena. magic chest is
30 cards over 8 cards with 1 epic and 6 rares, like the client says it is.

arena chest rows inherit everything through BaseChest, so Free_Arena1 reads Free.
2026-08-23 09:30:38 +03:00
WiseDev
573d70ff08 deck swapping and achievement claims
500 LogicSwapSpellsCommand does the real work, 520 and 521 are no-ops in this
build so they just decode. 535 puts its data reference BEFORE the base header,
unlike every other command.

collection only shrinks when a card moves into an empty deck slot, that is the
one case where the home checksum moves.
2026-08-23 09:24:30 +03:00
WiseDev
f218a45ed2 fix chest shop prices and gate the free chest
rounding is banded and the 5s band biases +3, so 22 goes to 25 not 20. numbers match the csv for arena 1 and 2.
free chest end timestamp needs migration 0002.
2026-08-23 09:02:49 +03:00
WiseDev
a2bf58a627 stop minting a new account on every login
if the client presents an id we don't know, create it under that id and bump the sequence past it.
also chest offers match through BaseChest, so one silver row covers every arena.
2026-08-23 08:54:43 +03:00
WiseDev
8a745d634c generate the daily card shop server side
prices come from the csv globals now, a json cost is just an override.
DATABASE_URL defaults to postgres:///scroll when unset.
2026-08-23 08:47:55 +03:00
WiseDev
ad5a1613e3 move players and accounts into postgres
json stores are gone, they nulled out every data ref on load and wrote the null straight back on save.
shop json and the purchase commands ended up in here too.
2026-08-23 08:40:13 +03:00
WiseDev
d25a6de423 move all crates into crates/, glob members
pure move, no code touched. readme and protocol.md paths fixed up.
2026-08-23 08:15:45 +03:00