Skip to content

Use the typed net name without Enter; stable network test ports (0.4.2) - #7

Merged
lowlevelmetal merged 4 commits into
mainfrom
integration
Oct 11, 2026
Merged

lowlevelmetal merged 4 commits into
mainfrom
integration

Conversation

@lowlevelmetal

Copy link
Copy Markdown
Owner

Version 0.4.2. The network protocol is unchanged, so 0.4.1 and 0.4.2 can play together.

  • NET NAME applied without Enter: the name typed on the sessions page is applied on Enter, before HOST and JOIN, and on leaving the page. MM2's field edits the menu's own name buffer (NetSelectMenu +0x8c), which hosting and joining read; NetSelectMenu::NetNameCB only logs it. Before, a name was used only after Enter.
  • No NetGame rebuild: applying the name no longer replaces the NetGame, whose port-forwarding teardown stalled the menus. NetGame::setPlayerName sets the name the next host or join uses. Test: NetGame.ANameSetBeforeHostingOrJoiningIsUsed.
  • Test ports: network tests take their port slot from the process id instead of the clock, so parallel test processes never share a port. NetGameLobby failed that way once on the v0.4.1 tag's Clang job.

Testing: 1052/1052 tests pass. The network tests passed three times at -j16.

🤖 Generated with Claude Code

lowlevelmetal and others added 4 commits October 10, 2026 18:31
The sessions page applied a typed net name only on Enter. A name typed and
followed by HOST, JOIN or leaving the page showed in the field but was not
used, and came back as the old name next time. MM2's field edits the
menu's own name buffer (NetSelectMenu +0x8c), which hosting and joining
read; NetSelectMenu::NetNameCB only logs it. The name is now applied on
Enter, before HOST and JOIN, and on leaving the page.

Applying it no longer replaces the NetGame: tearing down the old one's
port forwarding stalled the menus and cleared the LAN list. NetGame::
setPlayerName gives the next host or join the new name, and the profile
is saved only when the name changed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ctest runs each test as a process of its own, several at a time, and the
port slot came from the clock's microseconds: two processes could land on
the same slot now and then, and the second could not bind its port
(NetGameLobby.CopsVsRobbersCarsAreTheSameOnEveryMachine failed that way on
the v0.4.1 tag's Clang job, after passing in the PR). Processes running at
the same time have distinct ids, handed out in order on Linux, so
test::processPortSlot (tests/NetTestPorts.h) gives them distinct slots.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A process in test_netgame.cpp binds its base port, +1 (LAN discovery), +2
and +4, but its slots were 2 apart. Process ids in CI's container come in
order, so neighbouring tests got neighbouring slots and one's +2 port was
the next one's base: NetGame.LanDiscoveryPasswordAndKick could not listen
on both Linux jobs of PR #7. The slots are now 6 ports apart (666 slots in
the block), and NetTestPorts.h says a block's spacing must cover a
process's ports; the other files use at most their spacing already.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@lowlevelmetal
lowlevelmetal merged commit b6eca04 into main Oct 11, 2026
5 checks passed
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