fix(server): lock server starting chapter on first initialization

This commit is contained in:
2026-10-04 16:25:29 +08:00
parent 78750f2e12
commit fe7344582f
7 changed files with 221 additions and 8 deletions
+3
View File
@@ -35,6 +35,9 @@ func (s *Service) ConfigureStartPack(packID int, initialize bool) error {
}
}
entry := s.state.StartPackID()
if entry != packID {
return fmt.Errorf("world: account starting chapter %d differs from locked server chapter %d", entry, packID)
}
if _, ok := s.storyCatalog.Packs[entry]; !ok {
return fmt.Errorf("world: invalid persisted starting chapter %d", entry)
}