Platform SDK: DirectX |
The DirectPlay4.DestroyPlayer method deletes a local player from the session, removes any pending messages destined for that player from the message queue, and removes the player from any groups to which the player belonged.
In general, only the application that created the player can destroy the player. However, the host of the session can also destroy the player.
object.DestroyPlayer(playerId As Long)
If the method fails, an error is raised and Err.Number may be set to one of the following values:
DPERR_ACCESSDENIED |
DPERR_CONNECTIONLOST |
DPERR_INVALIDOBJECT |
DPERR_INVALIDPLAYER |
DPERR_UNAVAILABLE |
This method generates a DPSYS_DELETEPLAYERFROMGROUP system message for each group that the player belongs to and then generates a DPSYS_DESTROYPLAYERORGROUP system message.
A player cannot be destroyed if the player has pending asynchronous messages in the send queue. This method removes any pending messages destined for that player from the message queue.
The player ID will not be reused during the current session.