Files
bd2/go/internal/server/stateio/entry_snapshot.go
T
Flechazo d04791dd31 feat(server): add colored logs, level rewards, hunting dispatch and fiend hunt
Persist claims, AP, teams and presets with session receipts and atomic request rollback. Read rewards and growth from GameData; replace fixed Fiend Hunt user state and preserve the account initialization contract.
2026-10-04 21:27:19 +08:00

18 lines
619 B
Go

package stateio
// EntrySnapshotStore keeps optional gameplay snapshots within an existing
// account domain. It participates in the parent's SQLite request transaction
// without adding cores to the nine-domain account initialization contract.
type EntrySnapshotStore struct {
Entries EntryStore
Domain, Bucket string
}
func (s EntrySnapshotStore) Load(name string) ([]byte, error) {
payload, _, err := s.Entries.LoadEntry(s.Domain, s.Bucket, name)
return payload, err
}
func (s EntrySnapshotStore) Save(name string, payload []byte) error {
return s.Entries.PutEntry(s.Domain, s.Bucket, name, payload)
}