IDirectPlay8Peer Interface

DirectPlay

 
Microsoft DirectX 9.0 SDK Update (Summer 2003)

IDirectPlay8Peer Interface


Applications use the methods of the IDirectPlay8Peer interface to create a peer-to-peer Microsoft® DirectPlay® session.

IDirectPlay8Peer Members

AddPlayerToGroup

Adds a peer to a group.

When this method is called, all peers connected to the application receive a DPN_MSGID_ADD_PLAYER_TO_GROUP message.

CancelAsyncOperation

Cancels asynchronous requests. For instance, several methods of the IDirectPlay8Peer interface run asynchronously by default. Depending on the situation, you might want to cancel requests before they are processed. All the methods of this interface that can run asynchronously return an hAsyncHandle parameter.

Specific requests are canceled by passing the hAsyncHandle of the request in this method's hAsyncHandle parameter. You can cancel all pending asynchronous operations by calling this method, specifying NULL in the hAsyncHandle parameter, and specifying DPNCANCEL_ALL_OPERATIONS in the dwFlags parameter. If a specific handle is provided to this method, no flags should be set.

Close

Closes the open connection to a session and uninitializes the IDirectPlay8Peer object. This method must be called on any object successfully initialized with IDirectPlay8Peer::Initialize.

Connect

Establishes the connection to all the peers in a peer-to-peer session. When a connection is established, the communication channel on the interface is open and the application should expect messages to arrive immediately. No messages can be sent by way of the IDirectPlay8Peer::SendTo method until the connection has completed.

CreateGroup

Creates a group in the current session. A group is a logical collection of players.

DestroyGroup

Deletes a group created by the IDirectPlay8Peer::CreateGroup method. This method can be called by any peer in the session.

DestroyPeer

Deletes a peer from the session.

EnumGroupMembers

Retrieves a list of all players in a group.

EnumHosts

Enumerates applications that host DirectPlay games.

EnumPlayersAndGroups

Retrieves a list of all the player and/or group identifiers for the session.

EnumServiceProviders

Enumerates all the registered service providers available to the application.

GetApplicationDesc

Retrieves the full application description for the connected application.

GetCaps

Retrieves the DPN_CAPS or DPN_CAPS_EX structure for the current interface.

GetConnectionInfo

Retrieves statistical information about the connection between the local application and the specified remote player.

GetGroupContext

Retrieves the group context value for the specified group.

GetGroupInfo

Retrieves a block of data associated with a group, including the group name.

This method is typically called after a DPN_MSGID_GROUP_INFO system message is received indicating that the group data has been modified.

GetLocalHostAddresses

Retrieves the local addresses being used to host the session.

GetPeerAddress

Retrieves the address for the specified remote player in the session.

GetPeerInfo

Retrieves peer information set for the specified peer.

GetPlayerContext

Retrieves the player context value for the specified peer.

GetSendQueueInfo

Used by the application to monitor the size of the send queue.

GetSPCaps

Retrieves the DPN_SP_CAPS structure for the specified service provider.

Host

Creates a new peer-to-peer session, hosted by the local computer.

Initialize

Registers an entry point in the peer's code that receives all the messages from the IDirectPlay8Peer interface and from remote peers. This method must be called before calling any other methods of this interface.

RegisterLobby

Allows launched applications to automatically propagate game status to the lobby.

RemovePlayerFromGroup

Removes a peer from a group.

When this method is called all peers connected to the application receive a DPN_MSGID_REMOVE_PLAYER_FROM_GROUP message.

ReturnBuffer

Retrieves message buffers provided to the application through the pReceiveData member of the DPN_MSGID_RECEIVE system message. If the user's message handler returns DPNSUCCESS_PENDING to the RECEIVE callback, DirectPlay assumes that ownership of the buffer is transferred to the application, and neither frees nor modifies it until ownership is returned to DirectPlay through this call.

SendTo

Transmits data to another peer or group within the session by sending a message to the appropriate message handlers. The message can be sent synchronously or asynchronously.

SetApplicationDesc

Changes the settings for the application that is being hosted. Only some settings can be changed.

SetCaps

Sets the DPN_CAPS or DPN_CAPS_EX structure for the current interface.

SetGroupInfo

Sets a block of data associated with a group, including the name of the group.

Calling this method generates a DPN_MSGID_GROUP_INFO message, which is sent to all the peers connected to the application.

SetPeerInfo

Sets the static settings of the local peer. Call this method before connecting to relay basic player information with the application. When the peer successfully connects with the application, information set through this method can be retrieved by other players by calling the IDirectPlay8Peer::GetPeerInfo method.

SetSPCaps

Sets the DPN_SP_CAPS structure for the specified service provider.

TerminateSession

Terminates the current DirectPlay session.

Interface Information

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

© 2003 Microsoft Corporation. All rights reserved.