refactor(patches)!: migrate definitions to JSONC and script fragments
Patch definitions under exe-patches/ and gui-patches/ move from patch.json/locate.json to patch.jsonc/locate.jsonc. Each file now holds only the data needed to apply the patch plus a short English comment stating what it changes, why the local service cannot provide it, and what happens without it. Every definition records the game versions it was verified on (verified_on, required). GUI patches keep their stock text and replacement in find.nut and replace.nut next to patch.jsonc instead of escaped JSON strings, so the script edits are readable, diffable and can carry Quirrel comments. Matching treats CRLF and LF as the same line break because stock scripts mix both; only the matched span is rewritten. Loaders on both sides (packages/build, packages/exepatch, wtotools) reject unknown keys so analysis text cannot creep back into the data. JSONC parsing moves into a shared @wto/jsonc package; the build now parses tuning/store.jsonc instead of scanning it with a regex. Verified: npm run typecheck; check-patches (10/10 ready on 2.61.0.37); check-gui (33 patches, 24 scripts compile); the TypeScript and Python appliers produce identical scripts, byte-identical to the previous definitions except one stock script with mixed line endings. The 15 battle patches are migrated mechanically and still carry the pending-review comment; they are rewritten by the LocalMP review. BREAKING CHANGE: Patch loaders require JSONC definitions. Migrate patch.json and locate.json and move embedded GUI edits to separate Quirrel files.
This commit is contained in:
1 parent
b260d2899e
commit
db981ab834
185 files changed
+2676
-1487
No files matched your search
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"method": "signature",
|
||||
"section": ".rdata",
|
||||
|
||||
"how": [
|
||||
"常量区里的 \"WarThunder\" 字符串,连同前一个字节(上一个字符串的结尾 0)和后面紧跟的 \"War Thunder\",共 24 字节,用来确保命中的是身份表引用的那一处。",
|
||||
"在 2.61.0.37 原版 aces.exe 上唯一命中 0x777eb96,字符串本身在 0x777eb97。"
|
||||
],
|
||||
|
||||
"pattern": "00 57 61 72 54 68 75 6e 64 65 72 00 57 61 72 20 54 68 75 6e 64 65 72 00"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "WarThunder" with the preceding string terminator and the following "War Thunder", 24 bytes,
|
||||
// so the hit is the copy referenced by the game identity table.
|
||||
// 2.61.0.37: unique hit at 0x777eb96, string at 0x777eb97.
|
||||
{
|
||||
"method": "signature",
|
||||
"section": ".rdata",
|
||||
"pattern": "00 57 61 72 54 68 75 6e 64 65 72 00 57 61 72 20 54 68 75 6e 64 65 72 00"
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
{
|
||||
"id": "isolation/user-data-folder-name",
|
||||
"title": "把游戏名从 WarThunder 改成 WTOffline,让离线版的用户数据目录和正版分开",
|
||||
|
||||
"program_behaviour": {
|
||||
"stock": "程序的游戏身份表里,游戏名是 \"WarThunder\"。引擎的文件夹模块用它拼出用户数据目录:我的文档\\My Games\\WarThunder(设置、上次登录的账号、机器识别码),以及 AppData\\Local\\WarThunder;日志路径、内置浏览器缓存、\"同一时间只能运行一个游戏\" 的检查也用它。这些位置和 Steam 正版完全相同。",
|
||||
"patched": "游戏名变成 \"WTOffline\"。上面这些位置全部变成离线版自己的:我的文档\\My Games\\WTOffline 等,正版的数据既不会被读到,也不会被改写。"
|
||||
},
|
||||
|
||||
"derivation": {
|
||||
"requirement": "开发纪律第 18 条、功能清单 A「与正版隔离」:离线版不得读写正版的任何数据。实测中,未打这个补丁的副本在退出时改写了正版账号的 global.blk、machine.blk,并把\"上次登录的账号\"改成了测试账号。",
|
||||
"cause": "目录由引擎按游戏名拼出(DagorEngine prog/gameLibs/folders/platform/windows.cpp,get_gamedata_dir:我的文档 + \"My Games\" + 游戏名),游戏名是程序里的常量。",
|
||||
"lighter_options_ruled_out": [
|
||||
"原生自带:文件夹模块没有改默认目录的配置项(folders.cpp:load_custom_folders 只能新增具名位置,不能覆盖 gamedatadir)。",
|
||||
"本地服务:不适用。这是客户端在本机读写文件,不经过网络。",
|
||||
"换 Windows 用户运行:只适合开发期的观察,不能要求玩家这样做。"
|
||||
],
|
||||
"conclusion": "只能改 exe。改的是数据(一个字符串),不改代码。",
|
||||
"if_not_applied": "离线版会读写正版的设置目录:退出时改写正版账号的设置,登录时改写\"上次登录的账号\"。"
|
||||
},
|
||||
|
||||
"why_this_site": [
|
||||
"游戏身份表(0x7a9a7c8)的游戏名字段和第三个字段都指向这同一个字符串,程序里其他地方不直接引用它。改这一个字符串,所有由游戏名派生的位置一起改变。",
|
||||
"用到游戏名的 13 处都已核对:反作弊初始化、浏览器缓存路径、日志路径、单实例检查、脚本里的 app 名、语音客户端名、Steam 初始化。没有一处影响玩法;原版界面脚本不按游戏名分支。",
|
||||
"新名字比原来短,原地替换即可,不需要新增数据。"
|
||||
],
|
||||
|
||||
"features": ["A-与正版隔离"],
|
||||
"requires": [],
|
||||
"evidence": [
|
||||
"2.61.0.37 原版 aces.exe:身份表 0x7a9a7c8 = { \"WarThunder\", L\"Software\\\\Gaijin\\\\WarThunder\", \"WarThunder\", \"wt\", …, \"production\", \"aces.vromfs.bin\" }。",
|
||||
"Original client logs show that the default save directory is shared with the retail installation.",
|
||||
"尚未在游戏里验证改名后的效果,由隔离观察(local development tool)确认。"
|
||||
],
|
||||
"verified_on": [],
|
||||
|
||||
"edit": {
|
||||
"offset": 1,
|
||||
"data": { "encoding": "ascii", "text": "WTOffline" },
|
||||
"bytes": "57544f66666c696e6500",
|
||||
"expect_original": "5761725468756e646572"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// Rename the game from WarThunder to WTOffline, which moves every per-user data folder.
|
||||
// Why the executable: the engine derives Documents/AppData folders from this constant name.
|
||||
// Without it: the offline client reads and rewrites the retail client's settings.
|
||||
{
|
||||
"id": "isolation/user-data-folder-name",
|
||||
"title": "把游戏名从 WarThunder 改成 WTOffline,让离线版的用户数据目录和正版分开",
|
||||
"features": [
|
||||
"A-与正版隔离"
|
||||
],
|
||||
"requires": [],
|
||||
"verified_on": [
|
||||
"2.61.0.37"
|
||||
],
|
||||
"edit": {
|
||||
"offset": 1,
|
||||
"data": {
|
||||
"encoding": "ascii",
|
||||
"text": "WTOffline"
|
||||
},
|
||||
"bytes": "57544f66666c696e6500",
|
||||
"expect_original": "5761725468756e646572"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user