本文记录判定点与拦截钩子的设计。当前仓库为骨架,钩子尚未实现;实现时以本文为准。
限制是会话级的:只需在内存里记录“本次 SPT 运行是否已进入过场景”,并在“开始战局”的入口查询该标记。数据流如下:
进入战局/藏身处 → 置位标记 (SessionGate.MarkEnteredScene)
试图开始战局 → 查询 (SessionGate.ShouldBlockStart) → 阻止或放行
OneShot.Core.SessionGate 为纯逻辑状态机,不依赖游戏程序集,因此可在公共 CI 上直接单测。
计划钩子点:EFT.GameWorld.OnGameStarted。
GameWorld 启动完成,即视为“已进入一次战局”。GameWorld 流程,故一并覆盖。计划钩子点:EFT.MainMenuShowOperation / EFT.UI.MenuScreen。
MainMenuShowOperation)拦截:
当 ShouldBlockStart(PluginConfig.Enabled.Value) 为真时阻止流程继续。EFT.UI.MenuScreen)可用于展示“已被限制”提示;文案取自 OneShotText.Get(...),按系统区域选择中/英文。具体钩子的目标签名需随 EFT 版本逆向确认;本骨架不实现钩子,只固定
Patches/目录与纯逻辑接口。
SessionGate.Reset()。ResetRequested 为一次性操作项:勾选后由 PluginConfig 复位为 false 并触发事件,避免界面停留在“已勾选”。===============================================================
This document records the detection point and interception hooks. The repository is currently a skeleton and the hooks are not implemented yet; implement against this document.
The restriction is session-scoped: keep an in-memory flag for "has a scene been entered this SPT run" and consult it at the raid-start entry. Data flow:
enter raid/hideout → set flag (SessionGate.MarkEnteredScene)
try to start raid → query (SessionGate.ShouldBlockStart) → block or allow
OneShot.Core.SessionGate is a pure-logic state machine with no game-assembly dependency, so it can be unit-tested on public CI.
Planned hook: EFT.GameWorld.OnGameStarted.
GameWorld finishes starting, treat it as "a raid has been entered".GameWorld flow, so it is covered as well.Planned hooks: EFT.MainMenuShowOperation / EFT.UI.MenuScreen.
MainMenuShowOperation):
when ShouldBlockStart(PluginConfig.Enabled.Value) is true, stop the flow.EFT.UI.MenuScreen) can show the "blocked" message; text comes from OneShotText.Get(...), chosen by system locale.Exact hook signatures must be verified against the EFT build; this skeleton does not implement hooks and only fixes the
Patches/directory and the pure-logic interface.
SessionGate.Reset().ResetRequested is a one-shot action item: on check, PluginConfig resets it to false and raises the event so the UI does not stay on.