fix(presenter,app-iced): 「游戏在跑」挡在落 core 之前(M247 r2)
塔裁决:三个写操作在实例启动/运行时必须拒,判据不能只靠界面灰按钮 —— Windows 上是 os error 32 兜底,**Linux 上删一个正在跑的世界会成功**,那是在 用户玩到一半时把存档删掉。 - host/dispatch.rs:`AppCommand::Saves` 与 `AppCommand::Mods` 同款,先查 `CoreHost::in_flight(&id)` 再把 `running` 传下去 - host/saves.rs::dispatch 增 `running`:为真时三个写操作**不 spawn、不碰盘**, 直接回一条 `SavesFailureKind::GameRunning` 的结构化失败;读路径与「打开文件夹」不受影响 - dto:新增 `GameRunning` 类别(不折进 WriteFailed —— 那不是"写失败",是"我们主动没写") - i18n:「游戏正在运行(先退出再操作)」中英成对 + 金表同步 - 用例:在飞时三条写命令盘上指纹不变/世界还在/备份落点没建,且回 GameRunning; 反向用例钉住闸门没有把写操作一并关死;UI 侧断言三种动词的主句都不出现「写盘失败」且不画重试 - 拆分(400 行):host/saves.rs → host/saves/write.rs;两处测试各拆出 write 子模块 - SavesState 模块文档补「生命周期」表:draft / pending / confirm 谁写谁清、何时必须清, 并把 confirm「取走即清」(连点两下不删两个)写成安全不变量 - 出图:ULL_SAVES_FIXTURE=running 一张(失败那句话的样子)
This commit is contained in:
1 parent
c921b9c185
commit
8c67e4eca6
13 files changed
+889
-448
No files matched your search
@@ -149,6 +149,7 @@ pub(super) const GOLDEN: &[(&str, &str, &str)] = &[
|
||||
("InstancesSavesReasonBoundary", "that path is outside saves/", "那个路径落在 saves/ 之外"),
|
||||
("InstancesSavesReasonTooLarge", "the world is too large for one zip", "这个世界太大,一个 zip 装不下"),
|
||||
("InstancesSavesReasonWrite", "the write failed", "写盘失败"),
|
||||
("InstancesSavesReasonRunning", "the game is running (exit it first)", "游戏正在运行(先退出再操作)"),
|
||||
];
|
||||
|
||||
/// 金表的**全量**行(本文件 → [`tail`] → [`tail_ai`] → [`tail2`],顺序即 `Key::ALL`)。
|
||||
|
||||
@@ -205,6 +205,9 @@ macro_rules! instances_entries {
|
||||
InstancesSavesReasonBoundary => ("that path is outside saves/", "那个路径落在 saves/ 之外"),
|
||||
InstancesSavesReasonTooLarge => ("the world is too large for one zip", "这个世界太大,一个 zip 装不下"),
|
||||
InstancesSavesReasonWrite => ("the write failed", "写盘失败"),
|
||||
// 实例在启动/运行中:三个写操作**主动不写盘**(不是"写盘失败"——Linux 上删一个正在跑的
|
||||
// 世界是会成功的,所以这条要直说"先退出",别让用户以为是权限问题)。
|
||||
InstancesSavesReasonRunning => ("the game is running (exit it first)", "游戏正在运行(先退出再操作)"),
|
||||
} }
|
||||
};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user