Files
WT-Offline/patches/native/local_mp_players.jsonc
T
N0VAN0M4LY fdac56a036 refactor(native)!: load LocalMP values from the build configuration
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.

BREAKING CHANGE: Rebuild game copies to generate the new native values in wto_ws.cfg. Use record-game-version.ts or the launcher patch check in place of wtotools check-offsets.
2026-11-29 12:26:11 +08:00

154 lines
4.5 KiB
JSON

// Player state on the LocalMP host (native/wto-net/src/local_mp_players.c): team from the hangar
// country, GUI states, crew slots used, spare vehicles.
// Without it: the player cannot pick a vehicle or spawn in a LocalMP battle.
{
"module": "local_mp_players",
"features": [
"K-Spawn score and respawns"
],
"requires": [
"local_mp_core"
],
"sites": {
// MPlayer::initFromMatching.
// 2.61.0.37: 0x59e660
"mplayer_init_matching": {
"variants": [
{
"written_for": "2.61.0.37",
"locate": {
"method": "signature",
"pattern": "41 56 56 57 55 53 48 81 ec e0 00 00 00 48 89 d7 48 89 ce 48 89 91 90 0c 00 00 48 8d 8c 24 88 00 00 00 0f 57 c0 0f 11 84 24 b8 00 00 00 0f 11 84 24 a8 00 00 00 0f 11 84 24 98 00 00 00"
}
}
]
},
// is_crew_slot_was_ready_at_host.
// 2.61.0.37: 0x17a31d0
"is_slot_ready_at_host": {
"variants": [
{
"written_for": "2.61.0.37",
"locate": {
"method": "signature",
"pattern": "41 56 56 57 55 53 48 81 ec a0 00 00 00 0f 29 b4 24 90 00 00 00 44 89 c3 48 89 d6 48 83 3d"
}
}
]
},
// MPlayer GUI state byte.
// 2.61.0.37: 0x155f6f1 (movzx r15d, byte ptr [rdi + 0x640]; movsxd r12, esi; lea rax, [rip + 0x5d757fd])
"mplayer_gui_state": {
"variants": [
{
"written_for": "2.61.0.37",
"locate": {
"method": "within",
"in": "set_player_gui_state",
"pattern": "44 0f b6 bf ?? ?? ?? ?? 4c 63 e6 48 8d 05 ?? ?? ?? ??",
"captures": {
"gui_state": {
"offset": 4,
"type": "u32"
}
}
}
}
]
},
// MPlayer::clearBeforeLobby.
// 2.61.0.37: 0x599680 (push r15; push r14; push r13; ...)
"mplayer_clear_before_lobby": {
"variants": [
{
"written_for": "2.61.0.37",
"locate": {
"method": "signature",
"pattern": "41 57 41 56 41 55 41 54 56 57 55 53 48 81 ec 98 00 00 00 0f 29 b4 24 80 00 00 00 48 89 ce 83 b9 0c 0c 00 00 00"
}
}
]
},
// MPlayer used spare vehicles mask, reset after the broken slots mask.
// 2.61.0.37: 0x59a102 (cmp dword ptr [rsi + 0x520], 0; je 0x59a129; lea rcx, [rsi + 0x500])
"mplayer_used_spares": {
"variants": [
{
"written_for": "2.61.0.37",
"locate": {
"method": "within",
"in": "mplayer_clear_before_lobby",
"pattern": "83 be ?? ?? ?? ?? 00 74 ?? 48 8d 8e 00 05 00 00",
"captures": {
"used_spares": {
"offset": 2,
"type": "u32"
}
}
}
}
]
},
// MissionSettings allies country.
// 2.61.0.37: 0x1277500 (mov rcx, qword ptr [rcx + 0xd0]; jmp 0x127751f; xor r10d, r10d)
"mission_allies_country": {
"variants": [
{
"written_for": "2.61.0.37",
"locate": {
"method": "within",
"in": "get_player_country",
"pattern": "48 8b 89 ?? ?? ?? ?? eb ?? 45 31 d2",
"captures": {
"allies_country": {
"offset": 3,
"type": "u32"
}
}
}
}
]
},
// MissionSettings axis country.
// 2.61.0.37: 0x1277518 (mov rcx, qword ptr [rcx + 0xc8]; test rcx, rcx; lea r10, [rip + 0x67c23d8])
"mission_axis_country": {
"variants": [
{
"written_for": "2.61.0.37",
"locate": {
"method": "within",
"in": "get_player_country",
"pattern": "48 8b 89 ?? ?? ?? ?? 48 85 c9 4c 8d 15 ?? ?? ?? ??",
"captures": {
"axis_country": {
"offset": 3,
"type": "u32"
}
}
}
}
]
},
// MissionSettings arcade country mode.
// 2.61.0.37: 0x127748a (cmp byte ptr [rcx + 0x1d0], 1; jne 0x12774ee; movzx ecx, byte ptr [r10 + 0x250])
"mission_arcade_country": {
"variants": [
{
"written_for": "2.61.0.37",
"locate": {
"method": "within",
"in": "get_player_country",
"pattern": "80 b9 ?? ?? ?? ?? 01 75 ?? 41 0f b6 8a 50 02 00 00",
"captures": {
"arcade_country": {
"offset": 2,
"type": "u32"
}
}
}
}
]
}
}
}