2.2.2 EnumResponse

When a valid EnumQuery message is received by a DirectPlay Server/Host, it SHOULD reply with an EnumResponse message. The DirectPlay Server/Host SHOULD NOT respond to any EnumQuery messages where the QueryType field is 0x01 and the ApplicationGUID field does not match the DirectPlay Server/Host GUID.

The EnumResponse message MUST be sent to the address from which the EnumQuery message was sent. The form of this address will depend on the DirectPlay 8 Service Provider that is being used. For example, in an IPv4 service provider, the address would consist of an IPv4 style address:port pair. The response MUST be sent from the address to which the DirectPlay Client/Peer connects if it chooses to join the game session.

The sizes of the variable-length fields in the EnumQuery message are limited by whatever limit is placed on the overall message size by the DirectPlay 8 Service Provider that is used to transmit the message.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

LeadByte

CommandByte

EnumPayload

ReplyOffset

ResponseSize

ApplicationDescSize

ApplicationDescFlags

MaxPlayers

CurrentPlayers

SessionNameOffset

SessionNameSize

PasswordOffset

PasswordSize

ReservedDataOffset

ReservedDataSize

ApplicationReservedDataOffset

ApplicationReservedDataSize

ApplicationInstanceGUID (16 bytes)

...

...

ApplicationGUID (16 bytes)

...

...

SessionName (variable)

...

Password (variable)

...

ReservedData (variable)

...

ApplicationReservedData (variable)

...

ApplicationData (variable)

...

LeadByte (1 byte): This field is 8 bits in length. It MUST be 0x00.

Note The first byte MUST be 0 for the message to be a valid EnumResponse message. When a message is received and the first byte is nonzero, the entire message MUST be passed through for processing as described in [MC-DPL8R].

CommandByte (1 byte): This field is 8 bits in length. It MUST be 0x03.

EnumPayload (2 bytes): This field is 16 bits in length. The EnumPayload is a value selected by the sender of the EnumQuery message that can be used to match EnumResponse messages to their corresponding EnumQuery.

Each EnumResponse message is generated because an EnumQuery message was received. The EnumPayload field in the EnumResponse message MUST match the EnumPayload field in the EnumQuery message that generated this EnumResponse message, so the DirectPlay Client/Peer can track which EnumQuery message this EnumResponse message is responding to.

ReplyOffset (4 bytes): This field is 32 bits in length. This field contains the zero-based offset, in bytes, of the ApplicationData field within this EnumResponse message. The zero-based offset of the ApplicationData field is measured from the start of the ReplyOffset field, that is, the offset into the EnumResponse message not counting the first 4 bytes. This field will be 0 if no ApplicationData field is contained in this message.

ResponseSize (4 bytes): This field is 32 bits in length. This field indicates the size, in bytes, of the ApplicationData field within the EnumResponse message. This field will be 0 if no ApplicationData field is contained in this message.

ApplicationDescSize (4 bytes): This field is 32 bits in length. Its value MUST be 0x00000050. It represents the sum of the size of this field plus the ApplicationDescFlags, MaxPlayers, CurrentPlayers, SessionNameOffset, SessionNameSize, PasswordOffset, PasswordSize, ReservedDataOffset, ReservedDataSize, ApplicationReservedDataOffset, ApplicationReservedDataSize, ApplicationInstanceGUID, and ApplicationGUID fields.

ApplicationDescFlags (4 bytes): This field is 32 bits in length and provides the characteristics of the application game session. It is a combination of the following bit flags.

Value

Meaning

DPNSESSION_CLIENT_SERVER

0x00000001

A client/server game session. If clear, a peer-to-peer game session.

DPNSESSION_MIGRATE_HOST

0x00000004

Host migration is allowed.

DPNSESSION_NODPNSVR

0x00000040

Not using DirectPlay Name Server (DPNSVR) (game session is not enumerable via well-known port 6073).

DPNSESSION_REQUIREPASSWORD

0x00000080

Password required to join game session.

DPNSESSION_NOENUMS

0x00000100

Enumerations are not allowed. This flag will never be set in an EnumResponse message.

DPNSESSION_FAST_SIGNED

0x00000200

Fast message signing is in use. For details about fast message signing, see [MC-DPL8R].

DPNSESSION_FULL_SIGNED

0x00000400

Full message signing is in use. For details about full message signing, see [MC-DPL8R].

Note Flags 0x00000200 and 0x00000400 will never both be set, because a game session MUST never use both fast message signing and full message signing at the same time.

