Skip to content

Add System Link (LAN) play - #115

Merged
phforner0 merged 1 commit into
phforner0:mainfrom
vmmendozae:feature/system-link
Nov 8, 2026
Merged

phforner0 merged 1 commit into
phforner0:mainfrom
vmmendozae:feature/system-link

Conversation

@vmmendozae

Copy link
Copy Markdown
Contributor

What

System Link between Xendroid+ devices: consoles on the same Wi-Fi find and join each other's System Link games, as 360s do on one network. Devices on another subnet or a VPN (ZeroTier, Tailscale) are reached by naming their IP addresses.

Tested: Halo 3 System Link between two Android phones on one Wi-Fi — the game is found, joined and played.

How

Core (xenia/kernel/systemlink.{h,cc}, XSocket, XNet exports in xam_net.cc):

  • Broadcasts go to the network's broadcast address (some Android networks drop 255.255.255.255) and, as unicasts, to named peers and to consoles heard from outside the local network. A console's own broadcasts are dropped.
  • Ports below 1024 (Halo binds 1000/1001) bind as port + 10000 on the host and are translated both ways, so titles see the ports they asked for.
  • XNetGetTitleXnAddr returns the device's address, its own Ethernet address and a per-console online identity; XNetXnAddrToInAddr / XNetInAddrToXnAddr, XNetXnAddrToMachineId, XNetLogonGetMachineID, XNetConnect / XNetGetConnectStatus, XNetCreateKey / XNetRegisterKey, the system link port and Ethernet link status are implemented.
  • XNetQosListen / XNetQosLookup: hosts answer QoS probes over UDP (port 13074) with the data they publish.
  • XLiveBaseGetNatType reports an open NAT with System Link on.
  • System link hosts fill XSESSION_INFO in XSessionCreate.
  • With System Link on, the log notes the first datagrams of each flow (addresses reduced to their last byte, as shared diagnostics hide them).

Everything is behind the new systemlink cvar (off by default); with it off, behaviour is unchanged.

App:

  • Settings → System (Advanced): System link (LAN) and Other consoles (VPN).
  • At launch, the device's IPv4 address, its network's broadcast address and a kept, random Ethernet address (02:22:48:…) go to the core as cvars; the Wi-Fi multicast lock is held while a game runs (ACCESS_WIFI_STATE, CHANGE_WIFI_MULTICAST_STATE).

Halo 3

Halo 3 refuses to connect to peers whose address is a plain IP unless its bundled patch "Allow public IP addresses." is on (Game patches). Without it the joiner finds the game but gives up with "Unable to join". The setting's description says so.

Tests

  • SystemLinkTest (broadcast address math) and SettingCatalogTest pass.
  • assembleDebug builds.

🤖 Generated with Claude Code

Consoles on the same Wi-Fi find and join each other's System Link games,
as 360s do on one network; consoles on a VPN (ZeroTier, Tailscale) are
reached by naming their addresses.

Core (xenia/kernel/systemlink.*, XSocket, XNet exports):
- broadcasts go to the network's broadcast address and, as unicasts, to
  named peers and consoles heard from outside the network; a console's own
  broadcasts are dropped
- ports below 1024 bind as port + 10000 and are translated both ways
- XNADDRs carry the device's address, its own Ethernet address and an
  online identity; XNetXnAddrToInAddr/InAddrToXnAddr, machine ids,
  connect status, keys and the system link port are implemented
- XNetQosListen/XNetQosLookup answer and send QoS probes over UDP
- XLiveBaseGetNatType reports an open NAT with System Link on
- system link hosts fill XSESSION_INFO

App: System link and Other consoles (VPN) settings under System, launch
cvars with the device's address, broadcast address and a kept Ethernet
address, and the Wi-Fi multicast lock while a game runs.

Halo 3 joins with its "Allow public IP addresses." patch on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vmmendozae

Copy link
Copy Markdown
Contributor Author
trim.4679B37B-B726-4F7C-BBC0-C8BB9F516C09.MOV

@vmmendozae

Copy link
Copy Markdown
Contributor Author

@phforner0 should i do something else for approval?

@phforner0

phforner0 commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

@phforner0 should i do something else for approval?

Not for now, maybe just test it in more games if possible. I'm currently working on optimizations and fixing some bugs, so it will take a little while before I can review more in-depth and merge with me knowing that it won't break anything in the emulator. And my sincerest thanks for contributing to Xendroid Plus.

Or since I don't have much time available at the moment, after you test it in more games I'll merge it and let people test it as a preview build.

@vmmendozae

Copy link
Copy Markdown
Contributor Author

It’s designed for games that use System Link or LAN for multiplayer; I’ve already tested it with Halo 3 and Gears of War 3 (Horde mode) and both work perfectly.

@vmmendozae

Copy link
Copy Markdown
Contributor Author
trim.71E3BB71-4609-46B3-B549-1299CEE86874.MOV

Gears of war 3

@vmmendozae

Copy link
Copy Markdown
Contributor Author
trim.CB595E25-3202-4516-8BE3-3DC1A6B4E614.MOV

Borderlands 2

@phforner0
phforner0 merged commit bbad874 into phforner0:main Nov 8, 2026
5 checks passed
hy300leosquizz-ctrl added a commit to hy300leosquizz-ctrl/Xendroid-Plus that referenced this pull request Nov 8, 2026
System link (phforner0#115) added the Network section with Network|systemlink (a
switch) and Network|systemlink_peers (text) without updating the
inventory test: 176 entries, 120 switches, 3 text fields, and Network
after Kernel among the sections.

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

2 participants