1.3.3.2 Peer-to-Peer Connect

The first peer in a DirectPlay game session is considered the host of the multiplayer game session. This host peer waits for additional peers to connect to the DirectPlay game session.

A new peer that wants to connect to the multiplayer game session sends a connection request message.

The host validates the payload sent in and, if it is valid, the host will respond with connection information to the peer.

If the host fails to validate the connection request message, the host sends a connection failed message to the peer.

If the host has successfully validated the connection package, then at the same time it is responding to the connecting peer, the host will also send a message to the other connected players indicating that a new player is joining. This informs each existing client that a new peer has joined the game session.

When the connecting peer has received confirmation from the host, it acknowledges the connection by sending a message back to the host.

After the host receives the acknowledgment (ACK) message from the newly connected client peer, the host will send a connect instruct message to all existing peers, instructing them to also establish a connection to the new peer. The existing peers will send their unique identifiers to the newly connected peer.

It might be the case that existing peers are unable to connect to the new peer. Existing peers that are unable to connect to the newly connecting peer issue a failure notification back to the host. If the host receives a failure message from any existing peers, the host sends a connection failure message to the peer that is requesting a connection.