diff options
| author | historia <[not public]> | 2026-09-18 21:36:36 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-18 21:36:36 -0400 |
| commit | a8a67482bbff8297a96adff65d2fd7029ed998cc (patch) | |
| tree | e84f8ba636c8f2edb4d2ff8b45d7cff7298fa7cc /internal/game/account_txn.go | |
| parent | ff04d26ce90d6b411a04a2fb59f7c24ceefb161f (diff) | |
| download | thehouseoficarus-a8a67482bbff8297a96adff65d2fd7029ed998cc.tar.gz | |
refactor: replace economy journal with single-file pending-wager wallet
Diffstat (limited to 'internal/game/account_txn.go')
| -rw-r--r-- | internal/game/account_txn.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/internal/game/account_txn.go b/internal/game/account_txn.go index 13f7695..6e1e2d1 100644 --- a/internal/game/account_txn.go +++ b/internal/game/account_txn.go @@ -48,10 +48,10 @@ func (g *Game) adoptCharacterIdentity(p *player.Player, accountName string) { p.Account = accountName } if err := g.AccountStore.SaveCharacter(p); err != nil { - // Identity backfill is best-effort, but a NON-DURABLE ID must never - // become an economy key: a later startup's backfill would assign a - // different ID and strand every journal record written under this - // one. Fall back to the durable character name instead. + // Identity backfill is best-effort, but a NON-DURABLE ID must not + // survive in memory: a later startup's backfill would assign a + // different one, and any reference cached under this ID would point + // at nothing. Fall back to the durable character name instead. if assignedID != "" { p.ID = "" } @@ -201,8 +201,9 @@ func (g *Game) renameCharacterTxn(accountName, oldName, newName string) error { } p.Name = newName if p.ID == "" { - // Assign the stable identity at rename time so journal records - // written after this point resolve the renamed character by ID. + // Assign the stable identity at rename time so cached references + // (and the owner/membership checks) resolve the renamed character + // by ID rather than the new filename. p.ID = newCharacterID() } data, err := g.AccountStore.MarshalCharacter(p) |