MaxPlayers (4 bytes): This field is 32 bits in length. It contains the maximum number of players that can join the game session identified by this EnumResponse message.

CurrentPlayers (4 bytes): This field is 32 bits in length. It contains the number of players currently in the game session at the time the EnumResponse message was sent by the DirectPlay Server/Host. Note that by the time the EnumResponse is received by the DirectPlay Client/Peer, the number of players in the game session might have changed.

SessionNameOffset (4 bytes): A 32-bit field that specifies the offset, in bytes, from the start of the ReplyOffset field to the SessionName field. If SessionNameOffset is 0, the packet does not include a game session name.

SessionNameSize (4 bytes): A 32-bit field that contains the size, in bytes, of the SessionName field within this EnumResponse message. The size includes the termination character. If SessionNameSize is 0, the packet does not include a game session name.

PasswordOffset (4 bytes): This field is 32 bits in length. A password is never used in the EnumResponse message; therefore, the PasswordOffset field will always be 0.

PasswordSize (4 bytes): This field is 32 bits in length. A password is never used in the EnumResponse message; therefore, the PasswordSize field will always be 0.

ReservedDataOffset (4 bytes): A 32-bit field that specifies the offset, in bytes, from the end of the EnumPayload field to the ReservedData field. If ReservedDataOffset is 0, the packet does not include any reserved data. The ReservedDataOffset field was intended to be used for future extensions to the DirectPlay 8 Protocol, but was never used. This field is not used in the EnumResponse message and will be 0.

ReservedDataSize (4 bytes): A 32-bit field that specifies the size, in bytes, of the ReservedData field. If the value of the ReservedDataOffset field is 0, then ReservedDataSize MUST be 0. If ReservedDataOffset is not 0, then ReservedDataSize MUST NOT be 0. This field is not used in the EnumResponse message and will be 0.

ApplicationReservedDataOffset (4 bytes): This field is 32 bits in length. It contains the zero-based offset, in bytes, of the ApplicationReservedData field within this EnumResponse message. The zero-based offset of the ApplicationReservedData field is measured from the start of the ReplyOffset field, that is, the offset into the EnumResponse message not counting the first 4 bytes. If no ApplicationReservedData is contained in the EnumResponse message, this field will be 0.

ApplicationReservedDataSize (4 bytes): This field is 32 bits in length. It contains the size, in bytes, of the ApplicationReservedData field within this EnumResponse message. If no ApplicationReservedData is contained in the EnumResponse message, this field will be 0.

ApplicationInstanceGUID (16 bytes): This field is 128 bits in length. It contains the GUID that identifies the particular instance of the DirectPlay Server/Host that generated this EnumResponse message. Each instance of a DirectPlay Server/Host generates a new GUID each time it chooses to host a new game session. Since GUIDs are by definition unique, each game session will have a unique ApplicationInstanceGUID. For more information about the GUID type, see [MS-DTYP] section 2.3.4.

ApplicationGUID (16 bytes): This field is 128 bits in length. It contains the GUID that identifies the DirectPlay Server/Host type that generated this EnumResponse. Each game MUST generate its own GUID to identify itself, and all DirectPlay Servers/Hosts for that game share the same ApplicationGUID that identifies the type of the DirectPlay Server/Host.

SessionName (variable): An optional, variable-length field that contains the human-readable name of the game session in 16-bit Unicode characters. The position of the field within the packet is determined by the SessionNameOffset field and the size specified in the SessionNameSize field, in bytes. The field is zero-terminated.

Password (variable): The EnumResponse message will never contain a password; therefore, this field is unused.

ReservedData (variable): The ReservedData field was intended to be used for future extensions to the DirectPlay 8 Protocol, but was never used. This field will never be used since DirectPlay has been deprecated.

ApplicationReservedData (variable): This optional field is of variable length. Its zero-based offset within the EnumResponse message is specified in the ApplicationReservedDataOffset field. Its size, in bytes, is specified in the ApplicationReservedDataSize field. The contents of this field are determined by the game. This field is intended to represent game-specific data that changes infrequently. For example, data that is set when the game session is created, but does not change thereafter, is appropriate for use in this field.

ApplicationData (variable): This optional field is of variable length. Its zero-based offset within the EnumResponse message is specified in the ReplyOffset field. Its size, in bytes, is specified in the ResponseSize field. The contents of this field are determined by the game. This field is intended to represent game-specific data that changes frequently. For example, data that changes as the game session is used, such as the current state of the game, is appropriate for use in this field.