Repository navigation
Stage 6a: character vehicle owners - #162
Conversation
|
Important Review skippedToo many files! This PR contains 101 files, which is 1 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configuration
📒 Files selected for processing (101)
You can disable this status message by setting the
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vehicle work moves into a stage that runs once factions have started and VehicleFramework is enabled: payer migration, the one-time owner migration (plan, fixed-name backups, conditional apply, separate stored/live verify), the leader and upkeep reconciles, the vehicle listeners and last the VehicleOwnershipAuthority. Every SimpleFactions owner write goes through VehicleFramework's setOwnership with the registry first and rolled back on failure. SimpleFactions vetoes non-staff changes to faction vehicles, charges claim fees under VehicleFramework's operation ID and records the payer row once from the post-write event. Leader changes and faction deletion restamp faction vehicles, with a click backstop. Slot limits count personal rows per cached account. Consent requests capture both characters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Builds wait for the finished vehicle stage, a construction whose owner cannot be written is held so nobody claims it, and vehicles held for staff are never restamped or changed by players. Rollback also restores pending entries of an interrupted plan and counts fees from when the plan was made. Handover fees carry the offer time in their replayable intent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A legacy owner name now also round-trips through the name DenarEconomy remembered last for the account when the server's user cache has forgotten it, so expiring cache entries no longer quarantine personal vehicles; a name the account has since replaced still fails. The rollback tool names a too-old Gson (needs 2.10) or a missing sqlite-jdbc before it starts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
c0f2e63 to
2a3bf53
Compare
|
@coderabbitai review |
|
A pre-6a journal whose rights snapshot has a missing or non-array guild list, a non-object guild, missing members or a blank or invalid incarnation now gives that character no lock-guild entry instead of failing the index rebuild. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Verification listed a DONE vehicle with neither a stored nor a live copy by indexing an empty list; it now joins the torn-vehicle failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The refund is capped at the guild bank's balance. A short refund is now logged with the shortfall and the player told what came back and what did not, as the registration-fee cancel does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Muse (independent reviewer) reviewed parts A (#161) and B (this PR) against the stage 6a design: verdict OK. Its three minor findings were valid and are fixed on this branch with tests:
Full gate at b4fb94a: 7,916 tests, 0 failures, 100% line coverage. Merging with admin rights: Muse's review replaces the CodeRabbit wait, because CodeRabbit's free quota was exhausted. |
Stage 6a part B for SimpleFactions: vehicles are owned by characters through VehicleFramework 2.13's ownership API. Stacked on #161 (part A,
lockGuild); both ship together as SimpleFactions 4.1.0.Vehicle stage. Factions no longer wait for VehicleFramework.
startVehicles()runs once, afterstarted = trueor when VehicleFramework enables (a once-guard covers VehicleFramework enabling inside SimpleFactions' own enable window): payer migration, the one-time owner migration, the leader reconcile, the upkeep reconcile, the vehicle listeners, and last theVehicleOwnershipAuthority. Steps 1–2 failing keep today'sfailFinancialState; steps 3–4 failing stop before listeners and authority. The construction freeze and registration fee still hook in early. Without VehicleFramework 2.13 in characters mode only the payer migration and listeners run, non-staff claims are refused, and upkeep is charged from registry rows.Owner migration (
vehicles/owner-migration.json). The plan records originals and decided values and is synced before fixed-name backups (vehicles-6a-premigration.dbviaVACUUM INTO+quick_check,vehicles_registry-6a-premigration.json); a!backedUpplan resumes at the backup. Apply is conditional (planned new → done, original →setOwnership(MIGRATE), anything else → quarantine, gone → counted,SAVE_FAILED/REFUSED_MODE→ abort), then stored and live copies are verified separately. Seeding: personal rows need a round-tripping name whose account plays the row's character; faction rows get the paying faction's leader character orchar_none; rows-less vehicles get the round-tripped account's heir; everything else is quarantined and listed throughVehicleQuarantineSource.Ownership changes. At HIGH, non-staff changes to faction vehicles are refused (both toggles included) and claims need a character, ready payments and a free per-account slot; at HIGHEST the transfer fee is confirmed and charged under VehicleFramework's operation ID. The payer row is written once from
VehicleOwnershipChangedEvent; failed claims are refunded; staff takeovers record the target character with no fee and an audit line. SimpleFactions' handlers onVehicleOwnerClaimedEventare gone (theVehicleRemoveEventone stays). Every SimpleFactions owner write (construction, spawn sync, berth/pool, installation transfer incl. stored vehicles, release, handover, restamps) goes throughsetOwnership, registry first and rolled back on failure. Construction stamps the registration-fee payer and holds the vehicle atchar_nonefor staff if VFBuilders' constructor character (or the old station's heir) differs.Vehicles on the staff list (migration quarantine, construction mismatches, constructions whose stamp could not be written) are held: players cannot change them and leader stamps leave them alone until staff assign an owner. Builds start only once the vehicle stage has finished in characters mode.
Leader stamps.
Faction.setLeader/succeedDeadLeaderfireFactionLeaderChangedEvent; the restamp handler waits for the stage;FactionManager.deleteFactionrestamps leftover rows tochar_none; a LOWESTVehiclePreInteractEventbackstop and the edit check refuse stale stamps and restamp on the next tick.Upkeep reconcile at boot and daily, per-account slot limits with the account cached on rows (backfilled from characters and both migration plans), and consent requests capturing both characters.
Name round trip. A legacy owner name counts when it is still the account's latest name: Bukkit's name for the account, or, once the user cache has forgotten it, the name DenarEconomy remembered last in its durable
player-names.json.Rollback.
VehicleOwnerRollback(run with the server stopped) restores only the owner column and payloadowner/whitelisted/whitelistof rows still holding the migration's values, moves the plan aside, and writes a refund list of claim/build/handover fees paid since the plan was made. It needs Gson 2.10+ and sqlite-jdbc and refuses an older Gson up front.Docs: TF-Minecraft/Docs#211
Gate:
tfmc-mvn -o -B clean verify— 7,913 tests, 0 failures, 100% line coverage. CI will 404 on the unreleased VehicleFramework 2.13.0 / VFBuilders 2.2.0 until they are released.🤖 Generated with Claude Code