Skip to content

feat(map): surface AppMap.Monument.is_custom_name - #139

Merged
HandyS11 merged 1 commit into
developfrom
feat/proto-drift-25653776
Oct 2, 2026
Merged

HandyS11 merged 1 commit into
developfrom
feat/proto-drift-25653776

Conversation

@HandyS11

@HandyS11 HandyS11 commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Summary

Applies the one wire change reported in #138 for server build 25653776: Facepunch added optional bool is_custom_name = 4 to AppMap.Monument.

  • Proto: AppMap.Monument.is_custom_name = 4, copied exactly from the drift report.
  • ServerMapMonument.IsCustomName (bool?): mapped through ShouldSerializeIsCustomName() rather than read directly. A server older than this build leaves the field out, and that maps to null instead of false. Same shape as ServerInfo.CamerasEnabled (feat(team): add KickFromTeamAsync + surface AppInfo.cameras_enabled #124).
  • Mapper comment: no longer claims token is always a localization key.

The change only adds a field, so current library builds still parse AppMap from new servers; they just can't see the flag.

Unverified assumptions

These weren't checked against the decompiled server; only the drift diff was available:

  • What the field means: read from the field name as "token is a literal custom name rather than a monument translation key". The XML doc for IsCustomName says this.
  • When null appears: assumes current servers always send the field, so null means "server too old". If the server only sends it when true, null would also cover "not custom".

Test plan

  • New RemainingMapperTests: true / explicit false pass through; field missing gives null
  • Missing-field test confirmed to fail against the naive IsCustomName = appMapMonument.IsCustomName mapping
  • dtk dotnet build RustPlusApi.sln (strict analyzers) clean
  • dtk dotnet test RustPlusApi.sln: 1245 passed on both net8.0 and net10.0 hosts
  • ReSharper ReformatAndReorder applied to the changed files

Closes #138

🤖 Generated with Claude Code

Applies the wire change reported for server build 25653776 (#138).

- Proto: AppMap.Monument.is_custom_name = 4, verbatim from the drift report.
- ServerMapMonument.IsCustomName is bool?, mapped through
  ShouldSerializeIsCustomName() rather than read directly: a server older
  than this build omits the field, and false would be a fabricated answer
  instead of "it did not say" (same shape as ServerInfo.CamerasEnabled).
- The mapper comment no longer claims `token` is always a localization key.

The absent-field test was confirmed to fail against the naive
`IsCustomName = appMapMonument.IsCustomName` mapping.

Closes #138

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 2, 2026 11:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The one-field addition faithfully replicates the reviewed CamerasEnabled pattern, matches the drift report exactly, and has full branch coverage with no objective defects.

Review effort: Balanced
Findings: None

What changed in this PR

This PR surfaces a single new wire field that Facepunch added to the Rust+ companion protocol in server build 25653776 (reported in #138): optional bool is_custom_name = 4 on AppMap.Monument. The flag tells consumers whether a monument's token/Name is a server-defined custom name rather than a built-in monument localization key. The implementation mirrors the previously reviewed ServerInfo.CamerasEnabled pattern (#124): the field is modeled as a nullable bool? and mapped through protobuf-net's ShouldSerialize* presence check so that an older server omitting the field maps to null rather than a fabricated false.

Changes:

  • Added is_custom_name = 4 to the AppMap.Monument message in the authoritative proto.
  • Added ServerMapMonument.IsCustomName (bool?) and mapped it via ShouldSerializeIsCustomName(); refreshed the mapper comment about token.
  • Added unit tests covering the present (true/false) and absent (null) cases.
File Description
src/​RustPlusApi/​Protobuf/​RustPlusContracts.proto Adds the new optional bool is_custom_name = 4 field, copied verbatim from the drift report.
src/​RustPlusApi/​Data/​ServerMapMonument.cs Adds the nullable IsCustomName property with XML docs matching the CamerasEnabled style.
src/​RustPlusApi/​Extensions/​AppMapToModel.cs Maps the field via ShouldSerializeIsCustomName() presence check; updates the token comment.
tests/​RustPlusApi.UnitTests/​RemainingMapperTests.cs Adds tests pinning true/false pass-through and null-on-absent, covering both mapper branches.

The change is small, correctly scoped, and faithfully mirrors the established CamerasEnabled precedent. The proto edit matches the drift diff exactly, the mapper uses the same ShouldSerialize* presence pattern as AppInfoToModel.cs:28-30, the model docs match ServerInfo.cs:51-55, and both mapper branches are exercised by the new tests. The semantic ambiguity around what null means is the same accepted tradeoff as CamerasEnabled and is explicitly documented by the author. I found no objective defects.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@HandyS11
HandyS11 merged commit 45a0f6f into develop Oct 2, 2026
7 checks passed
@HandyS11
HandyS11 deleted the feat/proto-drift-25653776 branch October 2, 2026 11:44
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.

Proto drift detected (server build 25653776)

2 participants