Repository navigation
fix(coop): refuse a lobby join on a different build or mod list (#211) - #235
Merged
Merged
Conversation
…in path Two lobby tests join a host from a game that differs in exactly one way (another build version, a host that reports an empty build version or mod list, a mod at another metadata version, the same mods in another load order) and from a matching game: - test_join_checks_tcp.py: join_tcp, without and with a host password (the challenge and the retry). - test_join_checks_udp.py: the direct UDP transport, and the online server list served by rendezvous_stub.py (clicking the listed room, or joining by room id when the list leaves the room out). A refused join must end on the incompatible-mods screen without ever showing the lobby, the join popup or the password prompt. Test support: - The build version and mod list a game reports (getReportedGameVersion, getReportedMods) can be replaced by the set_reported_identity test server command. - Test server commands to list, refresh and join server browser rows and to read or close the incompatible-mods screen. ServerList's row join moves into joinServer() so a command can drive it. - Three data-only test mods: Coop_JoinCheck_A_Test at versions 1.0 and 2.0 (same mod id) and Coop_JoinCheck_B_Test.
…ery path A joiner now compares the host's build version and whole mod list (each mod's id and metadata version, in load order) with its own before it enters the lobby, and an empty version or mod list never matches. - The host's join reply and its password challenge carry game_version and each mod's version. The joiner checks all three messages, so TCP joins (Direct Connect, a saved server, the password retry) and the UDP joins that run the same handshake are refused, and a refused join never reaches the password prompt. - A room publishes its mods as "id:version;" in load order. The server browser's click check and filter, the Direct Connect UDP check and the LAN list's version filter compare it whole. - A rendezvous refusal (onConnect -4) used to leave the joiner on "Connecting..."; it now shows the incompatible-mods screen with the refused room's mods, and the Direct Connect UDP failure callbacks no longer open the password prompt for it. - The incompatible-mods screen no longer lists xcom1 a second time as an extra mod to disable: renaming it for display changed the list the extra-mod check read. Fixes #211
A join refused for another build, mod version or load order showed every mod as "This mod is enabled.", so nothing said why it was refused. - A line under the title names both builds when they differ, for example "Host build 2.0.36.0, your build 2.0.35.0." A host that reports no build shows as "unknown". - A mod the host loads at another version shows "Different version (host 3.9)."; a mod loaded in another place among the mods both games share shows "Different load order." - The rendezvous refusals keep the refused room's build version for the line; a refusal opened from a server browser row has none (the list only shows rooms on the joiner's own build), so it shows no line. The join-check tests now assert the exact rows and line for each cell.
NonPolynomialTim
marked this pull request as ready for review
November 6, 2026 02:29
NonPolynomialTim
enabled auto-merge (squash)
November 6, 2026 02:29
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.
Problem
Two players on different builds, or with different mod lists, could join each other's lobby on most paths. What each path let through on
main(reproduced by the new tests, below):join_tcp)Root cause (captured with temporary logging, removed before commit)
mods,playername,servername,state, with the joiner reporting build9.9.9.9andhasRequiredMods=1.xcom1;Coop_JoinCheck_A_Test;Coop_JoinCheck_B_Test;.hasRequiredModscompares the names as a set: hostxcom1;A;B;against joinerxcom1;B;A;returned true.hasRequiredMods("")returns true, and the rendezvous join check skips an empty room version.JOIN_ROOMhadmod_hash '', so the server's exact-string mod check never ran (the issue's table assumed it did).onConnect = -4, which nothing handles. Captured:onConnect -1 -> -4with "Connecting..." on top, unchanged until the test left.Fix
The joiner compares the host's build version and whole mod list (each mod's id and metadata version, in load order) with its own before it enters the lobby. An empty version or mod list never matches.
game_versionand each mod'sversion. The joiner checks all three messages. This covers TCP (Direct Connect, saved servers, the password retry) and every UDP join, since they run the same handshake. A refused join opens the incompatible-mods screen (ModCheckMenu) and never the password prompt.id:version;in load order. The server browser's click check and filter, the Direct Connect UDP check and the LAN list's version filter compare it whole.-4) now opens the incompatible-mods screen with the refused room's mods, and the Direct Connect UDP failure callbacks no longer open the password prompt for it.xcom1a second time as an extra mod to disable. The display rename changed the list the extra-mod check read. This happened onmaintoo, for every mod-name refusal.The rendezvous server is unchanged.
Tests
test_join_checks_tcp.py: join_tcp without and with a host password (the challenge and the retry).test_join_checks_udp.py: the direct UDP transport, and the online server list served byrendezvous_stub.py(clicking the listed room, or joining by room id when the list leaves the room out).Each file has six cells per path: a different build, a host reporting an empty build, a host reporting an empty mod list, a mod at another metadata version, the same mods in another load order, and a matching game. A refused cell must end on the incompatible-mods screen, with the lobby, the join popup and the password prompt never shown, the session down, and the screen showing exactly the expected rows and build line. Test support:
set_reported_identityreplaces the build version or mod list a game reports. There are server-browser and incompatible-mods-screen test commands, and three data-only test mods (Coop_JoinCheck_A_Testat 1.0 and 2.0 with the same id,Coop_JoinCheck_B_Test).mainplus the test commit: 3 of 3 runs per file, every mismatch cell fails, both matching cells pass.RESULT PASS.std::terminate called (no active exception).crash line (20 of 20 runs;maindoes the same). The test accepts exactly that exit, astest_udp_rejoin.pydoes.Not driven by a test
isCoopJoinCompatible) and refusal (-4, the screen the online-by-id cell drives), and the UDP handshake check behind them is driven. One LAN effect shows up as evidence: onmainthe room of a host reporting no build reached the joiner's list in 3 of 3 red runs. The stub's list filter leaves it out, so it came through LAN discovery. With the fix it is absent.connectTCPServercall asjoin_tcp.Known limits
A room's published mod list grows by each mod's version. The LAN discovery answer is still capped at 1000 bytes, so a very long mod list drops out of the LAN list sooner than before (the online list is not capped).
The check runs on the joiner. A joiner on an older build is not refused by a host on this build.
The host still shows " has joined" for a moment before the joiner disconnects, as it already did for a mod-name refusal.
Fixes #211