Copy allowedKillStreaks and set useKillStreaks for Ground Arcade in battle-mission-settings.ts, and add a dedicated dynamic native module (local_mp_air_events) that preserves MissionSettings.useKillStreaks across prepare_local_mission, credits local player AI kills toward native killstreak counters, delivers UnitRespawn (0xf030) to the LocalMP host via shared unit_on_event, and recovers invalid surface poses from gameplay.blk spawnPos parameters for the match rank.
Based on PR #3 by Rivfflot, who diagnosed the LocalMP Ground Arcade air-event gaps and verified the fix in-game; refactored here onto patches/native dynamic resolution for cross-version and MSVC build compatibility.
Checked: root and launcher typecheck, MSVC native/wto-net/build.ps1, native resolution across 2.61.0.37 and 2.61.0.58 (12/12 modules), 2.61.0.58 check-patches (14/14), and temporary 2.61.0.58 copy build all passed. Pending in-game acceptance on the refactored module.
Co-authored-by: Alem Bek <[email protected]>
Pressing ID_SQUAD_TARGET_DESIGNATION ("Set target for squad") checks
MPlayer+0xab0 (squadId) and returns early when it is zero (2.61.0.58
0x1600a4f). The LocalMP host already retains the 0xf10f relay and
0xf142 HUD indicator path (0xcb045c -> 0xcb1646 -> 0xcafffb ->
0x19a65e0), which also requires a non-zero squadId from matchingInfo+0x0.
Set matchingInfo+0x0 (squadId) to 1 for the local player when zero in
hook_mplayer_init_from_matching so MPlayer::initFromMatching (0x59e660
on 2.61.0.37, 0x59f370 on 2.61.0.58) copies it into MPlayer+0xab0 and
restores the yellow squad target marker without extra hooks or exe patches.
Verified with native wto_ws.dll build; pending in-game verification.
Connect Air Realistic sub-mode 103 (Nuclear Escalation) mission launch
settings and LocalMP respawn/airfield-cooldown handling:
- Server: support mode-level maxRespawns (UNLIMITED_RESPAWNS = -2) and
per-mode missionRuleKeys so Nuclear Escalation forwards customHUD,
stage thresholds, useSpawnDelay, afterRespawnDelaySec, and battle
display flags from the stock missions; reject queues when no candidate
mode is eligible for the lineup; disable spares and emit
wtoUnlimitedRespawns for unlimited-respawn modes.
- Native: keep slots usable when wtoUnlimitedRespawns is set and emit
wtoLocalMpAirfieldSpawn with the unit name and spawn base ID when the
local player actually enters pilot control.
- GUI patches: track confirmed LocalMP airfield departures in
scripts/respawn/respawnbases.nut and feed the computed per-base delays
into scripts/respawn/respawn.nut slot countdowns and spawn checks.
Stage-unlocked dedicated event aircraft allocation by faction and room
BR is not yet wired and remains pending research. Verified with root and
launcher typechecks, check-patches and check-gui on 2.61.0.37 and
2.61.0.58, and native wto_ws.dll build; pending in-game verification.
Unit::loadCrew previously skipped reading the player's equipped crew from
the profile whenever Multiplayer+0x60 (host flag) was non-zero, leaving
human players with default skills and no Expert/Ace bonuses. Calling
UnitCrewSkills::initFromSave after Unit::changeAircraft in the native
loadout hook ran too late to affect live vehicle crew state.
Add exe patch battle/load-local-host-player-crew to check both the host
and LocalMP flags (+0x60 and +0x61) in Unit::loadCrew so only non-LocalMP
hosts skip directly to the default crew while preserving the owner check.
Remove the late initFromSave workaround from local_mp_loadout.c (keeping
its native patch sites for compatibility with 0.1.2 hook DLLs) and add
the E-Crew skills in battle feature labels to the launcher locales.
Verified with check-patches on 2.61.0.37 (0x10025dd) and 2.61.0.58
(0x100700d), native wto_ws.dll build, launcher typecheck and build;
pending in-game verification.
Add a quick ZIP log export button to the About page (also bundling the latest embedded browser -browser.log while excluding player saves) and add a runtime logging toggle under Settings -> Diagnostics that controls launcher file logs, local server traffic logs, and wto_ws.log via log=0 in wto_ws.cfg. Update the v0.1.2 release note accordingly.
Replace the ineffective hero_unit comparison with producer-side hooks on the two stock LocalMP leaks:
1) Avionics/electronics failure dispatcher (2.61.0.37 0xfca8b0, .43 0xfce8e0): track the damaged Unit* from [component + unit] on the current thread and suppress HUD_MSG_DAMAGE notices and optic-view exits (0x15cd9c0) for non-local units while keeping native failure effects intact.
2) Unit::onEvent hit-parts fallthrough (2.61.0.37 0x103fbc0, .43 0x1043fe0): track the hit event on the current thread and filter enqueue_enemy_parts, hit_cam_important, and naval_hit_state to attacks from the local controlled unit, local MPlayer's units (in-flight munitions after switching), or the watched spectator unit.
Checked: native/wto-net/build.ps1 compiles with zero warnings in project sources; checkPatchSet, root and launcher typechecks, 2.61.0.37 check-patches, and native module resolution on both 2.61.0.37 and 2.61.0.43 (11/11 modules ready, 0 failures) pass. In-game verification pending.
Switch ws2_32 and LocalMP hook installers to MH_QueueEnableHook with two MH_ApplyQueued passes (mandatory network hooks first, then all LocalMP modules), reducing DllMain thread-freeze cycles from 26 to 2. Roll back partial module hooks on error and log MH_StatusToString diagnostics to wto_ws.log.
Checked: native/wto-net/build.ps1 compiles cleanly with zero warnings in project sources, and PE inspection confirms WS2_32/KERNEL32 imports and 49 exports. In-game verification pending.
The stock control-loss hints are pushed as HUD_MSG_DAMAGE with the text
chosen by a HUD text index, not by the damaged handler, so the barrel and
breech filter in local_mp_damage_notifications never saw them. The hint
refresh describes the unit in the hero manager's current-hero cell, one
process-wide slot that can be left on another unit on a LocalMP host.
Hook the HUD_MSG_DAMAGE delivery (2.61.0.37 0x19b1030, 2.61.0.43
0x19b6ba0) and drop hints with text indices 261..283 whose described unit
is not the unit the local MPlayer controls. Suppressed hints are logged up
to 12 times so a filter that never fires is visible in wto_ws.log.
Checked: native DLL build; check-patches on 2.61.0.37; temporary copy
builds of 2.61.0.37 and 2.61.0.43 report the executable, GUI and native
patches all ready (11 native modules). In-game acceptance is pending.
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.
Everything sat in packages/: two programs next to the small libraries
they use, and the patch data loose at the root. The programs now live in
apps/ and the shared libraries in packages/:
apps/server the local server (was packages/local-service),
package @wto/server
packages/patcher builds the game copy (was packages/build),
package @wto/patcher
patches/exe exe patch definitions (was exe-patches)
patches/gui GUI script patches (was gui-patches)
Inside the server, the network layer folder becomes transport/ so it is
not server/server/, the entry module is server.ts, and startLocalService
and its types become startServer, ServerOptions and RunningServer. The
health answer names the app wto-server, and the TLS files in the data
folder are server.key and server.crt (made again on the next start).
Comments, logs and tool texts say "local server".
The patcher no longer reaches into the server's folder. It read the
default tuning/store.jsonc by a relative path to register bundle GUIDs
for the multi-vehicle packs, which also ignored the player's overrides
in <data>/tuning/. It now takes the pack ids from its caller; the
server exports multiVehiclePackIds(dataFolder), which reads them the way
the running server does. rebuildGuiPack takes the patch folder from its
caller as well.
The development build moves out of the patcher to
scripts/build-game-copy.ts, since it uses both the server and the
patcher. It needs --data (the folder the server will run with) and
defaults the patch folders and the hook library to this repository.
Checked with the root typecheck, check-patches, check-gui,
check-offsets, the native build, a run of build-game-copy.ts into a
scratch folder (12 exe patches, 35 GUI patches, 496 bundle GUIDs as
before) and a server start from apps/server answering wto-server.
BREAKING CHANGE: Use @wto/server and @wto/patcher from the new workspace paths. Run the development build with scripts/build-game-copy.ts and pass --data.
Clearing missionSupportUnitRef as soon as the support unit died kept the
player from getting the vehicle back: the unit update (2.61.0.37
0xfd1450, 0xfd2f01 / 0xfd25a7) recognises the player's dead support
unit by that reference (unit +0x88 == MPlayer +0xb58) and only then calls
setControlledUnit(mp, 0) (0x598a70) to return control. In game the
camera stayed on the wreck until the player respawned.
Remember the player and the dead unit's entity id at the death, and
clear the reference after setControlledUnit has run for that player
(new hook, LMP_SIG_SET_CONTROLLED_UNIT, 2.61.0.37 hit 0x598a70), as
long as it still names that unit.
Checked with the native build and check-offsets; not yet verified in
game.
After the first nuclear carrier was shot down, the next launch respawned
it in the air where it died and the player could not fly it. The host
gives a player a support unit only while missionSupportUnitRef (MPlayer
+0xb50 / +0xb58) is empty (2.61.0.37 0x59d9c8), and the client clears
the reference only when the player is re-initialised, never during a
battle. The second launch reused the dead unit: control was refused
("changed controlled unit to already dead unit"), and without an owner
the respawn (0xe4fdf0) placed it at its old position instead of an
airfield.
Clear a player's reference when the unit it names dies (in the existing
onUnitDeadOnce hook, host only), so the stock update creates a new
support unit the next time the spawn score threshold is reached.
Checked with the native build and check-offsets; not yet verified in
game.
Online the battle server gives killStreak_bomber_nuclear_success (mode
killStreakNuclearSuccess, 10000 SL) when a player's nuclear bomb
explodes; the LocalMP host has no battle server, so the award was never
given.
The native nuke module now remembers whether the local player launched
the instant-win bomb and, when it explodes, raises the HUD script event
wtoLocalMpNuclearStrike. The battle record keeps it as a strike, sends
it live (wto_battle.fact kind "strike") and reports it after the battle
(strikes{}); the local service awards killStreakNuclearSuccess once per
strike, live as the award banner and in the settlement.
Checked with typecheck, check-gui, check-offsets and the native build;
not yet verified in game.
cta_logic_action walks the variable array with r15 = entry+8, compares the name
at [r15-8] and takes the value at r15+8 (0x11bd1a6), so the int value is at
entry+0x10; the nuclear win wrote the wrong field and the tickets stayed.
create_nuke_destr_area_es does not run on the LocalMP host. The projectile
explosion handler 0xbe7c00 gets the launch record's instant-win flag as its
8th argument (0x2fd778 / 0x2fd7c3) and is what plays the nuclear explosion,
so the winner is now taken there.
Online the battle server ends the battle when a bomb with isInstantWinOnExplode
explodes; the 2.61.0.37 client only flags the bomb, so the LocalMP host played on.
The host now remembers the team of a flagged bomb (0x1431c10), takes it as the
winner when create_nuke_destr_area_es runs (0x63caf0), and zeroes the loser's
mission ticket variable before cta_logic_action (0x11bc400), which then ends the
battle the stock way.
The header of local_mp_loadout.c still named per-unit economic multipliers that
the economy rework removed from the module. It now says what the module does: on a
host the client has no receiver for its own vehicle change request, so the send
hook builds the ChangeUnitReflection and calls Unit::changeAircraft. Comment only.
Checked: native build, check-offsets.
- Scoreboard scores come from the local service: BattleEconomy
missionScores() writes the official mission scores into the stock
mission block customScoreParams, which the client copies into
MissionSettings+0x6d8 without reading it; local_mp_scores.c reads them
with DataBlock::getReal. The hardcoded scores and the death score go.
- countActivePlayers already counts players with a living vehicle; the
only LocalMP gap is its filter skipping bots (MPlayer+0x1d8 bit 7). A
one-byte exe patch drops that filter bit instead of a rewrite hook.
- ucavLaunch returns early on a host; an exe patch skips that return
instead of clearing the global host flag around the call.
- onBecameDead no longer runs with isLocalMP cleared: that only queued an
EventOnPlayerDeath stock LocalMP skips on purpose, and broke the local
player id remap inside the function.
- The host chat object keeps its two-field layout, now documented from
the host chat handler that reads it.
The LocalMP host has no battle server, and the previous bridge filled the
gap by computing money in the client: the native ledger wrote invented
amounts into SessionStatsNet, the spawn patch derived reward rates from
warpoints.blk, and the settlement patch summed and rescaled the result.
Rewards came out as zero or several orders of magnitude too high.
Now the client reports facts and the local service prices them.
Native (wto_ws.dll):
- local_mp_ledger.c is removed together with its SessionStatsNet
offsets and four signatures (43 -> 39).
- local_mp_awards.c raises the HUD script event wtoLocalMpExpEvent for
every combat event of the local player (event code, victim expClass
and name, player or AI victim, friendly, naval damage). The DataBlock
helpers and the HUD event queue are resolved from call sites inside
GameSaveData::addScoreMessage, which already has a signature.
GUI patches:
- record-local-battle-awards records events and lives in nestdb and
raises the stock InBattleReward banner from launch-time parameters.
- report-local-battle-settlement sends only facts and rebuilds the
debriefing from the settled table; failures show the stock error box.
- use-settled-debriefing-stats makes gatherDebriefingResult read that
table instead of the empty stat_get_exp().
- pass-spawn-modifications-blk no longer computes economy factors.
Local service:
- battle-economy dataset reads every reward factor from wpcost.blk,
warpoints.blk and rank.blk; tuning/battle-economy.jsonc holds the
mission score per event with its source (official values where
published, otherwise marked).
- battle-economy.ts is the single pricing function, shared by the
banner parameters and the settlement; battle-rewards.ts adds battle
time, timed award, win/defeat bonus, activity, premium account,
talisman, skill bonus and free research points; the debriefing table
has the stat_get_exp() layout and travels in EULT_SESSION_RESULT.
- Crews earn skill points from the battle's research points.
- A battle left before it ends counts as a defeat.
Verified: npm run typecheck, check-gui (35 patches), check-patches,
check-offsets, native build. Not yet run in game.
Records the uncommitted battle-session work exactly as it was left
(local service matchmaking, settlement, chat, native LocalMP hooks,
battle gui/exe patches) so the following review and rework commits
show every correction as a diff against this state.
This commit is not reviewed and is known to be incomplete: in-game
testing reported wrong settlement rewards, single-country teams,
missing random/fixed supplement slots, misattributed hit messages and
other regressions. Do not merge this branch before the rework lands.
Use the loopback service certificate for the offline HTTPS path. Retain
original host names for host-based routing and allow the network log
to be read while the client is running.
Build the socket library and client-local port configuration for redirecting
traffic to the offline service. Accept HTTPS and the existing matching and
HTTP protocols on the same port. Route requests by the original host.