3.1.4.16 Send Application Data

There are three options available to the higher-level entity (game) when requesting that the DirectPlay client send a message to another client. The game can request guaranteed delivery of the message, the game can request encrypted delivery of the message, and the game can request that the contents of the message be signed.

When a higher-level entity indicates that the DirectPlay client SHOULD send a message to another player or group, if the DirectPlay client has not joined a game session, then the DirectPlay client MUST return an error to the application.

If the game session specified by the game has the Session.MulticastServer flag set and the higher layer entity requires to send a message to a group and the local client is not the DirectPlay host, then the DirectPlay client MUST route the message through the host. Instead of transmitting the message to the peers in the group directly, it MUST wrap the message with a DPSP_MSG_ASK4MULTICAST (section 2.2.14) or DPSP_MSG_ASK4MULTICASTGUARANTEED (section 2.2.15) header, depending on whether guaranteed delivery is required, and send this message to the host. The host MUST then forward the message without the header on to the clients in the group. If the game session was also created with the Session.ReliableProtocol flag set, then the forwarded message MUST be rewrapped, but with a DPSP_MSG_MULTICASTDELIVERY (section 2.2.37) header instead.

If the Session.Authenticated flag is not set, then the DirectPlay client MUST ignore the Encrypted or Signed option and treat the message as if the application did not request encryption or signing. Encryption and the signing of messages allows for applications to secure their payload and verify that the participants are valid, as well as ensure that the messages are not transformed during transport. Encryption and message-signing are activated by the application.<16>

Note A secure game session is different from a password-protected game session. DirectPlay 4 allows for securing access to a game session with a user-specified cleartext password that is specified by the host and which MUST be provided by all clients. Although not very secure, this form of security provides a very lightweight alternative that does not require user accounts and associated management. It is used to casually restrict access to a particular instance of a game session.

If the game session has the DPSESSION_DIRECTPLAYPROTOCOL flag set, then the DirectPlay client MUST transmit the message using the DirectPlay4 Reliable Protocol [MC-DPL4R].