DPN_MSGID_DESTROY_PLAYER Message

DirectPlay

 
Microsoft DirectX 9.0 SDK Update (Summer 2003)

DPN_MSGID_DESTROY_PLAYER Message


Microsoft® DirectPlay® generates the DPN_MSGID_DESTROY_PLAYER message when a player leaves a peer-to-peer or client/server session.

The DPNMSG_DESTROY_PLAYER structure contains information for the DPN_MSGID_DESTROY_PLAYER system message.

Syntax

typedef struct _DPNMSG_DESTROY_PLAYER {
    DWORD dwSize;
    DPNID dpnidPlayer;
    PVOID pvPlayerContext;
    DWORD dwReason;
}  DPNMSG_DESTROY_PLAYER, *PDPNMSG_DESTROY_PLAYER;

Members

dwSize
Size of this structure.
dpnidPlayer
DPNID of the player deleted from the session.
pvPlayerContext
Player context value.
dwReason
One of the following flags indicating why the player was destroyed.
DPNDESTROYPLAYERREASON_NORMAL
The player is being deleted for normal reasons.
DPNDESTROYPLAYERREASON_CONNECTIONLOST
The player is being deleted because the connection was lost.
DPNDESTROYPLAYERREASON_SESSIONTERMINATED
The player is being deleted because the session was terminated.
DPNDESTROYPLAYERREASON_HOSTDESTROYEDPLAYER
The player is being deleted because the host called IDirectPlay8Peer::DestroyPeer.

Remarks

Return from the message callback function with DPN_OK.

In client/server mode, this message is received only by the server. In peer-to-peer mode, all players receive this message.

When the server closes a session, it receives a DPN_MSGID_DESTROY_PLAYER message for all connected players. Because the server knows that it is disconnecting, this is normal behavior, and the dwReason member of the associated structure is set to DPNDESTROYPLAYERREASON_NORMAL. The DPNDESTROYPLAYERREASON_SESSIONTERMINATED value is only set for unexpected disconnections.

You might receive DPN_MSGID_CREATE_PLAYER and DPN_MSGID_DESTROY_PLAYER messages on different threads. However, you will not receive a DPN_MSGID_DESTROY_PLAYER message before your callback function has returned from receiving a DPN_MSGID_CREATE_PLAYER message.

Message Information

Headerdplay8.h
Minimum operating systems Windows 98, Pocket PC 2002

© 2003 Microsoft Corporation. All rights reserved.