Platform SDK: DirectX |
Once an application has created a player, it can start exchanging player messages with other participants in the session. In addition, DirectPlay itself generates system messages to notify players of events such as a player joining or leaving the session.
A player message can be sent to an individual player, to all players, or to a subset of players defined as a group, and is identified by the sending player's ID. System messages are sent to all the players in a session, and have a sender ID equal to the constant DPID_SYSMSG.
All the messages received by an application are put into a receive queue. The application must retrieve individual messages from the queue and act on them. The application can either poll the receive queue for messages or rely on a synchronization event for notification that a new message has arrived.
The following sections give more information on how to use messages in DirectPlay.