fix: prevent game from auto-starting to avoid stale initialization events

Problem:
When loading a save (e.g., from year 106), events from year 100 would appear.
This happened because the game auto-started on server startup and client
connection, generating initialization events before the user could load a save.

Solution:
1. Backend: Keep game paused on startup even if LLM check passes
2. Backend: Remove auto-resume on first WebSocket connection
3. Frontend: Start with game paused (isManualPaused = true)

Now the user must explicitly click 'resume' to start a new game, or load a
save first. This prevents the race condition where game_loop generates events
with stale world state.
This commit is contained in:
Zihao Xu
2026-01-07 23:41:25 -08:00
committed by bridge
parent 624f697bee
commit 8631be501b
3 changed files with 141 additions and 4 deletions

View File

@@ -18,7 +18,8 @@ const uiStore = useUiStore()
const socketStore = useSocketStore()
const showMenu = ref(false)
const isManualPaused = ref(false)
// 启动时默认暂停,让用户选择"新游戏"或"加载存档"后再继续。
const isManualPaused = ref(true)
const menuDefaultTab = ref<'save' | 'load' | 'create' | 'delete' | 'llm'>('load')
onMounted(async () => {