Files
WT-Offline/gui-patches/battle/quit-local-host-to-debriefing/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

32 lines
3.8 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/quit-local-host-to-debriefing",
"title": "局内菜单在本地多人主机模式下显示常规随机战退局提示并直接进入战后结算",
"file": "scripts/flightmenu/flightmenu.nut",
"program_behaviour": {
"stock": "FlightMenu.onQuitMission 对 is_mplayer_host() 一律显示自定义房主专用提示(\"其他玩家将无法完成该任务\"),且 sendDisconnectMessage 只要判断 is_multiplayer() 为真就调用主机下为空操作的 leave_mp_session()。",
"patched": "随机战(GM_DOMINATION)下跳过自定义房主提示,照常列出剩余可出击载具与随机战中途退出提示;确认退出时仅对非主机调用 leave_mp_session(),本地主机走 this.quitToDebriefing() 进入战后结算。"
},
"derivation": {
"requirement": "Show the standard random-battle quit confirmation (remaining crews and early-leave notice) and proceed cleanly to debriefing when pressing Esc -> Return to Hangar in a LocalMP battle.",
"cause": "flightmenu.nut 第 255 行把 is_mplayer_host() 放在 get_game_mode() == GM_DOMINATION 之前,误将 LocalMP 随机战当成联机合作自定义房主;且原生 leave_mp_session(aces.exe 0x17909a0)在 is_mplayer_host() 为真时直接 ret。",
"lighter_options_ruled_out": [
"仅靠本地服务:按 Esc 弹窗与退局确认均为纯客户端本地界面逻辑,期间不发网络请求。"
],
"conclusion": "在 onQuitMission 中把房主提示限定为 get_game_mode() != GM_DOMINATION,并在 sendDisconnectMessage 中将 Peer 退房条件收紧为 is_multiplayer() && !is_mplayer_host()。",
"if_not_applied": "按 Esc 点返回基地会弹出「其他玩家将无法完成该任务」的联机房主提示,甚至因 leave_mp_session 空返回而无法退出。"
},
"features": ["K-战局任务加载", "M-战后结算"],
"evidence": [
"2.61.0.37 aces.exe:0x17909a0-0x17909be(leave_mp_session 在 [0x7b83cb0 + 0x60] != 0 时直接跳至返回)、0x17897c0(quit_to_debriefing)。",
"2.61.0.37 gui.vromfs.bin:scripts/flightmenu/flightmenu.nut 第 26-34、228-277 行。"
],
"edit": {
"find": " function sendDisconnectMessage() {\r\n broadcastEvent(\"PlayerQuitMission\")\r\n if (is_multiplayer()) {\r\n leave_mp_session()\r\n this.onResumeRaw()\r\n }\r\n else\r\n this.quitToDebriefing()\r\n }\r\n\r\n function quitToDebriefing() {\r\n disableOrders()\r\n quit_to_debriefing()\r\n interrupt_multiplayer(true)\r\n HudBattleLog.reset()\r\n this.onResumeRaw()\r\n }\r\n\r\n function onQuitMission(_obj) {\r\n if (is_offline_version() && !ludeo?.is_running())\r\n return restart_mission()\r\n\r\n if (is_replay_playing()) {\r\n this.quitToDebriefing()\r\n }\r\n else if (get_mission_status() == MISSION_STATUS_RUNNING) {\r\n local text = \"\"\r\n if (is_mplayer_host())\r\n text = loc(\"flightmenu/questionQuitMissionHost\")",
"replace": " function sendDisconnectMessage() {\r\n broadcastEvent(\"PlayerQuitMission\")\r\n if (is_multiplayer() && !is_mplayer_host()) {\r\n leave_mp_session()\r\n this.onResumeRaw()\r\n }\r\n else\r\n this.quitToDebriefing()\r\n }\r\n\r\n function quitToDebriefing() {\r\n disableOrders()\r\n quit_to_debriefing()\r\n interrupt_multiplayer(true)\r\n HudBattleLog.reset()\r\n this.onResumeRaw()\r\n }\r\n\r\n function onQuitMission(_obj) {\r\n if (is_offline_version() && !ludeo?.is_running())\r\n return restart_mission()\r\n\r\n if (is_replay_playing()) {\r\n this.quitToDebriefing()\r\n }\r\n else if (get_mission_status() == MISSION_STATUS_RUNNING) {\r\n local text = \"\"\r\n if (is_mplayer_host() && get_game_mode() != GM_DOMINATION)\r\n text = loc(\"flightmenu/questionQuitMissionHost\")"
}
}