Skip to content

Show mod diff status and file versions in the join data window - #972

Open
romangr wants to merge 1 commit into
rwmt:devfrom
romangr:view-mod-diffs-squashed
Open

Show mod diff status and file versions in the join data window#972
romangr wants to merge 1 commit into
rwmt:devfrom
romangr:view-mod-diffs-squashed

Conversation

@romangr

@romangr romangr commented Jul 27, 2026

Copy link
Copy Markdown

Problem

When a join fails on a mod mismatch, the Data mismatch window doesn't give the player enough to act on.

The two mod lists are drawn almost entirely in white: the server list marks a mod red only when ModInfo.Installed is false, and the client list has no coloring at all. There's no way to see at a glance which mods are extra, which are
missing, and which are merely in the wrong load order.

Installed also resolves through IsModInstalledCached(packageId), which ignores ContentSource, while RemoteData.CompareMods keys on (packageId, source). A mod present on both sides but installed from different sources — Steam workshop vs a local Mods/ folder — therefore fails the set comparison and blocks the join, yet is drawn white as if it matched.

In the Files tab, a mismatched .dll reports only that the hash differs. The usual cause is one side running a newer build of the mod, but the window shows neither a version nor a file date, so nothing indicates which side is stale.

Change

Both mod lists are colored by diff status, keyed on (packageId, source) so the coloring agrees with CompareMods:

  • red — on the server list, mods the client is missing
  • orange — on the client list, mods the server doesn't have
  • yellow — on the client list, mods present on both sides but in the wrong relative load order

Wrong order is flagged on the client list only, since reordering is something the client resolves locally; the server list only marks missing mods. The out-of-order set comes from a longest-common-order pass — a longest-increasing-subse
quence over the local positions of the common mods, taken in server order — so a single displaced mod doesn't mark every mod after it. A legend between the two lists explains the colors.

Leaf file nodes in the Files tab gain a tooltip listing each side's last write time, plus the assembly, file and product versions for .dll files. The host reads these while snapshotting mod files and sends them along in ClientInitDat aPacket. They are kept out of ModFile equality, so they stay display-only and never affect the diff itself, which remains keyed on relative path and hash.

  • Showing DLL versions on mismatch:
Screenshot 2026-07-26 at 21 07 15
  • Mods with incorrect order are highlighted in yellow
Screenshot 2026-07-26 at 20 53 33
  • Mods with mismatched source are highlighted as missing/added
Screenshot 2026-07-26 at 20 50 57

Testing

  • dotnet build Source/Multiplayer.sln -c Release is clean and the test suite passes (158/158). Behavior was verified by joining a host with mods that were missing, extra, reordered and installed from a different source, and with a .dll differing only by build — see the screenshots above. Platform-independent, though it was exercised on macOS/arm64.

  • It was checked together with other changes, to be tested in isolation

Follow-up

New i18n keys: MpMismatchModListWrongOrder, MpMismatchFileAssemblyVersion, MpMismatchFileVersion, MpMismatchFileProductVersion, MpMismatchFileModified, MpMismatchFileUnknown. These are added in the locale repo; the Language s submodule pointer bump is still pending, so the new labels render as raw keys until that lands.

Color both mod lists by diff status: mods the client is missing are red on
the server list, while extra mods (orange) and mods loaded out of relative
order (yellow) are flagged on the client list, since reordering is resolved
locally. Out-of-order mods are found with a longest-common-order pass so a
single displaced mod doesn't mark everything after it. A legend between the
two lists explains the colors.

Leaf file nodes in the Files tab gain a tooltip showing each side's last
write time, plus the assembly, file and product versions for .dll files.
The host reads these when snapshotting mod files and sends them along in
ClientInitDataPacket. They are kept out of ModFile equality so they never
affect the diff itself, which stays keyed on relative path and hash.

New keys: MpMismatchModListWrongOrder, MpMismatchFileAssemblyVersion,
MpMismatchFileVersion, MpMismatchFileProductVersion, MpMismatchFileModified,
MpMismatchFileUnknown (added in the locale repo, pointer bump pending).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant