Make one expedition at a time a fixed rule so older stored settings cannot raise it

The limit was a setting whose default had moved to one, but settings saved before still allowed two expeditions per player. It is now a game rule: the setting and its admin field are gone, an old stored value has no effect, and the refusal tells the player to claim their current expedition first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Shinuwa 2026-11-17 18:55:29 +01:00
parent 3720fd01f7
commit a38d4fd02a
7 changed files with 19 additions and 16 deletions

View file

@ -149,7 +149,7 @@ test("players receive a starter destination card, then find more on expeditions
test("an expedition launched alone is a solo: one card, its result hidden until it returns, paid once", () => {
const { clock, service, player, open, rares, database } = expeditionService();
open({ group: { ...DEFAULT_GROUP, maxConcurrent: 1 } });
open();
const view = service.expeditions.getExpeditions(player.id);
// Une difficulté envoyée par un ancien client est ignorée : les étoiles sont celles de la destination.
const body = soloBody(view, rares[0], { difficulty: 4, durationHours: 6 });
@ -215,8 +215,11 @@ test("an expedition launched alone is a solo: one card, its result hidden until
// Parcours du joueur : la carte de destination offerte se présente une fois ; « Partir seul maintenant » ouvre et lance l'expédition
// d'un coup, sans alerte d'ouverture ; une seule expédition à la fois ; une fois le butin récupéré, elle passe au Journal.
test("a player sees the offered destination card once, leaves alone at once, one expedition at a time, then finds it in the Journal", () => {
const { clock, service, player, open, rares } = expeditionService({ allDestinations: false });
const { clock, service, player, open, rares, database } = expeditionService({ allDestinations: false });
open();
// Une ancienne limite enregistrée dans les réglages (avant qu'elle devienne une règle fixe) n'a plus d'effet.
const stored = JSON.parse(database.db.prepare("SELECT settings_json FROM expedition_settings").get().settings_json);
database.db.prepare("UPDATE expedition_settings SET settings_json = ?").run(JSON.stringify({ ...stored, group: { ...stored.group, maxConcurrent: 3 } }));
const first = service.expeditions.getExpeditions(player.id);
assert.equal(first.starterCard, "light-currents-standard");
assert.equal(service.expeditions.getExpeditions(player.id).starterCard, "light-currents-standard");