You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.3 KiB
1.3 KiB
| name | description | type |
|---|---|---|
| Offline simulator architecture | Background OfflineSimulator in game/offline.go runs real server-side combat ticks for offline heroes; replaced fake retroactive simulateOffline | project |
Real offline simulation system added 2026-03-27. Key decisions:
game.OfflineSimulatorticks every 30s, queries heroes withstate='walking'andupdated_at < now - 1mingame.SimulateOneFightis the canonical single-fight function used by both simulator and catch-upgame.PickEnemyForLevel,game.ScaleEnemyTemplate,game.AutoEquipWeapon,game.AutoEquipArmorwere extracted from handler to game package (exported)- handler's
pickEnemyForLevel/autoEquipWeapon/autoEquipArmornow delegate to game package catchUpOfflineGapin handler covers server-down gap (hero.UpdatedAt to serverStartedAt)buildOfflineReportreads real adventure_log entries instead of generating fake onesserverStartedAtpassed from main.go -> router.Deps -> GameHandler
Why: Old simulateOffline generated fake events retroactively at login. New system writes real events to adventure_log as they happen.
How to apply: When touching offline/idle combat, work in game/offline.go. The handler no longer owns combat simulation logic for offline heroes.