Managing a Peer-to-Peer Session

DirectPlay

 
Microsoft DirectX 9.0 SDK Update (Summer 2003)

Managing a Peer-to-Peer Session


The session host is responsible for managing the session, including:

  • Managing the list of session members and their network addresses
  • Deciding whether a new user is allowed to join the session.
  • Notifying all members when a new user joins the session, and passing them the new user's address.
  • Providing new users with the current game state
  • Notifying all users when a user leaves the session

When players attempt to join a session, the host will receive a DPN_MSGID_INDICATE_CONNECT message. To accept the player into the session return S_OK. Returning any other value rejects the request. In either case, the player will receive a DPN_MSGID_CONNECT_COMPLETE message that contains your response.

The host can remove a player from the session by calling IDirectPlay8Peer::DestroyPeer. Other members of the session cannot call this method successfully. If you want to allow players to request that another player be removed from the session, you must send the request to the host with normal Microsoft® DirectPlay® messaging, and have the host handle the request.


© 2003 Microsoft Corporation. All rights reserved.