Using System Messages

Messages returned by the IDirectPlay3::Receive method from player ID DPID_SYSMSG are system messages. All system messages begin with a double-word value specified by the dwType DWORD value. You can cast the buffer returned by the IDirectPlay3::Receive method to a generic message (DPMSG_GENERIC) and switch on the dwType element, which will have a value equal to one of the messages with the DPSYS_ prefix. After the application has determined which system message it is, the buffer should be cast to the appropriate structure (beginning with the DPMSG_ prefix) to read the data.

Your application should be prepared to handle the following system messages.

Value of dwType Message structure Cause
DPSYS_ADDGROUPTOGROUP DPMSG_ADDGROUPTOGROUP An existing group has been added to an existing group.
DPSYS_ADDPLAYERTOGROUP DPMSG_ADDPLAYERTOGROUP An existing player has been added to an existing group.
DPSYS_CHAT DPMSG_CHAT A chat message has been received.
DPSYS_CREATEPLAYERORGROUP DPMSG_CREATEPLAYERORGROUP A new player or group has been created.
DPSYS_DELETEGROUPFROMGROUP DPMSG_DELETEGROUPFROMGROUP A group has been removed from a group.
DPSYS_DELETEPLAYERFROMGROUP DPMSG_DELETEPLAYERFROMGROUP A player has been removed from a group.
DPSYS_DESTROYPLAYERORGROUP DPMSG_DESTROYPLAYERORGROUP An existing player or group has been destroyed.
DPSYS_HOST DPMSG_HOST The current host has left the session and this application is the new host.
DPSYS_SECUREMESSAGE DPMSG_SECUREMESSAGE A digitally signed or encrypted message has been received.
DPSYS_SESSIONLOST DPMSG_SESSIONLOST The connection with the session has been lost.
DPSYS_SETPLAYERORGROUPDATA DPMSG_SETPLAYERORGROUPDATA Player or group data has changed.
DPSYS_SETPLAYERORGROUPNAME DPMSG_SETPLAYERORGROUPNAME Player or group name has changed.
DPSYS_SETSESSIONDESC DPMSG_SETSESSIONDESC The session description has changed.
DPSYS_STARTSESSION DPMSG_STARTSESSION The lobby server is requesting that a session be started.