Microsoft DirectX 8.1 (C++) |
Microsoft® DirectPlay® generates the DPN_MSGID_TERMINATE_SESSION message when a session is terminated by the host.
The DPNMSG_TERMINATE_SESSION structure contains information for the DPN_MSGID_TERMINATE_SESSION system message.
typedef struct { DWORD dwSize; HRESULT hResultCode; PVOID pvTerminateData; DWORD dwTerminateDataSize; } DPNMSG_TERMINATE_SESSION, *PDPNMSG_TERMINATE_SESSION;
Return DPN_OK.
In a peer-peer game that permits host-migration, if the current host calls Close or stops responding, the session does not terminate. Instead, the host migrates and all nonhost players receive a DPN_MSGID_DESTROY_PLAYER message for the host's players, and a DPN_MSGID_HOST_MIGRATE message for the new host. To prevent host migration, the host must shut down the session by calling IDirectPlay8Peer::TerminateSession. When the host terminates a session this way, all players receive a DPN_MSGID_TERMINATE_SESSION message with hResultCode set to DPNERR_HOSTTERMINATEDSESSION. The session will terminate, generating DPN_MSGID_DESTROY_PLAYER messages for every player.
In a peer-peer game that does not permit host-migration, the session is terminated if the host calls IDirectPlay8Peer::Close, or stops responding. In that case, DPN_MSGID_TERMINATE_SESSION is sent to all players with hResultCode set to DPNERR_CONNECTIONLOST. The session will terminate, generating DPN_MSGID_DESTROY_PLAYER messages for every player.
In a client/server game, the session is also terminated if the host calls IDirectPlay8Server::Close or stops responding. In that case, DPN_MSGID_TERMINATE_SESSION is sent to all connected clients with hResultCode set to DPNERR_CONNECTIONLOST. The DPN_MSGID_DESTROY_PLAYER message not sent to clients. If the server disconnected by calling IDirectPlay8Server::Close, it will receive DPN_MSGID_DESTROY_PLAYER messages for all players, including its own. Otherwise, the server will only receive DPN_MSGID_DESTROY_PLAYER for the clients' players.
Note The DPN_MSGID_TERMINATE_SESSION message typically arrives before any DPN_MSGID_DESTROY_PLAYER messages. However, the order of arrival is not guaranteed.
Windows NT/2000/XP: Available as a redistributable for Windows 2000 and later.
Windows 98/Me: Available as a redistributable for Windows 98 and later.
Header: Declared in Dplay8.h.