DirectX SDK

Player Management

A player represents a logical object within the session that can send and receive messages. When a player is created, DirectPlay assigns a unique identity number that will not be reused as long as the session lasts.

Each player is identified as being either a local player (one that exists on your computer) or a remote player (one that exists on another computer). Each computer must have at least one local player before it can start sending and receiving messages. Individual computers can have more than one local player.

When an application sends a message, it is always directed to another player—not another computer. The destination player can be another local player (in which case the message will not go out over the network) or a remote player. Similarly, when an application receives messages, they are always addressed to a specific (local) player and marked as being from some other player (except system messages, which are always marked as being from DPID_SYSMSG).

DirectPlay provides some additional player management methods that an application can use. They enable an application to associate a name with a player and automatically propagate that name to all the computers in the session. Similarly, the application can associate some arbitrary data with a player that will be propagated to all the other computers in the session. The application can also associate private local data with a player that is available only to the local computer.

[C++]

DirectPlay provides the following essential methods for player management:

DirectPlay provides these additional methods to manage player information:

[Visual Basic]

DirectPlay provides the following essential methods for player management:

DirectPlay provides these additional methods to manage player information: