Have the LocalMP modules read their addresses and offsets from the build
wto_ws.dll no longer scans aces.exe or carries structure offsets of a game build. It reads the values the patcher resolved (wto_ws.cfg native.* lines) into g_lmp through one table that names, per module, which value fills which field (local_mp_values.c), and installs each module whose values are all present, in dependency order, instead of giving up on the whole bridge when one subsystem is missing. When the settings were resolved for another executable (PE time stamp and image size differ), the bridge stays off. local_mp_offsets.h keeps the existing names so the module code reads as before; only Dagor library layouts (dag::Vector, DataBlock), protocol enums, the reflection buffer size and the two change request members with no reader in the client remain constants. A few fields are derived where the client has no instruction of its own for them (local_mp_values.c derive_values). The signatures moved to patches/native, and the header-based check-offsets command is gone: record-game-version and the launcher's patch check resolve the native modules now. Shared sites moved to local_mp_core (mission customBots, the player's unit eid) so modules do not depend on each other for them. Checked: DLL build (no warnings outside MinHook); root and launcher type checks; check-patches on 2.61.0.37; version records for 2.61.0.37 and 2.61.0.43 (10 native modules each); a lab run of the 2.61.0.37 copy logs 239 native values and "9 of 9 LocalMP modules installed". Battles were not played in this run.
This commit is contained in:
1 parent
ddec5c59c0
commit
6ce93ee962
23 files changed
+721
-805
No files matched your search
@@ -23,7 +23,7 @@ WTOffline 是《战争雷霆》(War Thunder)Windows 客户端的单机离线
|
||||
| 游戏副本构建 | 可用。命令行脚本与启动器共用同一套构建代码 |
|
||||
| 启动器 | 安装向导(选择原版目录、补丁兼容性检查、复制、备份)可用;从启动器启动服务器和游戏仍在开发 |
|
||||
|
||||
其他客户端版本没有验证过。补丁使用特征码定位,小版本更新后可能仍然命中,但不保证功能正确。
|
||||
其他客户端版本没有验证过。补丁和 native 模块按特征码、字符串引用和从代码中读出的值定位,小版本更新后通常仍能命中,但没有核对记录(`patches/versions/`)的版本不保证功能正确。
|
||||
|
||||
## 功能
|
||||
|
||||
@@ -102,7 +102,7 @@ AI 的驾驶、寻路和战术使用游戏自带的 AI,目前仍有明显不
|
||||
|
||||
1. 本地服务器的匹配服务在排队后下发开局通知,内容是完整的任务配置,包括地图、AI 阵容和出生规则。
|
||||
2. 界面脚本补丁收到通知后,在游戏进程内以 LocalMP 主机身份开局。
|
||||
3. `native/wto-net` 中的 `local_mp_*` 模块补上被裁掉的服务端处理,包括选车与出生、击杀归属、计分、奖励事件、聊天主机和核弹胜负判定。这些函数在 `.text` 段中按特征码定位,某个特征失配时只跳过对应功能并写日志。
|
||||
3. `native/wto-net` 中的 `local_mp_*` 模块补上被裁掉的服务端处理,包括选车与出生、击杀归属、计分、奖励事件、聊天主机和核弹胜负判定。它们需要的函数、全局变量和结构体偏移定义在 `patches/native/`,由构建按当前客户端解析后写入 `wto_ws.cfg`;某个模块无法解析时,安装器列出受影响的功能,DLL 只跳过该模块并写日志。
|
||||
4. 对局中的战斗事件实时上报本地服务器,用于判定嘉奖;对局结束后由服务器按游戏数据和配置结算收益,结算页显示服务器的结果。
|
||||
|
||||
### 与正版隔离
|
||||
@@ -214,10 +214,11 @@ npm run build --workspace "@wto/launcher"
|
||||
```powershell
|
||||
python -m pip install -e ./tools
|
||||
wtotools check-patches --exe "<原版目录>\win64\aces.exe" # 定位并核对全部 exe 补丁
|
||||
wtotools check-offsets --exe "<原版目录>\win64\aces.exe" # 核对 local_mp 模块的特征码
|
||||
wtotools check-gui --gui "<原版目录>\gui.vromfs.bin" --sq "<sq.exe 路径>" # 应用界面补丁并用 Quirrel 编译器编译
|
||||
```
|
||||
|
||||
检查全部补丁和 native 模块并写入该客户端版本的核对记录:`node scripts/record-game-version.ts --game "<原版目录>"`。
|
||||
|
||||
## 目录结构
|
||||
|
||||
```text
|
||||
@@ -280,7 +281,7 @@ The repository contains source code and patch definitions only. It does not cont
|
||||
| Game copy build | Working. The command-line script and the launcher share the same build code |
|
||||
| Launcher | The install wizard (select the original folder, check patch compatibility, copy, back up) works. Starting the server and the game from the launcher is in development |
|
||||
|
||||
Other client versions have not been verified. Patches are located by signature scanning, so they may still match after a minor update, but correct behavior is not guaranteed.
|
||||
Other client versions have not been verified. Patches and native modules are located by signatures, string references and values read from the code, so they usually still match after a minor update, but correct behavior is not guaranteed for a version without a check record (`patches/versions/`).
|
||||
|
||||
## Features
|
||||
|
||||
@@ -359,7 +360,7 @@ When queueing, the client only ever connects to a remote battle server as a clie
|
||||
|
||||
1. After the player queues, the local matching service sends a battle start notification carrying the full mission configuration, including the map, AI lineups, and spawn rules.
|
||||
2. A UI script patch receives the notification and starts the battle in the game process as a LocalMP host.
|
||||
3. The `local_mp_*` modules in `native/wto-net` restore the stripped server-side handlers: vehicle selection and spawning, kill attribution, scoring, award events, the chat host, and nuke victory. These functions are located in the `.text` section by signature. If a signature does not match, only that feature is skipped and a log entry is written.
|
||||
3. The `local_mp_*` modules in `native/wto-net` restore the stripped server-side handlers: vehicle selection and spawning, kill attribution, scoring, award events, the chat host, and nuke victory. The functions, globals and structure offsets they need are defined in `patches/native/`; the build resolves them against the client and writes them into `wto_ws.cfg`. If a module cannot be resolved, the installer lists the affected features and the DLL skips only that module and writes a log entry.
|
||||
4. Combat events are reported to the local server during the battle to decide awards. When the battle ends, the server settles rewards from the game data and tuning, and the debriefing shows the server's results.
|
||||
|
||||
### Isolation from the online game
|
||||
@@ -471,10 +472,11 @@ npm run build --workspace "@wto/launcher"
|
||||
```powershell
|
||||
python -m pip install -e ./tools
|
||||
wtotools check-patches --exe "<stock folder>\win64\aces.exe" # locate and verify every exe patch
|
||||
wtotools check-offsets --exe "<stock folder>\win64\aces.exe" # verify the local_mp module signatures
|
||||
wtotools check-gui --gui "<stock folder>\gui.vromfs.bin" --sq "<path to sq.exe>" # apply UI patches and compile them with the Quirrel compiler
|
||||
```
|
||||
|
||||
To check every patch and native module and write the check record of that client version: `node scripts/record-game-version.ts --game "<stock folder>"`.
|
||||
|
||||
## Repository layout
|
||||
|
||||
```text
|
||||
|
||||
Reference in new issue
Block a user