2.2.2 DPLAYI_PACKEDPLAYER

The DPLAYI_PACKEDPLAYER structure contains data related to players or groups.


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

Size

Flags

PlayerID

ShortNameLength

LongNameLength

ServiceProviderDataSize

PlayerDataSize

NumberOfPlayers

SystemPlayerID

FixedSize

PlayerVersion

ParentID

ShortName (variable)

...

LongName (variable)

...

ServiceProviderData (variable)

...

PlayerData (variable)

...

PlayerIDs (variable)

...

Size (4 bytes): MUST contain the total size of the DPLAYI_PACKEDPLAYER structure plus the values of the ShortNameLength, LongNameLength, ServiceProviderDataSize, and PlayerDataSize fields.

Flags (4 bytes): MUST contain 0 or more of the following player flags.


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

S

P

N

S

P

G

P

L

X

SP (1 bit): The player is the system player.

NS (1 bit): The player is the name server (host). It MUST be combined with SP.

PG (1 bit): The player belongs to a group. This flag MUST be set for system players, for other players that have been added to a group using DPSP_MSG_ADDPLAYERTOGROUP (section 2.2.12), or for groups that have been added to a group using DPSP_MSG_ADDSHORTCUTTOGROUP (section 2.2.13).

PL (1 bit): The player is on the sending machine. This flag does not have meaning on other machines and MUST be ignored on receipt.

X (28 bits): All bits that have this label SHOULD be set to zero when sent and MUST be ignored on receipt.

PlayerID (4 bytes): The player ID.

ShortNameLength (4 bytes): MUST contain the length of the player's short name, in octets. If there is no player short name, this field MUST be set to zero.

LongNameLength (4 bytes): MUST contain the length, in octets, of the player's long name. If there is no player long name, this field MUST be set to zero.

ServiceProviderDataSize (4 bytes): MUST contain the length, in octets, of the ServiceProviderData field. If there is no network service provider data, this field MUST be set to zero.

PlayerDataSize (4 bytes): MUST contain the length of the per-game player data, in octets. If there is no per-game player data, this field MUST be set to zero.

NumberOfPlayers (4 bytes): MUST contain the number of entries in the PlayerIDs field. If the player represented in the DPLAYI_PACKEDPLAYER structure is not a group, this field MUST be set to zero.

SystemPlayerID (4 bytes): MUST contain the ID of the system player for this game session.

FixedSize (4 bytes): MUST contain the size, in octets, of the fixed portion of this structure and MUST be 48.

PlayerVersion (4 bytes): MUST contain the version of the current player or group. The version for system players MUST match the protocol dialect version used by the creating instance. The version for non-system players or groups SHOULD be the protocol dialect version used by the creating instance and it MUST be ignored by receivers. The DirectPlay4 Core and Service Provider Protocol supports the protocol dialect versions identified in the description of the VersionOrSystemPlayerID field in DPLAYI_SUPERPACKEDPLAYER (section 2.2.3).

ParentID (4 bytes): MUST contain the identifier of the parent group. If this DPLAYI_PACKEDPLAYER structure represents a player, or if it is a group that is not contained in another group, this field MUST be set to zero.

ShortName (variable): If the ShortNameLength field is nonzero, this MUST contain the null-terminated Unicode string that contains the player's short name.

LongName (variable): If the LongNameLength field is nonzero, this MUST contain the null-terminated Unicode string that contains the player's long name.

ServiceProviderData (variable): If ServiceProviderDataSize is nonzero, this MUST be set to the data that is used by the DirectPlay Service Provider.

If provided, the Windows Winsock DirectPlay Service Provider stores the following data in the ServiceProviderData field.


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

Stream Socket Address (16 bytes)

...

...

Datagram Socket Address (16 bytes)

...

...

Stream Socket Address (16 bytes): A SOCKADDR_IN structure that contains the addressing information to be used when contacting this player over TCP. If the PL flag is set in the Flags field, the Address field of this SOCKADDR_IN must be set to 0.0.0.0.

Datagram Socket Address (16 bytes): A SOCKADDR_IN structure that contains the addressing information to be used when contacting this player over UDP. If the PL flag is set in the Flags field, the Address field of this SOCKADDR_IN must be set to 0.0.0.0.

PlayerData (variable): If PlayerDataSize is nonzero, this MUST be set to the byte array of game-specific per-player data.

PlayerIDs (variable): MUST contain an array of PlayerIDs where the array size is specified in NumberOfPlayers. If NumberOfPlayers is 0, this field MUST NOT be present.