47 lines
2.3 KiB
Markdown
47 lines
2.3 KiB
Markdown
# WTOfflineProject
|
||
|
||
《战争雷霆》离线版。目标客户端版本:Steam 2.61.0.37。
|
||
|
||
做法和 SPT 一样:客户端的所有联网请求改到本机,由本地服务器模拟 Gaijin 的服务器。
|
||
|
||
本仓库不包含任何游戏文件。构建时从一个游戏文件夹读取原版文件。
|
||
|
||
| 目录 | 内容 |
|
||
|---|---|
|
||
| `apps/launcher/` | Electron 安装器与启动器 |
|
||
| `apps/server/` | 本地服务器(TypeScript):模拟 Gaijin 的登录、档案、匹配、商店等服务器 |
|
||
| `packages/` | 共用的 TypeScript 库(npm workspace):BLK 编解码(`blk`)、数据包读写(`vromfs`)、JSONC(`jsonc`)、exe 补丁引擎(`exepatch`)、构建游戏副本(`patcher`) |
|
||
| `patches/exe/` | exe 补丁定义 |
|
||
| `patches/gui/` | 界面脚本补丁定义 |
|
||
| `native/` | 网络钩子与本地对局模块 `wto_ws.dll`(C) |
|
||
| `scripts/` | 开发用的 TypeScript 脚本(如 `build-game-copy.ts` 构建游戏副本) |
|
||
| `tools/` | Python 开发端工具:数据包读写、exe 补丁核对(特征码生成、汇编核对)、界面补丁编译检查 |
|
||
|
||
## 本地构建
|
||
|
||
在 Windows 上使用 Node.js 24 或更新版本,以及 Visual Studio 的 x64 C++ 构建工具。在仓库根目录安装依赖并生成本地库。
|
||
|
||
```powershell
|
||
npm install
|
||
powershell -NoProfile -File native\wto-net\build.ps1
|
||
```
|
||
|
||
从已安装的游戏读取原版文件,将生成的文件写入独立副本。两个命令使用相同的数据目录和端口。
|
||
|
||
```powershell
|
||
node scripts/build-game-copy.ts --game "<原版游戏目录>" --out "<离线副本目录>" --data "<数据目录>" --port 27015
|
||
node apps/server/src/cli.ts --game "<离线副本目录>" --data "<数据目录>" --port 27015
|
||
```
|
||
|
||
## 开发检查
|
||
|
||
使用 `npm run typecheck` 检查 TypeScript。启动器在 `apps/launcher/` 中运行 `npm run typecheck` 和 `npm run build`。
|
||
|
||
使用 Python 3.12 或更新版本安装本地工具 `python -m pip install -e ./tools`。以下命令读取目标版本的原版文件。界面检查的 `--sq` 指定 Quirrel 编译器路径。
|
||
|
||
```powershell
|
||
wtotools check-patches --exe "<原版游戏目录>\win64\aces.exe"
|
||
wtotools check-gui --gui "<原版游戏目录>\gui.vromfs.bin" --sq "<Quirrel 编译器路径>"
|
||
wtotools check-offsets --exe "<原版游戏目录>\win64\aces.exe"
|
||
```
|