CNA-BUG-172: A joined SystemLink session reports MaxGamers 31 and PrivateGamerSlots 4 instead of the host's values
Evidence basis: source-verified at the pinned commit; tests exist (not executed for this page). Claims on this page were checked by reading the CNA source at commit 009d40f5; unless a sentence says otherwise, nothing here was built or executed. Nothing on this page was executed unless the Evidence section says so.
EndJoin constructs the client's NetworkSession with the placeholders MaxSupportedGamers and 4 that FNA marks FIXME, and nothing in the handshake updates them, so a client's MaxGamers, PrivateGamerSlots and session-full check disagree with the host.
- Identifier
CNA-BUG-172- Category
- Bug
- Subsystem
- Networking & gamer services
- Status
- Open
- Verified against
- CNA
009d40f5(009d40f5dd085c4e674d3479675fac84b12b3e0a) - Severity
- Low (a triage suggestion, not a project priority)
- Evidence basis
- Source-verified: read at TARGET, not executed
- Tests touching this area
- Yes: see Current tests
- Affected contract
- Microsoft::Xna::Framework::Net::NetworkSession::getMaxGamersProperty() and getPrivateGamerSlotsProperty() on a session obtained from Join, and the client-side session-full check in AddRemoteGamer
Expected behaviour
In XNA 4.0 every member of a session sees the session's slot configuration: ProcessUpdateSessionInfo overwrites maxGamers and privateGamerSlots from the session information the host publishes (decompiled NetworkSession), so a client's MaxGamers equals the host's and follows later changes.
Actual behaviour at TARGET
EndJoin in NetworkSession.cpp constructs the joining session with MaxSupportedGamers (31) and 4 private slots, both commented // FIXME upstream. The ServerWelcome carries a roster, wire ids and the session properties but no slot counts, and neither ENetBackend.cpp nor the packet codec updates maxGamers_ or privateGamerSlots_ on a client. A client therefore reports MaxGamers 31 and PrivateGamerSlots 4 whatever the host chose, its AddRemoteGamer full-session check compares against 31, and a later change on the host is never seen. The values are known at join time: the discovery announcement the client joined from carries the host's maximum and open private slots.
Source locations
modules/net/src/Xna/NetworkSession.cpp— EndJoin passes MaxSupportedGamers and 4 (both marked FIXME upstream) to the NetworkSession constructormodules/net/src/Internal/ENetBackend.cpp— HandleServerWelcome and the broadcasts update roster, host and properties, not slot countsmodules/net/src/Internal/NetPacketCodec.cpp— ServerWelcome encoding carries no MaxGamers or PrivateGamerSlotsmodules/net/tests/Microsoft/Xna/Framework/Net/NetworkSessionTests.cpp— slot-count assertions exist only for sessions created locally
Evidence
Checked by reading NetworkSession.cpp, ENetBackend.cpp and the codec at 009d40f5; not executed. XNA's behaviour is from the decompiled NetworkSession (ProcessUpdateSessionInfo and SetGamerSlots). A chapter review of this area flagged the same placeholders.
Independently observed as a separate finding (merged): EndJoin constructs the client's session with MaxSupportedGamers and four private slots (FNA's FIXME placeholders), and nothing later copies the host's values.
Focused reproduction
// Illustrative; not compiled or run for this entry.
// Host: NetworkSession::Create(NetworkSessionType::SystemLink, 1, 8, 2, NetworkSessionProperties{});
// Client, after finding that session:
NetworkSession* joined = NetworkSession::Join(&found[0]);
int maxGamers = joined->getMaxGamersProperty(); // 31, host has 8
int privateSlot = joined->getPrivateGamerSlotsProperty(); // 4, host has 2
Current tests
NetworkSessionTests.cpp asserts MaxGamers and PrivateGamerSlots only for sessions created on the same machine; ENetBackendTests.cpp and the two-process test check rosters and data, not a client's slot counts.
Regression test
A backend test in which a client joins a host created with 8 gamers and 2 private slots and expects the client to report 8 and 2, and to follow a host-side change; fixed by carrying the slot counts in ServerWelcome (and a broadcast for later changes), or at least by seeding them from the AvailableNetworkSession used to join.
Blast radius
Client-side lobby UI that shows free slots or capacity, client code that checks MaxGamers before inviting or adding players, and the discovery announcements a client sends (see CNA-BUG-170), which advertise 31 and 4. The host's own view and its admission control are unaffected.
Workaround
Read capacity on the host and send it to clients in game data, or use the values of the AvailableNetworkSession the client joined from.
Related pages
The same subject is explained at several altitudes. These are the neighbouring pages at each one.
- User guide
- Tutorial 97: networking
- Internals
- Network session internals: joining
- Deep dives
- Network sessions: who owns what
- Known issues
- Bug index