Repository navigation
fix: start the client without -skipselect, which races the join on tModLoader 1.4.5 - #117
Merged
Merged
Conversation
On tModLoader 1.4.5, -skipselect next to -join also loads the first local world and enters it in singleplayer. That load raced the network join; when it landed first the server booted the client with "Invalid operation at this state" and launch/join waited out the full timeout (issue 108, about 2 launches in 10 on 1.4.5.8). launch and join each built the client command from their own copy of the list. Both now call _client_join_cmd, and a test for each caller compares the whole command. tests/live_race_check.py uses the same builder. Not yet run against a live game on 1.4.4.9.
|
Nothing meets the bar. Reviewed the whole diff (session.py, both call sites in
|
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.
Outcome
launchandjoinstart the client with-join 127.0.0.1 -port <port> -player <name>and no-skipselect.-join, also loads the first local world and enters it. That load raced the join. When it landed first the server kicked the client with "Invalid operation at this state" and the call waited out its full timeout. Issue 108 reports this at about 2 launches in 10 on 1.4.5.8, with the decompiled cause and this fix.Run against a live game
The reporter ran it on 1.4.5.8 (6 of 6 scripted launches joined, one "Entering world" per client). The open question was 1.4.4.9, which the live checks in this repo run against: does
-join -playerselect the character there without-skipselect? It does. On 2026-11-16tests/live_capture_check.pyran from this branch (b65a703) on tModLoader 1.4.4.9+2026.09.3.1: the server started, both clients (launchandjoin, each through_client_join_cmd) entered the world and reported ready, 3 of 3 capture rounds passed, exit 0, and a captured frame shows the character in the world. One launch and one join: it shows the flag is not needed on 1.4.4.9, not how often a join succeeds. Run on a second install, with the template mod (template/DevBridgeTemplate) as the only mod.Acceptance check
launchand one forjoin. Seen to fail throughmutate-runwith the flag put back: both fail onLeft contains one more item: '-skipselect'(1 of 1 killed). Each also asserts the legitimate path completed (two spawns recorded forlaunch;session.joined == ["tst2"]forjoin).Constraints
joinstill waits for the tokened heartbeat only.NO_HEADLESS_SINGLEPLAYERand the README sentence about it still name-skipselect. They record what was measured for singleplayer with that flag, which this PR does not re-measure.Risk and revert
git revert. Both callers now build the command in_client_join_cmd, so a per-version flag, if one turns out to be needed, goes in one place.