Repository navigation
Stored-vehicle actions (Expansion virtual garage): list, retrieve, spawn-move - #9
Merged
Merged
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Admins can now manage vehicles stored in DayZ Expansion's virtual garage:
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.vehicle_move.IsSpawnPositionFreefirst, so the "position blocked" problem does not repeat.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, branchfeat/stored-vehicles): collects stored vehicles behind#ifdef EXPANSIONMODGARAGEinto the vehicles sync (stored/stored_by/territory_id/owners/brokenfields,g...ids) and carries outstoredvehicle_retrieve/storedvehicle_move. The spawn-move is transactional: the vehicle is restored withdeleteRestored = false, so a failed re-save loses nothing; the garage placeholder is kept alive (its deferredEEDeletewould otherwise delete the freshly-written storage file — found in review, verified against the Expansion source).garagefeature), web list section + panel forms, map marker + actions, CLI list notes.testmods/dzo-garage-probe(test aid, never in a release) manufactures genuine entity-storage.bins via Expansion's ownSaveToFilefor end-to-end runs.Verification
make checkgreen, coverage 85.9% (min 85%)make test-client(stable) 107 passed / 0 failed; boot checks--no-clientand--expansion --no-clientclean