feat: add resilient server recovery and talent upgrades

This commit is contained in:
2026-10-03 15:09:31 +08:00
parent b3cd135331
commit b99b3f3451
70 changed files with 3664 additions and 419 deletions
+6 -1
View File
@@ -65,6 +65,10 @@ func loadCharacterEntries(store stateio.AtomicEntryStore, core []byte) (characte
}
func (s *CharacterStore) persist(next []Character) error {
return s.persistWithChanges(next, nil)
}
func (s *CharacterStore) persistWithChanges(next []Character, additional []stateio.EntryMutation) error {
if err := validateCharacters(next); err != nil {
return err
}
@@ -74,7 +78,8 @@ func (s *CharacterStore) persist(next []Character) error {
}
current := make(map[uint64]bool, len(next))
order := make([]uint64, 0, len(next))
changes := make([]stateio.EntryMutation, 0)
changes := make([]stateio.EntryMutation, 0, len(additional)+len(next))
changes = append(changes, additional...)
for _, character := range next {
index := character.InvenIndex
current[index] = true