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:
N0VAN0M4LY committed 2026-11-29 12:26:11 +08:00
1 parent ddec5c59c0
commit 6ce93ee962
23 files changed
+721 -805

No files matched your search

+2 -5
View File
@@ -98,12 +98,9 @@ static void __fastcall hook_set_controlled_unit(uint8_t *mp, uint32_t eid)
}
}
int install_local_mp_support_hooks(const uint8_t *text, size_t text_size)
int install_local_mp_support_hooks(void)
{
uint8_t *p_set = local_mp_scan_unique(text, text_size, "setControlledUnit", LMP_SIG_SET_CONTROLLED_UNIT);
if (!p_set)
return 0;
uint8_t *p_set = g_lmp.set_controlled_unit;
if (MH_CreateHook(p_set, (void *)&hook_set_controlled_unit, (void **)&orig_set_controlled_unit) != MH_OK ||
MH_EnableHook(p_set) != MH_OK) {
log_line("local_mp: failed to install the support unit hook");