Platform SDK: DirectX |
The DirectPlay4.GetDPEnumPlayers method enumerates the players and, optionally, groups in the current open session. If there is no open session, players in a remote session can be enumerated.
object.GetDPEnumPlayers(sessionGuid As String, _ flags As CONST_DPENUMPLAYERFLAGS) _ As DirectPlayEnumPlayers
Can be one or more of the following values from the CONST_DPENUMPLAYERFLAGS enumeration:
If the method succeeds, it returns a DirectPlayEnumPlayers object.
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_INVALIDPARAMS |
DPERR_NOSESSIONS |
DPERR_UNAVAILABLE |
This method returns DPERR_INVALIDPARAMS if an invalid sessionGuid or invalid flags were supplied. It returns DPERR_NOSESSIONS if there is no open session. It returns DPERR_UNAVAILABLE if the remote session could not be enumerated.
Within a lobby session, this method will always return DPERR_ACCESSDENIED.
By default, this method will enumerate players in the current open session. Groups can also be included in the enumeration by using the DPENUMPLAYERS_GROUP flag. The DPENUMPLAYERS_SESSION flag can be used, along with a session instance GUID, to request that a session's host provide its list for enumeration. This method cannot be called from within a DirectPlay4.GetDPEnumSessions enumeration. Furthermore, use of the DPENUMPLAYERS_SESSION flag with this method must occur after the GetDPEnumSessions method has been called, and before any calls to the DirectPlay4.Close or DirectPlay4.Open methods.
DirectPlay4.CreatePlayer, DirectPlay4.DestroyPlayer, Using GUIDs