Add a Project homepage card and button pointing to https://wto-project.net on the launcher About page with matching zh-CN and en locale entries. Root typecheck, launcher typecheck, electron-vite build, and locale key parity checks passed.
WTOffline 是《战争雷霆》(War Thunder)Windows 客户端的单机离线项目。本地服务器模拟 Gaijin 的线上服务,客户端的所有请求都发到本机。客户端照常登录、读取档案、进入机库、提交玩家操作,游戏规则、存档和对局结算都在本地服务器上完成,对手和队友全部是 AI。
仓库只包含源码和补丁定义,不包含任何游戏文件。构建时从玩家本机的原版安装读取文件,生成一份独立的游戏副本。
状态
| 项目 | 说明 |
|---|---|
| 目标客户端 | Windows x64,Steam 版。已核对的版本见 patches/versions/ |
| 本地服务器 | 可用。当前通过命令行启动 |
| 游戏副本构建 | 可用。命令行脚本与启动器共用同一套构建代码 |
| 启动器 | 安装向导(选择原版目录、补丁兼容性检查、复制、备份)可用;从启动器启动服务器和游戏仍在开发 |
patches/versions/ 中每份核对记录对应一个检查通过并在游戏中验证过的客户端版本。补丁和 native 模块按特征码、字符串引用和从代码中读出的值定位,不依赖固定地址,小版本更新后通常仍能命中,但没有核对记录的版本不保证功能正确。
开发讨论、交流与求助
欢迎加入 WTOffline Discord 服务器,用于日常交流、使用求助、问题反馈、调参分享以及开发和版本适配讨论。
功能
| 领域 | 已实现 |
|---|---|
| 账号与存档 | 本地账号登录、注册、自动登录和切换;每个账号一份存档;命令行存档修改器 |
| 机库与载具 | 机库展示、性能卡、防护分析、X 光、测试驾驶 |
| 科技树与研发 | 各国各兵种科技树,研发与购买载具,前置与等级限制,自由研发点和金鹰加速,研发后才显示的隐藏载具 |
| 改装与乘员 | 改装研发、购买和启用,弹药与挂载预设,乘员槽位、训练、技能、专家与王牌,阵容预设 |
| 外观 | 涂装、贴花、挂件、迷彩、用户涂装,个人资料外观 |
| 经济与商店 | 银狮、金鹰、GJN,高级账户,本地网页商店与交易所,兑换码,可调的收益倍率 |
| 道具与库存 | 补给箱、载具兑换券、合同、每日备用载具、道具回收与合成 |
| 联队 | 本地联队名录、加入与退出、联队研发与联队载具、活跃度 |
| 对局 | 陆战、空战、海战的街机与历史模式,防守任务,一战活动;AI 阵容、身份和称号,出生点数与重生,补充载具,呼叫支援与核弹,计分板,聊天,观战 |
| 战后 | 结算页、战斗历史、个人统计、战斗奖章、加成道具与合同结算、修理费与自动修理 |
| 回放 | 录制与回放,回放中切换到 AI 视角 |
尚未实现:全真模式、自定义战斗、单人任务与动态战役、世界大战、战令、成就进度和称号获取、排行榜。好友、组队等多人社交功能不适用,只保证界面不报错。
AI 的驾驶、寻路和战术使用游戏自带的 AI,目前仍有明显不足。
工作原理
游戏副本
├─ char.vromfs.bin / aces.vromfs.bin 服务地址改写为本地服务器
├─ gui.vromfs.bin 界面脚本补丁
└─ win64/
├─ aces.exe exe 补丁
└─ wto_ws.dll 网络钩子库
│
▼ 所有连接进入同一个端口
本地服务器(Node.js,只监听 127.0.0.1)
├─ 协议层 登录(yuplay2)、char、匹配、库存、商店、聊天、联队……
├─ 规则层 研发、经济、乘员、道具、联队、对局结算……
├─ 存档层 每个操作在回复客户端之前写盘
└─ 数据层 启动时从原版游戏文件提取静态数据
本地服务器
apps/server 按 Gaijin 的各个服务分模块,每个模块负责解析该服务的请求格式(表单、JSON、char 的二进制 BLK)并按同样的格式回复。线上协议的细节只出现在协议层,游戏规则按功能领域放在规则层。
服务器在一个端口上接收所有流量,按连接开头的字节分流:匹配服务器的二进制协议、聊天的 IRC 握手、TLS,其余按 HTTP(含 WebSocket)处理。TLS 使用服务器自己生成的证书,解密后再按同样的规则分流,并按握手中的 SNI 判断原本要连接的主机。
载具、科技树、价格、收益系数等静态数据由服务器在开始监听前从原版的 vromfs 数据包和 BLK 文件中提取,不随项目分发。提取结果缓存在数据目录下,游戏文件变化后自动重新提取。
游戏副本
packages/patcher 读取原版文件,在内存中完成全部修改后写入副本:
- 服务地址:
config/network.blk(char.vromfs.bin)和config/settings.blk(aces.vromfs.bin)中所有 Gaijin 地址改写为127.0.0.1:<端口>。端口在构建时写入,因此服务器必须使用相同的端口。 - 配置表:开启离线需要的功能开关,放出隐藏载具,写入贴花索引,为本地商店的礼包登记 GUID。
- exe 补丁:
patches/exe/下共 13 项,见下表。 - 界面脚本补丁:
patches/gui/下共 40 项,用于本地账号注册、本地对局的开局与结算、本地商店的购买回执,以及库存签名公钥等。 - 网络钩子库:exe 的导入表把
WS2_32.dll改为同长度的wto_ws.dll。该库转发系统ws2_32.dll的全部导出,并用 MinHook 挂钩域名解析(getaddrinfo等)、连接(connect、ConnectEx等)和 UDP 发送,把所有外部连接重定向到本地服务器端口。端口从 exe 旁的wto_ws.cfg读取。
| exe 补丁 | 作用 |
|---|---|
startup/skip-resource-archive-signature-check |
跳过数据包签名校验,使修改过的 vromfs 能被加载 |
isolation/user-data-folder-name |
用户数据目录改为 WTOffline,与线上版分开 |
isolation/registry-key |
注册表位置改为 Software\WTOffline |
isolation/never-load-battleye |
不加载 BattlEye |
isolation/never-upload-crash-reports |
不上传崩溃报告 |
isolation/never-launch-official-launcher |
不拉起官方启动器 launcher.exe |
online/network-hook-library |
加载 wto_ws.dll 代替 WS2_32.dll |
online/accept-local-tls-certificate |
让 libcurl 接受本地服务器的自签名证书 |
online/matching-server-public-key |
匹配服务器公钥替换为本地服务器的公钥,用于解出会话密钥 |
battle/allow-local-host-bot-spawns |
本地主机上为 AI 生成载具 |
battle/allow-local-host-player-respawn |
本地主机上的玩家在对战模式中可以出生 |
battle/allow-local-host-ucav-launch |
本地主机上可以放出无人机 |
battle/count-bots-as-active-players |
AI 计入在场人数,影响占点扣分和人数规则 |
本地对局
客户端在排队时只会以客户端身份连接远程对战服务器,客户端程序中也不包含服务端的对局逻辑。本项目的做法是:
- 本地服务器的匹配服务在排队后下发开局通知,内容是完整的任务配置,包括地图、AI 阵容和出生规则。
- 界面脚本补丁收到通知后,在游戏进程内以 LocalMP 主机身份开局。
native/wto-net中的local_mp_*模块补上被裁掉的服务端处理,包括选车与出生、击杀归属、计分、奖励事件、聊天主机和核弹胜负判定。它们需要的函数、全局变量和结构体偏移定义在patches/native/,由构建按当前客户端解析后写入wto_ws.cfg;某个模块无法解析时,安装器列出受影响的功能,DLL 只跳过该模块并写日志。- 对局中的战斗事件实时上报本地服务器,用于判定嘉奖;对局结束后由服务器按游戏数据和配置结算收益,结算页显示服务器的结果。
与线上版隔离
离线副本和线上版可以装在同一台电脑上。副本使用独立的游戏名,因此文档目录、AppData 和注册表都与线上版分开;反作弊和崩溃上报由启动参数(-nobeac、-crashpad-disable-upload)和 exe 补丁同时禁用,直接运行 exe 也不会生效;所有网络连接都经过 wto_ws.dll。
补丁格式
每个补丁是一个目录,以 JSONC 描述,文件内的注释说明修改原因和不修改时的后果。
- exe 补丁:
patch.jsonc的variants列出一种或多种写法,每种写法针对一个客户端版本(written_for)。locate给出特征码、所在节,以及要从代码中读出的值(captures,例如跳转目标);edit给出写入的字节和预期的原始字节(expect_original)。两者都可以用??,写入字节中的??由fixups按读出的值填写。恰好一种写法命中时才写入,否则不写入该补丁。 - 界面脚本补丁:每种写法指定目标脚本和替换片段(如
find.nut、replace.nut)。片段原文必须在目标文件中唯一命中,同样恰好一种写法命中时才写入。
每个补丁在 features 中列出依赖它的功能。patches/versions/<版本>.jsonc 是每个已适配客户端版本的核对记录(由 scripts/record-game-version.ts 生成),记下每个补丁命中的写法和位置。补丁不可用时,安装器列出受影响的功能。涉及离线启动、线上版隔离或断开 Gaijin 连接的补丁不可用时,安装会被阻止(packages/patcher/src/essential-features.ts)。
数据目录
服务器和构建脚本使用同一个数据目录(--data):
| 路径 | 内容 |
|---|---|
accounts.json |
本地账号 |
saves/ |
每个本地账号的存档 |
clans.json |
本地联队 |
cache/ |
从游戏文件提取的数据集缓存 |
logs/ |
流量日志,服务器每次启动新建一个子目录 |
tuning/ |
可选的数值覆盖,见下一节 |
asset-pack/ |
可选的离线图片包,见开发 |
可调数值
离线版自己决定的数值放在 apps/server/tuning/*.jsonc,游戏数据中本来就有的数值(载具价格、收益系数等)一律从游戏文件读取。
| 文件 | 内容 |
|---|---|
battle.jsonc |
对局人数、AI 载具池、国家阵营、收益倍率 |
battle-economy.jsonc |
游戏文件中没有的战斗事件计分 |
new-profile.jsonc |
新存档的初始货币 |
research.jsonc |
默认研发目标的选择规则 |
store.jsonc |
本地商店的商品与价格 |
marketplace.jsonc |
交易所的购买上限与手续费 |
supply-chests.jsonc、trophies.jsonc |
补给箱的价格、奖池和权重 |
recycling.jsonc |
道具回收与合成配方 |
redeem-codes.jsonc |
兑换码 |
clans.jsonc |
预置联队与活跃度规则 |
limits.jsonc |
各类数量上限 |
在数据目录下建立 tuning/<同名文件>.jsonc 即可覆盖默认值,只需写出要改的字段:对象按键合并,数字、字符串和数组整体替换。服务器启动时校验所有字段,类型或范围不对时报出文件和字段并拒绝启动。
开发
开发规范、补丁指南和 PR 自查清单见 Dev Docs,开发与版本适配讨论欢迎前往 Discord。
环境要求
- Windows x64
- Node.js 24 或更高版本
- Visual Studio 或 Build Tools,含 x64 C++ 工具,用于构建
wto_ws.dll - Python 3.12 或更高版本,仅补丁检查工具需要
- 一份原版客户端,版本最好有核对记录(
patches/versions/)
安装依赖并运行启动器
以下命令均在仓库根目录运行。
npm install
powershell -NoProfile -File .\native\wto-net\build.ps1 # 输出到 build\native\wto_ws.dll
node node_modules/electron/install.js
npm run dev --workspace "@wto/launcher"
构建副本并启动服务器
--out 需要是一份完整的游戏副本,可以用安装器创建。构建脚本只读取 --game,把修改后的文件写入 --out。两条命令必须使用相同的数据目录和端口。
node scripts/build-game-copy.ts --game "<原版目录>" --out "<副本目录>" --data "<数据目录>" --port 27015
node apps/server/src/cli.ts --game "<副本目录>" --data "<数据目录>" --port 27015
第一次登录前,在游戏登录界面点击「注册」,或在启动器的「存档」页创建本地账号。已有本地账号可以直接登录。
build-game-copy.ts 的可选参数:
| 参数 | 说明 |
|---|---|
--decal-cache <目录> |
线上版安装的 cache/content,复制到副本以显示真实贴花;不指定时使用占位贴图 |
--skip-unavailable |
非必需补丁不可用时继续构建 |
--patches <目录> |
指定补丁集根目录,包含 exe/、gui/、native/ 和 versions/ |
--native <目录> |
指定 wto_ws.dll 所在目录 |
--verbose |
输出每个补丁的定位结果 |
辅助命令
# 修改存档:货币、自由研发点、联队研发点、道具
node apps/server/src/save-cli.ts --game "<副本目录>" --data "<数据目录>" --player <登录名> --silver 1000000
# 在能访问官网的电脑上下载本地商店使用的公开图片,之后离线也能显示
node apps/server/src/asset-pack-cli.ts --data "<数据目录>"
检查
npm run typecheck
npm run typecheck --workspace "@wto/launcher"
npm run build --workspace "@wto/launcher"
wtotools 用于在不写入任何文件的情况下,检查补丁能否应用到某个客户端:
python -m pip install -e ./tools
wtotools check-patches --exe "<原版目录>\win64\aces.exe" # 定位并核对全部 exe 补丁
wtotools check-gui --gui "<原版目录>\gui.vromfs.bin" --sq "<sq.exe 路径>" # 应用界面补丁并用 Quirrel 编译器编译
GUI 检查需要 Quirrel 编译器,准备方式见 Dev Docs。
检查全部补丁和 native 模块并写入该客户端版本的核对记录:node scripts/record-game-version.ts --game "<原版目录>"。
目录结构
apps/
├── launcher/ Electron 安装器与启动器(React)
└── server/ 本地服务器
├── src/ 各服务与规则模块
└── tuning/ 默认数值配置
packages/
├── blk/ 二进制 BLK 读写,文本 BLK 输出
├── vromfs/ vromfs 数据包读写
├── exepatch/ exe 补丁的定位与写入
├── jsonc/ JSONC 解析
└── patcher/ 游戏副本构建
patches/
├── exe/ exe 补丁定义
└── gui/ 界面脚本补丁定义
native/
├── wto-net/ wto_ws.dll 源码(C)
└── third_party/ MinHook
scripts/ 构建游戏副本的命令行入口
tools/ wtotools,补丁检查工具(Python)
许可
本项目以 GNU Affero General Public License v3.0 或更高版本发布(AGPL-3.0-or-later)。第三方组件保留各自的许可。
第三方组件
- MinHook,BSD 2-Clause 许可,见 native/third_party/minhook/LICENSE.txt。
声明
本项目是同人爱好项目,与 Gaijin Entertainment 没有任何关联,也未获其认可。War Thunder 及相关名称和素材归其各自所有者所有。仓库不分发任何游戏文件,使用者需要自行拥有合法的游戏客户端。
WTOffline (English)
WTOffline is a single-player offline project for the Windows client of War Thunder. A local server emulates Gaijin's online services, and the client sends all of its requests to the local machine. The client logs in, loads its profile, enters the hangar, and submits player actions as usual. Game rules, saves, and battle settlement run on the local server, and all allies and opponents are AI.
The repository contains source code and patch definitions only. It does not contain any game files. The build reads files from the player's own installation and produces a separate game copy.
Status
| Component | Status |
|---|---|
| Target client | Windows x64, Steam. Checked versions are listed in patches/versions/ |
| Local server | Working. Currently started from the command line |
| 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 |
Each check record in patches/versions/ stands for a client version that passed the checks and was verified in game. Patches and native modules are located by signatures, string references and values read from the code rather than fixed addresses, so they usually still match after a minor update, but correct behavior is not guaranteed for a version without a check record.
Community
Join the WTOffline Discord server for general discussion, troubleshooting, bug reports, and development or patch adaptation discussions.
Features
| Area | Implemented |
|---|---|
| Accounts and saves | Local login, registration, auto-login, and account switching; one save per account; command-line save editor |
| Hangar and vehicles | Hangar view, stat cards, protection analysis, X-ray, test drive |
| Tech tree and research | All nations and branches, vehicle research and purchase, prerequisites and rank requirements, free RP and Golden Eagle conversion, hidden research-only vehicles |
| Modifications and crews | Modification research, purchase, and toggling; ammunition and loadout presets; crew slots, training, skills, expert and ace qualification; lineup presets |
| Customization | Camouflages, decals, attachables, user skins, profile cosmetics |
| Economy and store | Silver Lions, Golden Eagles, GJN; premium account; local web store and marketplace; redeem codes; adjustable reward multipliers |
| Items and inventory | Supply chests, vehicle coupons, contracts, daily backup vehicles, item recycling and crafting |
| Squadrons | Local squadron directory, join and leave, squadron research and vehicles, activity |
| Battles | Ground, air, and naval in Arcade and Realistic; defense missions; the WWI event; AI lineups, identities, and titles; spawn points and respawns; extra lineup vehicles; support strikes and nukes; scoreboard; chat; spectating |
| After battle | Debriefing, battle history, personal statistics, battle awards, booster and contract settlement, repair costs and auto-repair |
| Replays | Recording and playback, switching to AI vehicles during playback |
Not yet implemented: Simulator modes, custom battles, single missions and dynamic campaigns, World War, the battle pass, achievement progress and title unlocks, leaderboards. Social multiplayer features such as friends and squads do not apply; the interface is only kept from breaking.
AI driving, pathfinding, and tactics come from the game's built-in AI and still have clear shortcomings.
How it works
Game copy
├─ char.vromfs.bin / aces.vromfs.bin service addresses rewritten to the local server
├─ gui.vromfs.bin UI script patches
└─ win64/
├─ aces.exe exe patches
└─ wto_ws.dll network hook library
│
▼ every connection goes to one port
Local server (Node.js, listens on 127.0.0.1 only)
├─ Protocol layer login (yuplay2), char, matching, inventory, store, chat, squadrons…
├─ Rules layer research, economy, crews, items, squadrons, battle settlement…
├─ Save layer every action is written to disk before the reply
└─ Data layer static data extracted from the stock game files at startup
Local server
apps/server has one module per Gaijin service. Each module parses that service's request format (form data, JSON, or binary BLK for char) and replies in the same format. Wire-protocol details stay in the protocol layer, and game rules live in the rules layer, organized by feature area.
The server accepts all traffic on a single port and routes each connection by its first bytes: the matching server's binary protocol, the IRC handshake used by chat, TLS, and HTTP (including WebSocket) for everything else. TLS uses a certificate the server generates itself. Decrypted traffic is routed by the same rules, and the SNI in the handshake tells the server which host the client meant to reach.
Static data such as vehicles, tech trees, prices, and reward factors is extracted from the stock vromfs archives and BLK files before the server starts listening, and is never distributed with the project. Results are cached in the data folder and extracted again when the game files change.
Game copy
packages/patcher reads the stock files, applies every change in memory, and writes the copy:
- Service addresses: every Gaijin address in
config/network.blk(char.vromfs.bin) andconfig/settings.blk(aces.vromfs.bin) is rewritten to127.0.0.1:<port>. The port is written at build time, so the server must use the same port. - Config tables: enables feature flags the offline copy needs, reveals hidden vehicles, adds a decal index, and registers GUIDs for local store packs.
- exe patches: 13 patches under
patches/exe/, listed below. - UI script patches: 40 patches under
patches/gui/, covering local account registration, battle start and settlement, store purchase receipts, and the inventory signing key. - Network hook library: the import table entry
WS2_32.dllis renamed towto_ws.dll, which has the same length. The library forwards every export of the systemws2_32.dlland uses MinHook to hook name resolution (getaddrinfoand others), connections (connect,ConnectEx, and others), and UDP sends, redirecting every external connection to the local server port. The port is read fromwto_ws.cfgnext to the exe.
| exe patch | Purpose |
|---|---|
startup/skip-resource-archive-signature-check |
Skips archive signature verification so modified vromfs files load |
isolation/user-data-folder-name |
Renames the user data folder to WTOffline, separate from the online game |
isolation/registry-key |
Moves registry settings to Software\WTOffline |
isolation/never-load-battleye |
Never loads BattlEye |
isolation/never-upload-crash-reports |
Never uploads crash reports |
isolation/never-launch-official-launcher |
Never launches the official launcher.exe |
online/network-hook-library |
Loads wto_ws.dll instead of WS2_32.dll |
online/accept-local-tls-certificate |
Makes libcurl accept the local server's self-signed certificate |
online/matching-server-public-key |
Replaces the matching server public key with the local server's, so it can decrypt the session key |
battle/allow-local-host-bot-spawns |
Spawns AI vehicles on the local host |
battle/allow-local-host-player-respawn |
Lets the player spawn on the local host in versus modes |
battle/allow-local-host-ucav-launch |
Allows drone launches on the local host |
battle/count-bots-as-active-players |
Counts AI as active players for capture ticket bleed and player-count rules |
Local battles
When queueing, the client only ever connects to a remote battle server as a client, and the client executable does not contain the server-side battle logic. This project works around that as follows:
- 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.
- A UI script patch receives the notification and starts the battle in the game process as a LocalMP host.
- The
local_mp_*modules innative/wto-netrestore 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 inpatches/native/; the build resolves them against the client and writes them intowto_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. - 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
The offline copy and the online game can be installed on the same computer. The copy uses its own game name, so its documents folder, AppData, and registry settings are separate from the online game. Anti-cheat and crash reporting are disabled both by launch arguments (-nobeac, -crashpad-disable-upload) and by exe patches, so running the exe directly does not enable them. All network connections pass through wto_ws.dll.
Patch format
Each patch is a folder described in JSONC. Comments in the files explain why the change is needed and what happens without it.
- exe patches:
variantsinpatch.jsonclists one or more ways to make the change, each written for one client version (written_for).locategives the signature, the section to search and the values to read from the code (captures, such as a jump target);editgives the bytes to write and the expected original bytes (expect_original). Both may contain??; in the bytes to write,fixupsfill them from the captured values. A patch is written only when exactly one variant matches. - UI script patches: each variant names the target script and its fragments (such as
find.nutandreplace.nut). The text to find must match exactly once in the target file; here too a patch is written only when exactly one variant matches.
Every patch lists the features that depend on it in features. patches/versions/<version>.jsonc is the check record of each adapted client version (written by scripts/record-game-version.ts): which variant of every patch applies and where. When a patch is unavailable, the installer lists the affected features. If a patch needed for offline startup, isolation from the online game, or blocking Gaijin connections is unavailable, installation stops (packages/patcher/src/essential-features.ts).
Data folder
The server and the build script share one data folder (--data):
| Path | Contents |
|---|---|
accounts.json |
Local accounts |
saves/ |
One save per local account |
clans.json |
Local squadrons |
cache/ |
Dataset cache extracted from the game files |
logs/ |
Traffic logs, one subfolder per server run |
tuning/ |
Optional tuning overrides, see the next section |
asset-pack/ |
Optional offline image pack, see Development |
Tuning
Values the offline version decides for itself live in apps/server/tuning/*.jsonc. Values that already exist in the game data, such as vehicle prices and reward factors, are always read from the game files.
| File | Contents |
|---|---|
battle.jsonc |
Battle size, AI vehicle pool, nation coalitions, reward multipliers |
battle-economy.jsonc |
Scores for combat events that the game files do not include |
new-profile.jsonc |
Starting currency for new saves |
research.jsonc |
How the default research target is chosen |
store.jsonc |
Local store products and prices |
marketplace.jsonc |
Marketplace purchase limits and fees |
supply-chests.jsonc, trophies.jsonc |
Supply chest prices, reward pools, and weights |
recycling.jsonc |
Item recycling and crafting recipes |
redeem-codes.jsonc |
Redeem codes |
clans.jsonc |
Preset squadrons and activity rules |
limits.jsonc |
Quantity limits |
To override defaults, create tuning/<same file name>.jsonc in the data folder and include only the fields you want to change. Objects are merged key by key. Numbers, strings, and arrays are replaced as a whole. The server validates every field at startup and refuses to start if a type or range is wrong, reporting the file and field.
Development
See Dev Docs for development rules, patch templates, and the PR checklist, or join Discord for development and patch adaptation discussions.
Requirements
- Windows x64
- Node.js 24 or newer
- Visual Studio or Build Tools with the x64 C++ tools, to build
wto_ws.dll - Python 3.12 or newer, only for the patch check tools
- A stock client, preferably a version with a check record (
patches/versions/)
Install dependencies and run the launcher
Run all commands from the repository root.
npm install
powershell -NoProfile -File .\native\wto-net\build.ps1 # writes build\native\wto_ws.dll
node node_modules/electron/install.js
npm run dev --workspace "@wto/launcher"
Build the copy and start the server
--out must be a full game copy, which the installer can create. The build script only reads --game and writes the modified files to --out. Both commands must use the same data folder and port.
node scripts/build-game-copy.ts --game "<stock folder>" --out "<copy folder>" --data "<data folder>" --port 27015
node apps/server/src/cli.ts --game "<copy folder>" --data "<data folder>" --port 27015
Before the first sign-in, select Register on the game login screen or create a local account on the launcher's Saves page. Existing local accounts can sign in directly.
Optional arguments for build-game-copy.ts:
| Argument | Description |
|---|---|
--decal-cache <folder> |
The online installation's cache/content, copied into the copy to show real decals. Without it, placeholder images are used |
--skip-unavailable |
Continue when non-essential patches are unavailable |
--patches <folder> |
Override the patch set root containing exe/, gui/, native/, and versions/ |
--native <folder> |
Override the folder containing wto_ws.dll |
--verbose |
Print the locate result of every patch |
Helper commands
# Edit a save: currencies, free RP, squadron RP, items
node apps/server/src/save-cli.ts --game "<copy folder>" --data "<data folder>" --player <login> --silver 1000000
# On a machine with internet access, download the public images the local store uses, so they show offline
node apps/server/src/asset-pack-cli.ts --data "<data folder>"
Checks
npm run typecheck
npm run typecheck --workspace "@wto/launcher"
npm run build --workspace "@wto/launcher"
wtotools checks whether the patches apply to a given client without writing any files:
python -m pip install -e ./tools
wtotools check-patches --exe "<stock folder>\win64\aces.exe" # locate and verify every exe patch
wtotools check-gui --gui "<stock folder>\gui.vromfs.bin" --sq "<path to sq.exe>" # apply UI patches and compile them with the Quirrel compiler
The GUI check requires the Quirrel compiler. See the build steps.
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
apps/
├── launcher/ Electron installer and launcher (React)
└── server/ Local server
├── src/ Service and rules modules
└── tuning/ Default tuning
packages/
├── blk/ Binary BLK reader and writer, text BLK output
├── vromfs/ vromfs archive reader and writer
├── exepatch/ exe patch locating and writing
├── jsonc/ JSONC parser
└── patcher/ Game copy build
patches/
├── exe/ exe patch definitions
└── gui/ UI script patch definitions
native/
├── wto-net/ wto_ws.dll source (C)
└── third_party/ MinHook
scripts/ Command-line entry for building the game copy
tools/ wtotools, patch check tools (Python)
License
This project is released under the GNU Affero General Public License v3.0 or any later version (AGPL-3.0-or-later). Third-party components keep their own licenses.
Third-party components
- MinHook, BSD 2-Clause License. See native/third_party/minhook/LICENSE.txt.
Disclaimer
This is a non-commercial fan project. It is not affiliated with or endorsed by Gaijin Entertainment. War Thunder and related names and assets belong to their respective owners. The repository does not distribute any game files; you need your own legitimate copy of the game client.