bugfix: Fix LAN IP selection and periodic input stalls on macOS/iOS#13
Open
DmytryS wants to merge 3 commits into
Open
bugfix: Fix LAN IP selection and periodic input stalls on macOS/iOS#13DmytryS wants to merge 3 commits into
DmytryS wants to merge 3 commits into
Conversation
…numerating LAN IP addresses Cellular (pdp_ip*) and VPN tunnel (utun*) interfaces sorted below the Wi-Fi address and were picked as the default LAN IP on iOS and macOS, so LAN games bound to an interface no LAN peer can reach. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
gettimeofday follows wall time, which steps backward on NTP/carrier time sync (frequent on iOS). Every elapsed-time gate in the engine (shell updates, animations, network resend timers) then stalls until the clock catches back up, freezing UI response for the size of the step while rendering and input events keep flowing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…g script The devicectl column position shifts with multi-word device names (e.g. "iPhone 15 Pro Max"), so parse the identifier by its UUID shape instead of by column index. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Merge with Rebase (three standalone fixes, each compiles independently)
What this fixes
1. LAN multiplayer binds to an unreachable IP address (network)
On POSIX platforms
IPEnumeration::getAddresses()accepts every non-loopbackIPv4 interface. On iOS this includes cellular (
pdp_ip*) and VPN tunnel(
utun*) interfaces, and on macOS link-local169.254.0.0/16addresses fromauxiliary interfaces (e.g. the iPhone-USB bridge). Because the list is sorted
ascending and the LAN lobby takes the first entry, these addresses win over the
real Wi-Fi/Ethernet address and LAN games bind to an interface no LAN peer can
reach. The fix skips
IFF_POINTOPOINTinterfaces and link-local addresses.Interface names are deliberately not whitelisted so hotspot play (
bridge100)keeps working.
2. Recurring 10-15 second UI/input stalls (system)
timeGetTime()is implemented withgettimeofday()on POSIX (both CompatLibcopies and
systimer.h). Wall time steps backward on NTP/carrier time sync —frequent on iOS. Every elapsed-time gate in the engine (shell screen updates,
window animations, transitions, network resend timers) then stalls until the
clock catches back up, which presents as the game ignoring touches for the
size of the step while rendering continues. Reproduced on device: the engine
log shows button taps registering (
Shell::push) while the pending screentransition sits unprocessed for many seconds. The fix switches both shims to
CLOCK_MONOTONIC.3. iOS packaging script fails on multi-word device names (tooling)
devicectl list devicesoutput is parsed by column position, which shiftswith names like "iPhone 15 Pro Max". Parse the identifier by UUID shape
instead.
Testing
Silicon Mac: the LAN lobby now selects the Wi-Fi address (previously a
cellular
10.xaddress on iOS and a link-local169.254.xaddress on macOS).macos-vulkan(Zero Hour + Generals) andios-vulkan(Zero Hour) presets.
AI disclosure
The changes in this PR were generated with an LLM (Claude Code), reviewed
line-by-line, and tested by the author as described above.
🤖 Generated with Claude Code