Platform SDK: DirectX

DirectPlayMessage

The DirectPlayMessage class provides methods for reading and writing message data. An application creates a DirectPlayMessage object by using the DirectPlay4.CreateMessage method. Message objects are retrieved by the DirectPlay4.Receive and DirectPlayLobby3.ReceiveLobbyMessage methods.

Messages can contain data of any type, and types can be freely mixed within a message. It is up to the application to ensure that data is read from the message in the same order as it was written.

System messages always have a Long as the first data element that identifies the message type. Once the application has determined the type of the message by reading this value, it can proceed to parse the rest of the data appropriately by using the read methods of DirectPlayMessage. See CONST_DPSYSMSGTYPES for more information on the data format for each kind of system message.

The methods of the DirectPlayMessage class may be grouped as follows:

Read data GetMessageData
  MoveToSecureMessage
MoveToTop
ReadByte
ReadDouble
ReadGuid
ReadLong
ReadShort
ReadSingle
ReadString
ReadSysChatString
ReadSysMsgConnection
ReadSysMsgData
ReadSysMsgSessionDesc
Write data SetMessageData
  WriteByte
WriteDouble
WriteGuid
WriteLong
WriteShort
WriteSingle
WriteString
Miscellaneous Clear
  GetMessageSize