feat: map received_quantity_multiplier and sample_rotation (proto drift 24587531) - #111
Merged
Merged
Conversation
The August 2026 Rust server (build 24587531) added two optional fields to the Companion contracts, reported by the ProtoRefresh drift gate: - AppMarker.SellOrder.received_quantity_multiplier = 11 - AppCameraRays.sample_rotation = 9 Both are additive, so the wire stays compatible; they were simply dropped before reaching the public DTOs. Adopt them in the committed proto and surface them as VendingMachineItem.ReceivedQuantityMultiplier and CameraFrame.SampleRotation (inherited by CameraRaysEventArg), following the existing presence-fork idiom. CameraRenderer needs no change: sample placement comes from the fixed 1337-seeded shuffle buffer indexed by SampleOffset, so sample_rotation is pass-through data for consumers. Closes #110 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Surfaces two newly-added optional protobuf fields from Rust dedicated server build 24587531 into the public DTO layer, keeping the RustPlusApi models/mappers and camera docs aligned with the latest wire contract drift gate.
Changes:
- Add
received_quantity_multipliertoAppMarker.SellOrderand map it toVendingMachineItem.ReceivedQuantityMultiplierusing a protobuf-net presence fork (ShouldSerialize…()→nullwhen absent). - Add
sample_rotationtoAppCameraRaysand map it toCameraFrame.SampleRotation(and thereforeCameraRaysEventArg) in both camera mappers. - Extend unit tests and camera documentation to cover/describe the new nullable DTO fields.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/RustPlusApi.UnitTests/MarkerMapperTests.cs | Adds set/unset tests to lock the new sell-order presence fork behavior. |
| tests/RustPlusApi.UnitTests/CameraModelMapperTests.cs | Adds set/unset tests for SampleRotation across both camera mappers. |
| src/RustPlusApi/Protobuf/RustPlusContracts.proto | Introduces the two new optional fields matching the reported server drift. |
| src/RustPlusApi/Extensions/AppMarkerToModel.cs | Maps ReceivedQuantityMultiplier with presence semantics (absent → null). |
| src/RustPlusApi/Extensions/AppCameraToModel.cs | Maps SampleRotation into both ToCameraFrame and ToCameraRaysEvent. |
| src/RustPlusApi/Data/VendingMachineItem.cs | Adds nullable DTO property ReceivedQuantityMultiplier with XML doc. |
| src/RustPlusApi/Data/Cameras/CameraFrame.cs | Adds nullable DTO property SampleRotation with XML doc. |
| docs/articles/cameras.md | Updates CameraFrame field list to include SampleRotation. |
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.
Closes #110.
The ProtoRefresh drift gate flagged two new optional fields on the August 2026 Rust dedicated server (build
24587531). Both are purely additive — no renames or removals — so the wire format stays compatible; they were simply dropped before reaching the public DTOs.AppMarker.SellOrderoptional float received_quantity_multiplier = 11VendingMachineItem.ReceivedQuantityMultiplierAppCameraRaysoptional Vector3 sample_rotation = 9CameraFrame.SampleRotation(inherited byCameraRaysEventArg)Changes
RustPlusContracts.proto— adopt both fields as reported by the diff.VendingMachineItem/CameraFrame— nullable properties following the existingPriceMultiplier/CameraRotationidiom (absent on the wire →null).AppMarkerToModel.ToVendingMachineItem—ShouldSerializeReceivedQuantityMultiplier()presence fork.AppCameraToModel— mapped in bothToCameraFrameandToCameraRaysEvent.docs/articles/cameras.md—CameraFramefield list kept in sync.Not changed
CameraRendererneeds nothing: sample placement comes from the fixed 1337-seeded shuffle buffer indexed bySampleOffset, sosample_rotation(the orientation the rays were sampled with) is pass-through data for consumers, not a render input. The golden render fixture is unaffected.Tests
Written first, watched fail on the missing members, then implemented:
MarkerMapperTests— set/unset pair forReceivedQuantityMultiplier.CameraModelMapperTests— set/unset forSampleRotationacross both mappers.dotnet test RustPlusApi.sln -f net10.0→ 463 passed. The net8.0 host (netstandard2.0 asset) wasn't runnable locally — that runtime isn't installed on this machine — so CI covers that half; the netstandard2.0 target compiles clean in the full solution build. Coverage on the net10.0 run keepsAppMarkerToModelandAppCameraToModelat 100% line/branch.🤖 Generated with Claude Code