Files
WT-Offline/exe-patches/battle/allow-local-host-bot-spawns/patch.json
T
N0VAN0M4LY b260d2899e chore(battle): snapshot the LocalMP rework baseline
Records the uncommitted battle-session work exactly as it was left
(local service matchmaking, settlement, chat, native LocalMP hooks,
battle gui/exe patches) so the following review and rework commits
show every correction as a diff against this state.

This commit is not reviewed and is known to be incomplete: in-game
testing reported wrong settlement rewards, single-country teams,
missing random/fixed supplement slots, misattributed hit messages and
other regressions. Do not merge this branch before the rework lands.
2026-11-28 03:15:47 +08:00

53 lines
3.3 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"id": "battle/allow-local-host-bot-spawns",
"title": "允许本地多人主机模式下 BotSystem 为双方 AI 槽位刷出载具",
"program_behaviour": {
"stock": "BotSystem::changeUnit 在选好 AI 载具并找到可用出生点(0x111a010)后,在 0x11b2c3a 检查全局多人对象 [0x7b83cb0] 是否为空:仅单机模式(g_multiplayer == nullptr)跳至 0x11b314e 执行 Unit::changeAircraft;多人模式下因客户端裁掉了服务端脚本校验分支,直接落入错误日志 \"BotSystem::changeUnit spawn denied by scripts\" 并放弃刷车。",
"patched": "将 0x11b2c3a 处的空指针比较与条件跳转改为无条件跳至 0x11b314e,使 LocalMP 本地权威主机通过出生点检查后直接执行 Unit::changeAircraft 为双方 AI 刷出坦克/飞机/舰艇(远程 Peer 模式已在函数入口 0x11b2259 因 isHost == 0 提前返回,不受影响)。"
},
"derivation": {
"requirement": "功能清单 L「AI 出车」。玩家排队进入本地多人对局后,双方 AI 必须按 customBots 载具池在各自出生点正常刷出参战。",
"cause": "2.61.0.37 客户端 exe 在编译时移除了专用服务端在 BotSystem::changeUnit 中调用的服务端脚本出生许可钩子,只保留了 g_multiplayer == nullptr 的单机跳转,导致 LocalMP 主机(g_multiplayer != nullptr 且 isHost == 1)每次刷 AI 都报 spawn denied by scripts。",
"lighter_options_ruled_out": [
"原生配置或任务参数:0x11b2c3a 只判断 [0x7b83cb0] 是否为 0,不读任何 MissionSettings 或 DataBlock 开关。",
"本地服务或界面脚本:该判断位于客户端物理主机每帧原生 BotSystem::update 内部,不发网络请求也不调客户端 Quirrel 脚本。"
],
"conclusion": "只能改 exe,在出生点检查通过后跳入原有的 0x11b314e 刷车构造分支。",
"if_not_applied": "进入 LocalMP 对局后双方 AI 槽位虽然加入房间,但因每次 changeUnit 都被拦截,战局内一辆 AI 载具都不会刷出。"
},
"why_this_site": [
"0x11b2c32 刚完成出生点可用性检查(test al, al; je 0x11b2d15),紧接着的 14 字节(0x11b2c3a-0x11b2c48)就是唯一的 g_multiplayer == 0 拦截。",
"函数开头 0x11b224d-0x11b225d 已经拦住了所有非主机多人会话(isHost == 0 直接返回 0),所以能走到 0x11b2c3a 的多人会话一定是本地主机。",
"原地用 5 字节近跳转加 9 字节 nop 覆盖 14 字节原指令,不改栈帧大小,不引入新调用,异常展开信息保持不变。"
],
"features": ["L-AI出车"],
"requires": [],
"evidence": [
"2.61.0.37 原版 aces.exe:BotSystem::changeUnit 0x11b2200,主机检查 0x11b224d-0x11b225d,出生点选择 0x11b2c2d(call 0x111a010),拦截点 0x11b2c3a-0x11b2c48,错误日志 0x11b2cfe,刷车构造入口 0x11b314e -> 0xff1020(Unit::changeAircraft)。",
"2.61.0.37 实测战斗日志:未打补丁时连续输出 \"BotSystem::changeUnit spawn denied by scripts for fm ... unit ...\"。"
],
"verified_on": ["2.61.0.37"],
"edit": {
"offset": 38,
"asm": [
"jmp 0x514",
"nop",
"nop",
"nop",
"nop",
"nop",
"nop",
"nop",
"nop",
"nop"
],
"bytes": "e90f050000909090909090909090",
"expect_original": "48833d6e109d06000f8406050000"
}
}