Repository navigation
Last driver of vehicles, previewed cleanup and database backup - #5
Merged
Merged
Conversation
…atabase backup Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mod reports driver, driver_name and driven_ago per vehicle; the hub validates them (Steam ID, finite age within 400 days), sets DrivenAt and clips the name. Bad values drop the drive but keep the vehicle. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ing snapshots Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ost_backup hooks serve.db_backup_hours (default 24, 0 = off) and serve.db_backup_keep (default 7) control VACUUM INTO copies in <paths.db>/backup; the newest is passed to post_backup hooks as extra.db_backup. Documented in configuration.rst, backups.rst and moderation.rst. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
GET /instances/<i>/vehicles merges the vehicle records (last driver, last drive, first seen) into the live vehicles; without a database the list is the mod's, unchanged. The stream is not changed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… for admin.vehicle_forget_days A recorder per instance (internal/vehicles, like internal/presence) writes each vehicle snapshot of the mod to the vehicle records and sweeps hourly for records hidden longer than admin.vehicle_forget_days (default 7, at least 1, per instance). No snapshot yet hides nothing; an empty one hides the records without deleting them. serve starts it after the store opens, updates it on reload and stops it before the store closes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rmed selection of them GET /instances/<i>/vehicles/unused?days=N previews the vehicles without crew, not covered, unused for more than N days; POST .../vehicles/cleanup re-checks every id and deletes only those still unused (never force), skipping the rest with a reason. Both refuse with 409 when the mod does not report drivers. Audited per vehicle; apiclient methods added. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
dzo-admin remembers, in RAM only, who last took the driver's seat of each car, motorbike and boat (OnDriverEnter) and reports driver, driver_name and driven_ago per vehicle, plus the hello feature "driver". Nothing is stored on the vehicles. The submodule pointer and servermods.lock move to the new commit (PBO rebuilt); test-client gets three checks (car has a driver, hello feature, vehicle record keeps the last driver). make test-client was NOT run in full (a DayZ client of the user was running); only `--no-client` on stable and --exp, which boots the server with the new PBO. The player checks and the "vehicle record" check (needs the API of the Go record tasks) still have to be run after the merge. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e vehicle on the map Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… time, after a preview and a confirmation The vehicle list gets a Clean up button for people who may delete vehicles. The step offers 14, 30 and 60 days or a custom 1..3650, previews the unused vehicles, and sends exactly the previewed ids after a browser confirmation; the API re-checks each one. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nup preview at 500; bound two day/hour settings - vehicles: the recorder records nothing while the hub's hello lacks the driver feature, so a vehicle's age does not start before the mod can report drivers - web: the cleanup preview lists the 500 longest unused vehicles and says how many match in all, so the confirm (max 500 ids) can proceed - config: admin.vehicle_forget_days <= 3650 and serve.db_backup_hours <= 87600; larger values overflowed time.Duration Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5 +/- ##
========================================
Coverage 86.42% 86.42%
========================================
Files 210 215 +5
Lines 20465 21016 +551
========================================
+ Hits 17686 18163 +477
- Misses 2769 2843 +74
Partials 10 10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
DayZ 1.30 is the stable version, so dzo no longer supports 1.29 servers with the mod. dzo-admin (submodule) drops every DAYZ_1_29 conditional and uses the 1.30 code unconditionally: motorbikes, boats and the last-driver tracking are no longer left out on 1.29. Breaking: dzo-admin 0.8.0 does not compile on a DayZ 1.29 server; such a server has to stay on dzo-admin 0.7.x (and the dzo that ships it). - servermods.lock: the new submodule commit; the PBO is rebuilt and its checksum updated. - docs/development.rst: a servermod targets 1.30 only; it is booted on the stable and the experimental server, no more #ifdef DAYZ_1_29. - README.md, docs/admin-map.rst, scripts/test-client.sh: the 1.29 notes are gone; --exp is the next build, not 1.30. make test-client was not run for this change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…kup directory; forget the vehicle records of removed instances The copy is created 0600 before VACUUM INTO fills it, an existing backup directory is set to 0750. Records of instances no longer on the site are hidden and forgotten after the default period. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ted request; fa-eraser; document the raw driver fields The cleanup queues every vehicle_delete, waits for all answers under one 25 s deadline and lists a refused or unanswered vehicle as skipped with the reason. Adds Hub.Wait. The unknown fa-broom icon becomes fa-eraser. docs/api.rst lists driver, driver_name and driven_ago. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The registry only ever added hubs, so a removed instance stayed in Registry.Names() until dzo serve restarted: its vehicle records were not forgotten after 7 days as configuration.rst says, and its mod could still connect. AddHubs now calls Registry.Retain with the instances of the site. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hub.byID kept every command for the life of dzo serve, and a vehicle cleanup adds up to 500 at once. A result is now readable for 10 minutes after it arrived (or the command timed out), then dropped. Result tells an unknown or forgotten id apart (ErrUnknownCommand), and GET /instances/<i>/commands/<id> answers 404 for it instead of a 202 "pending" that never ends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A vehicle_delete the mod did not answer within the 25 seconds of the
request was reported and audited as skipped ("no answer from the mod"),
although the command stays queued and the mod may still delete the
vehicle. The answer now has a "pending" list with the id and the command
id, the audit entry says "no answer yet, the mod may still delete it
(command <id>)", and the web page lists them apart and asks to reload the
vehicle list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The label held only the Expansion owner, so on vanilla it was the bare class and the last driver never showed. It is now "<class> (owner <owner>, last driver <driver>)", each part only when known; a driver without a known name is named by the Steam ID. Owner and last driver are different things, so both are shown even when they match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A boat cannot capsize in the game, so flipping one has no use. The hub refuses vehicle_flip for a vehicle of kind boat (the mod's kind or admin.vehicle_kinds) with "admin: boats cannot be flipped" (400), the web panel of a boat has no flip button, and dzo-admin refuses it as well (vanilla and Expansion boats). Repair, move and delete of boats are unchanged. test-client.sh checks the refusal instead of a boat flip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since dzo-admin 0.8.0 the hello lists "driver" first, so the log line is "features: driver expansion" and the check for "features: expansion" failed although Expansion was reported (all Expansion message checks passed). The check now looks for expansion anywhere in the feature list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bzed
force-pushed
the
feature/vehicle-last-driver
branch
from
November 1, 2026 21:16
cb01d5e to
fd4900f
Compare
… outside a pipe Far out at sea (7000/300) the server removed the spawned boats within seconds, so every boat check after the spawn failed. Both boats now spawn in the water west of Chernogorsk (4298/1811). The refused flip exits 1, which under pipefail failed `dzo ... | grep -q` even when the text matched; the output is now matched outside the pipe. make test-client ARGS='--no-client --expansion' passed (74 passed, 0 failed), both boats included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The flip works on boats: it lifts the boat by a metre and stands it level, and the boat settles back on the water. The hub queues vehicle_flip for a boat again, the web panel of a boat has the flip button again, and dzo-admin flips vanilla and Expansion boats (servermods.lock back to the PBO before the refusal). This reverts "admin: boats are not flipped" (6a0d248). test-client.sh flips both boats and checks that they float afterwards. make test-client ARGS='--no-client --expansion' passed (76 passed, 0 failed): Boat_01_Orange and ExpansionZodiacBoat_Orange float after the flip (DayZ 1.30 stable). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
driver); DayZ 1.29 guards are gone, 1.30 is the baseline.dzo serverecords one row per vehicle indzo.sqlite(hidden when missing from a snapshot, forgotten afteradmin.vehicle_forget_days, default 7); records start only once the mod reports drivers.force, skips occupied/covered vehicles, re-checks at confirm, max 500 per request, reports the mod's real answer, audited.serve.db_backup_hours/serve.db_backup_keep: regular consistentVACUUM INTOcopies ofdzo.sqlite, passed topost_backuphooks asextra.db_backup.Spec:
docs/superpowers/specs/2026-11-01-vehicle-last-driver-design.md, plan:docs/superpowers/plans/2026-11-01-vehicle-last-driver.md.Not yet verified
make test-client(stable and--exp) has not been run for the mod changes; only a--no-clientboot. Needs a free DayZ client.servermods/dzo-adminsubmodule commit is on thevehicle-last-driverbranch of bzed/dzo-admin.Test plan
make fmt-check vet lint reuse test-race docs coverage-check(coverage 85.9%)make test-clientandmake test-client ARGS=--exp🤖 Generated with Claude Code