diff options
Diffstat (limited to 'internal/player')
| -rw-r--r-- | internal/player/player.go | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/internal/player/player.go b/internal/player/player.go index efa906b..22ef04a 100644 --- a/internal/player/player.go +++ b/internal/player/player.go @@ -186,20 +186,13 @@ type Player struct { HP int `yaml:"hp"` Credits int `yaml:"credits"` BankedCredits int `yaml:"banked_credits"` - // OpenPayouts is durable evidence for the economy journal (see - // internal/game/economy.go): the IDs of journaled payout records whose - // amounts are ALREADY INCLUDED in this file's credit balance. Recovery - // uses membership to prove a payout became durable instead of guessing - // from balance checkpoints, which unrelated credit changes can fake. - OpenPayouts []string `yaml:"open_payouts,omitempty"` - // ResolvedStakes is durable evidence for the economy journal (see - // internal/game/economy.go): the IDs of outstanding wager records the - // session RESOLVED (won, lost, pushed, refunded) but whose settled - // markers could not be appended to the journal (e.g. a broken economy - // path). Recovery treats membership as proof the round resolved — the - // stake must not be refunded and its chip part must not return in kind - // on top of a settlement that already returned it as credits. - ResolvedStakes []string `yaml:"resolved_stakes,omitempty"` + // PendingWagers is the durable ledger of committed casino stakes whose + // round is still in flight. The character file is the only durable money + // record: the same atomic SaveCharacter that debits a stake appends it + // here, and the same save that settles or refunds the round removes it. + // If the process dies with an entry still listed, startup returns the + // stake (refund-on-lost-round). See PendingWager. + PendingWagers []PendingWager `yaml:"pending_wagers,omitempty"` Description string `yaml:"description"` AttackStyle AttackStyle `yaml:"attack_style"` Prompt string `yaml:"prompt"` @@ -249,6 +242,16 @@ type MapSymbolData struct { Color string `yaml:"color,omitempty"` } +// PendingWager is one committed casino stake whose round is still in flight. +// It is the entire durable representation of that obligation; there is no +// separate economy journal. Chips and Credits are exactly the amounts debited +// by the wager, so a startup refund returns them in kind (chips as chips). +type PendingWager struct { + ID string `yaml:"id"` + Chips int `yaml:"chips,omitempty"` + Credits int `yaml:"credits,omitempty"` +} + // PendingSequence is the persisted snapshot of an in-flight LOCKED trigger // sequence (Trigger.Lock == true). Unlocked sequences are never persisted. // On reconnect, the game rebuilds a sequence from this snapshot and resumes |
