1.3 Overview

The DirectPlay 4 Protocol is a peer-to-peer protocol intended to allow computer games to manage metadata associated with many multiplayer computer games. It provides functionality that allows the game to:

  • Enumerate the hosted game sessions of the game.

  • Connect to a game hosted on another computer.

  • Enumerate the players and groups of players in an established game instance.

  • Send data from one established instance of the game to another established instance of the game.

  • Add and remove players from the game.

Because this is a peer-to-peer protocol, applications that participate in the protocol are typically not clients or servers; instead, each application participating in the protocol maintains its own version of the state of the protocol.

The first computer that started the game is designated as the host computer. The host computer holds the master set of game metadata and responds to requests to enumerate the game sessions and add players and groups.

When a game application decides to host a game, it configures the DirectPlay 4 game session using the following options.

DirectPlay flag

Behavior

DPSESSION_NEWPLAYERSDISABLED

0x00000001

The DirectPlay 4 host disables the creation of new players. Groups can continue to be added and managed.

Note This flag is dynamic.

DPSESSION_MIGRATEHOST

0x00000004

If the DirectPlay 4 host computer fails, the DirectPlay 4 Protocol will migrate the host computer to another machine. See section 3.1.6.2 for more information.

DPSESSION_NOMESSAGEID

0x00000008

If this option is set, the DirectPlay 4 Protocol will not include the PlayerTo and PlayerFrom field in player management messages (DPSP_MSG_PLAYERMESSAGE, DPSP_MSG_DELETEPLAYER, DPSP_MSG_DELETEGROUP, DPSP_MSG_ADDPLAYERTOGROUP, DPSP_MSG_DELETEPLAYERFROMGROUP).

DPSESSION_NOPLAYERMGMT

0x00000010

The DirectPlay 4 client will not generate player management messages (DPSP_MSG_PLAYERMESSAGE, DPSP_MSG_DELETEPLAYER, DPSP_MSG_DELETEGROUP, DPSP_MSG_ADDPLAYERTOGROUP, DPSP_MSG_DELETEPLAYERFROMGROUP).

DPSESSION_JOINDISABLED

0x00000020

The DirectPlay 4 Protocol will no longer allow computers to join the game session. Players and groups can continue to be added by computers already in the game session.

Note This flag is dynamic.

DPSESSION_KEEPALIVE

0x00000040

The DirectPlay 4 Protocol will periodically send DPSP_MSG_PING (section 2.2.42) messages to ensure that all computers in the game session are still functioning.

DPSESSION_NODATAMESSAGES

0x00000080

The DirectPlay 4 Protocol will not send DPSP_MSG_PLAYERDATACHANGED (section 2.2.44) messages.

DPSESSION_SECURESERVER

0x00000100

The DirectPlay 4 host computer will require all DirectPlay 4 clients connecting to the computer to authenticate, as specified in sections 3.1.5.1 and 3.2.5.7. Players in the game session can then sign and/or encrypt application data.

Note This option is incompatible with the DPSESSION_MIGRATEHOST option.

DPSESSION_PRIVATE

0x00000200

Established instances of the game that require computers to join ensure the user has entered the desired password prior to initiating the connection.

DPSESSION_PASSWORDREQUIRED

0x00000400

The game host will reply only to DPSP_MSG_ENUMSESSIONS (section 2.2.29) messages whose password matches the password of the game session.

DPSESSION_MULTICASTSERVER

0x00000800

The DirectPlay 4 client will transmit all game messages through the game host, which will then retransmit them to the various game clients.

Note This flag is incompatible with the DPSESSION_MIGRATEHOST option.

DPSESSION_CLIENTSERVER

0x00001000

When joining a game session, the game host will transmit information only about the system players on all the joined machines, not about the normal players.

Note This flag is incompatible with the DPSESSION_MIGRATEHOST option.

DPSESSION_DIRECTPLAYPROTOCOL

0x00002000

The DirectPlay 4 client will use the DirectPlay 4 Reliable Protocol [MC-DPL4R] for communication from the DirectPlay client to the game host and other DirectPlay 4 clients.

DPSESSION_NOPRESERVEORDER

0x00004000

When this option is set, the DirectPlay 4 client will not ensure that packets are passed to the higher-level protocol in the order in which they were received.

DPSESSION_OPTIMIZELATENCY

0x00008000

Tells the DirectPlay 4 Protocol to optimize for latency.

DPSESSION_NOSESSIONDESCMESSAGES

0x00020000

When a game on the DirectPlay 4 host updates game session information, the DirectPlay 4 host will not send a DPSP_MSG_SESSIONDESCCHANGED (section 2.2.51) message.

As other nascent game instances start on other computers, these instances use the DirectPlay 4 Protocol to enumerate established game sessions on the local network (a nascent game instance might ask the user to specify a specific game host and enumerate the list of game sessions explicitly from that host).

Diagram of session enumeration request and response

Figure 1: Diagram of session enumeration request and response

After enumerating the available game sessions, the game can choose one game session (typically after consulting with the user playing the game), and attempt to join the game session by requesting that the game host create a system player.

Once the system player for the client has been created, the game host will transmit the current set of game data to the joining nascent game instance and will notify all established game instances about the nascent game instance.

Diagram of a nascent game instance joining a game host and a third, established game instance

Figure 2: Diagram of a nascent game instance joining a game host and a third, established game instance

Once a nascent game instance has joined a game session, it becomes an established game instance. Any established game instance can add players or groups by requesting a player ID from the game host and transmitting information about the player to all of the established game instances, as shown in the following figure.

Diagram of an established game instance creating a non-system player

Figure 3: Diagram of an established game instance creating a non-system player