Skip to content

Stored-vehicle actions (Expansion virtual garage): list, retrieve, spawn-move - #9

Merged
bzed merged 17 commits into
mainfrom
feat/stored-vehicles
Nov 13, 2026
Merged

bzed merged 17 commits into
mainfrom
feat/stored-vehicles

Conversation

@bzed

@bzed bzed commented Nov 12, 2026

Copy link
Copy Markdown
Owner

What

Admins can now manage vehicles stored in DayZ Expansion's virtual garage:

  • List: stored vehicles appear in the vehicle list (own section, with the owners that may retrieve them and who stored them) and in dzo vehicle list, marked as stored — never in the map's Vehicles layer (no marker pile-up). A "show on map" link opens the map on the stored position with a single marker.
  • Retrieve (primary flow): take a stored vehicle out of the garage and place it at chosen coordinates, with cargo and fluids, using the same careful placement as vehicle_move.
  • Spawn-move (secondary): change where a stored vehicle will spawn when its owner retrieves it; the new position is validated with IsSpawnPositionFree first, so the "position blocked" problem does not repeat.
  • Notification: online owners get an in-game Expansion notification when an admin retrieved or spawn-moved their vehicle; everything is in the audit log.
  • Policy: experimental DayZ testing (make test-client ARGS=--exp) now runs only on request (AGENTS.md).

Design and plan: docs/superpowers/specs/2026-11-12-stored-vehicles-design.md, docs/superpowers/plans/2026-11-12-stored-vehicles.md.

How

  • dzo-admin (submodule, branch feat/stored-vehicles): collects stored vehicles behind #ifdef EXPANSIONMODGARAGE into the vehicles sync (stored/stored_by/territory_id/owners/broken fields, g... ids) and carries out storedvehicle_retrieve/storedvehicle_move. The spawn-move is transactional: the vehicle is restored with deleteRestored = false, so a failed re-save loses nothing; the garage placeholder is kept alive (its deferred EEDelete would otherwise delete the freshly-written storage file — found in review, verified against the Expansion source).
  • Go: wire fields, cleanup exclusion (stored vehicles are never offered for deletion), two API routes under the teleport permission (409 when the mod does not report the garage feature), web list section + panel forms, map marker + actions, CLI list notes.
  • Test probe: testmods/dzo-garage-probe (test aid, never in a release) manufactures genuine entity-storage .bins via Expansion's own SaveToFile for end-to-end runs.

Verification

  • make check green, coverage 85.9% (min 85%)
  • make test-client (stable) 107 passed / 0 failed; boot checks --no-client and --expansion --no-client clean
  • End-to-end against a local Livonia server with real garage data: list (27 stored, broken flags correct), retrieve (live at target, garage entry + file consumed), spawn-move (position rewritten, file kept), blocked position refused with the blocking object's name, missing-file retrieve refused with the restore error, clean RPT with no player online

bzed added 16 commits November 12, 2026 20:12
test-client --no-client and --expansion --no-client passed.
test-client --no-client and --expansion --no-client passed.
test-client --no-client and --expansion --no-client passed.
The map's Vehicles layer skips the vehicles the Expansion mod keeps in its
virtual garage (they are not in the world), and a map link with sv=<id> draws
one warehouse marker whose menu offers the two garage actions beside removing
it: Retrieve to coordinates and Move spawn point to coordinates, for operators,
posting to the same routes as the vehicle panel's forms.

Wires the web side of those two routes, which Task 6's panel forms already
post to: POST /b/<backend>/i/<instance>/vehicles/<id>/retrieve|/spawnmove,
mirroring the move action (apiclient.Retrieve/SpawnMove, act handlers, routes),
with tests for the operator path and the viewer refusal.

Marker lifecycle note: the marker is not stream-driven; a vehicle that is
retrieved while its marker is open leaves the stale focus marker until it is
removed, the same as today's place links.

make e2e (chromedp, real assets) passes; scripts/test-client.sh --no-client
passes (68 checks, includes the web UI against a real server); the full
client run stays with Task 8's end-to-end gate, as in the earlier tasks.
docs: the stored section and the map's place links describe the marker menu.
The stored-vehicle marker uses fa-archive, which Fork Awesome (the FA4 fork
this UI ships) actually has, instead of fa-warehouse, which it does not (the
marker rendered as an empty ring); it is the same icon the vehicle list's
stored section uses.

TestE2EMapSkipsStoredVehiclesInLayer now stores the vehicle id the layer had
drawn (1.2.3.4) instead of re-sending the never-drawn stored one, so it really
covers the live-to-stored transition: a skip placed after seen[v.id] would
fail it.
…d through the api and web servers

govulncheck flags the HTTP/1 server crash of the MaxBytesReader header
race in the go1.27.3 standard library; go mod tidy also stops listing
rsc.io/qr as indirect (internal/web imports it directly).

make vulncheck and make licenses pass with it.
…rage JSONs

A stored vehicle of the Expansion virtual garage is a pair of an
entity-storage .bin and a garage JSON that references it by global ID, and
the end-to-end run of the stored-vehicles feature needs such pairs without a
player who stores a vehicle. testmods/dzo-garage-probe (servermod, never for
production, the dzo-spawn-probe pattern) makes them: when
$profile:dzo_garage_probe/make exists at mission start, it spawns the
vehicle of a real garage entry at its stored position (OnDebugSpawn, one
SodaCan_Cola in the cargo), saves it with the same call and to the same file
Expansion's own store uses (ExpansionEntityStorageModule.SaveToFile,
ExpansionGarageVehicleData.GetEntityStorageFileName) and deletes it again.
All logic sits in #ifdef EXPANSIONMODGARAGE, so the probe is inert without
Expansion. The global IDs and positions are the ones of two vehicles of the
real garage data the run tests with (OffroadHatchback_Blue, CivilianSedan).

Verified end-to-end against a local Livonia server (dayzOffline.enoch) with
the operator's real garage data: the two probe-backed vehicles list with
broken unset while the other 25 stored vehicles report broken: true;
retrieve puts the vehicle into the world at the target, removes the garage
entry and the .bin; spawn-move changes the stored position and keeps the
.bin; a spawn-move onto a spawned car answers "the spawn point is blocked by
Ada 4x4" and loses nothing; retrieving a vehicle without a .bin answers
"could not restore it from its storage file"; no player was online and the
RPT stayed clean.

Gates: make test-client (107 passed, 0 failed, with
DZO_E2E_ASSETS=/var/tmp/dzo-e2e-dl/root/usr/share/javascript) and make check
(total coverage 85.9%, minimum 85%) passed.
The mod injects the vehicles stored in the Expansion virtual garage into
the vehicle sync, so dzo vehicle list printed them with health 0.00 fuel
0.00 crew 0, indistinguishable from abandoned wrecks. vehicleNote now
says whose garage holds a stored vehicle (or the territory's), and marks
one whose entity-storage file is lost as having no storage file.
TestSyncParsesStoredVehicle asserted both fields at their zero values, so
a typo'd JSON tag would have silently passed: the unit test is the only
automated guard on the mod's vehicle wire contract. Set territory_id and
broken to non-zero values and assert them exactly.
@codecov

codecov Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.47%. Comparing base (ce7f7b7) to head (0add22d).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #9      +/-   ##
==========================================
+ Coverage   86.43%   86.47%   +0.04%     
==========================================
  Files         215      215              
  Lines       21016    21071      +55     
==========================================
+ Hits        18165    18221      +56     
+ Misses       2841     2840       -1     
  Partials       10       10              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bzed
bzed merged commit 7148926 into main Nov 13, 2026
22 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant