DirectX SDK

DPSESSIONDESC2

The DPSESSIONDESC2 structure contains a description of a session's capabilities.

Note that some of the session description flags are read-only and cannot be changed, and the rest can be changed only by the host. See the description of the dwFlags member.

typedef struct {
    DWORD dwSize;
    DWORD dwFlags;
    GUID  guidInstance;
    GUID  guidApplication;
    DWORD dwMaxPlayers;
    DWORD dwCurrentPlayers;
    union  {
        LPWSTR lpszSessionName;
        LPSTR  lpszSessionNameA;
    };
    union  {
        LPWSTR lpszPassword;
        LPSTR  lpszPasswordA;
    };
    DWORD dwReserved1;
    DWORD dwReserved2;
    DWORD dwUser1;
    DWORD dwUser2;
    DWORD dwUser3;
    DWORD dwUser4;
} DPSESSIONDESC2, FAR *LPDPSESSIONDESC2;

Members

dwSize
Size of the DPSESSIONDESC2 structure. The application must set this member before it uses the structure.
dwFlags
Combination of the following flags. The following flags cannot be changed once the session has started: DPSESSION_CLIENTSERVER, DPSESSION_DIRECTPLAYPROTOCOL, DPSESSION_KEEPALIVE, DPSESSION_MIGRATEHOST, DPSESSION_MULTICASTSERVER, DPSESSION_NOMESSAGEID, DPSESSION_OPTIMIZELATENCY, and DPSESSION_SECURESERVER. The other flags, DPSESSION_JOINDISABLED, DPSESSION_NEWPLAYERSDISABLED, DPSESSION_NODATAMESSAGES, DPSESSION_NOPRESERVEORDER, DPSESSION_PASSWORDREQUIRED, and DPSESSION_PRIVATE, can be changed after a session has started by using IDirectPlay4::SetSessionDesc, but only by the host.
DPSESSION_CLIENTSERVER
Specifies that this is a client/server session that is being hosted by an application-server process. This flag must be specified at the time the session is created. Any clients that join this session will only be able to enumerate the server player and any local players. The host of the session will see all the players. If this flag is not set, the session is a peer-to-peer session. If this flag is set, the host can only create a server player. This flag cannot be used with DPSESSION_MIGRATEHOST.
DPSESSION_DIRECTPLAYPROTOCOL
Specifies that this session should use the DirectPlay guaranteed protocol instead of the one implemented by the service provider. Use this flag if message throttling is desired (and you want the performance gains it provides), or if you want to ensure the availability of all the features of IDirectPlay4::SendEx. This flag also enables guaranteed sends on unreliable providers and uses DirectPlay's reliability code on TCP/IP, which generally gives better performance both in throughput and delivery.
DPSESSION_JOINDISABLED
Specifies that no new applications can join this session. Any call to the IDirectPlay4::Open method with the DPOPEN_JOIN flag and the globally unique identifier (GUID) of this session instance will cause an error. If this flag is not specified, new remote applications can join the session until the session player limit is reached.
DPSESSION_KEEPALIVE
Specifies that this session will automatically detect when remote players drop out of the game abnormally. Those players will be deleted from the session. If a temporary network outage caused the loss of the players, they will be informed when they return that they were dropped from the session through the DPMSG_SESSIONLOST system message. This flag must be specified at the time the session is created. If this flag is not specified, DirectPlay will not automatically keep the session alive if players are abnormally terminated.
DPSESSION_MIGRATEHOST
Specifies that if the current host exits, another computer in the session will become the host. The players on the new host computer will receive a DPMSG_HOST system message. This flag must be specified at the time the session is created. If this flag is not specified, the host will not migrate, new computers cannot join the session, and new players cannot be created if the current host leaves. Note that the DPSESSION_MIGRATEHOST flag cannot be used with the DPSESSION_CLIENTSERVER, DPSESSION_MULTICASTSERVER, or DPSESSION_SECURESERVER flags.
DPSESSION_MULTICASTSERVER
Specifies that in a peer-to-peer session, broadcast and group messages are routed through the host that acts like a multicast server. This flag must be specified at the time the session is created. The flag is only useful if the host has a high bandwidth connection to the network. If this flag is not specified, broadcast and group messages are sent directly between peers. This flag cannot be used with DPSESSION_MIGRATEHOST.
DPSESSION_NEWPLAYERSDISABLED
Specifies that new players cannot be created in the session. Any call to the IDirectPlay4::CreatePlayer method by an application in the session will result in an error. Also, new applications cannot join the session. If this flag is not specified, players can be created until the session player limit is reached.
DPSESSION_NODATAMESSAGES
Specifies that the session does not send system messages when remote player data, group data, or session data is changed with the IDirectPlay4::SetPlayerData, IDirectPlay4::SetGroupData, IDirectPlay4::SetPlayerName, IDirectPlay4::SetGroupName, or IDirectPlay4::SetSessionDesc method. If this flag is not specified, messages will be generated that indicate that the data changed.

Note that setting this flag also suppresses the DPMSG_SETSESSIONDESC message.

DPSESSION_NOMESSAGEID
Specifies that the session does not attach data to messages that indicate which player the message is from and to whom it is sent. Setting this flag saves message overhead if this information is not relevant. (For more information, see the IDirectPlay4::Receive method.) If this flag is not specified, the message ID will be added. This flag must be specified at the time the session is created.
DPSESSION_NOPRESERVEORDER
Specifies that this session does not preserve the order in which guaranteed messages are received. By default, the receive order of guaranteed messages is preserved. If the order is not needed, this flag can be used to eliminate possible delays in delivery.
DPSESSION_OPTIMIZELATENCY
Asks the service provider to optimize for latency (which turns off nagling in TCP/IP). The default is to optimize for bandwidth.
DPSESSION_PASSWORDREQUIRED
Specifies that this session is password-protected. Any applications wishing to join the session must supply the password in the IDirectPlay4::Open call. This is a read-only flag. It will be set automatically by DirectPlay when the host of the session specifies a non-NULL password.
DPSESSION_PRIVATE
Specifies that this is a private session. It cannot respond to enumeration requests unless the request contains a non-NULL, matching password. If this flag is not specified, the session will respond to enumeration requests.
DPSESSION_SECURESERVER
Specifies that this session is being hosted on a secure server that will require authentication credentials before it can be opened. The host must specify this flag when the session is created. It cannot be changed later through IDirectPlay4::SetSessionDesc. This flag cannot be used with the DPSESSION_MIGRATEHOST flag.
guidInstance
GUID of the session instance.
guidApplication
GUID for the application running in the session instance. It uniquely identifies the application so that DirectPlay connects only to other computers running the same application. This member can be set to GUID_NULL to enumerate sessions for any application.
dwMaxPlayers
Maximum number of players allowed in this session. A value of 0 means there is no maximum.
dwCurrentPlayers
Number of players currently in the session.
lpszSessionName
Pointer to a Unicode string containing the name of the session. Use only if a Unicode DirectPlay interface (IDirectPlay4 Interface) is being used.
lpszSessionNameA
Pointer to an ANSI string containing the name of the session. Use only if an ANSI DirectPlay interface (IDirectPlay4A) is being used.
lpszPassword
Pointer to a Unicode string containing the password used to join the session for participation. Use only if a Unicode DirectPlay interface (IDirectPlay4 Interface) is being used.
lpszPasswordA
Pointer to an ANSI string containing the password used to join the session for participation. Use only if an ANSI DirectPlay interface (IDirectPlay4A) is being used.
dwReserved1 and dwReserved2
Must be 0.
dwUser1, dwUser2, dwUser3, and dwUser4
Application-specific data for the session.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in dplay.h.

See Also

IDirectPlay4::EnumSessions, IDirectPlay4::GetSessionDesc, IDirectPlay4::Open, IDirectPlay4::SecureOpen, IDirectPlay4::SetSessionDesc, IDirectPlay4::CreatePlayer