Group Management

DirectPlay supports groups within a session. A group is logical collection of players. By creating a group of players, an application can send a single message to the group and all the players in the group will receive the message. A group is the means by which a network's multicast capabilities are exposed to the application.

Groups can also be used as a general means to organize players in a session. A player can belong to more than one group. DirectPlay provides methods for administering groups and their membership. Additional methods associate names and data with individual groups as a convenience, but you don't need them to use groups.

The following diagram shows a logical representation of the contents of a DirectPlay session.

Basic Group Management Methods

DirectPlay provides several group management methods:

·IDirectPlay3::EnumGroups enumerates all the groups in the session.

·IDirectPlay3::CreateGroup creates a new group.

·IDirectPlay3::DestroyGroup destroys a group that this computer created.

·IDirectPlay3::EnumGroupPlayers enumerates the players that are in a group.

·IDirectPlay3::AddPlayerToGroup adds a player to a group.

·IDirectPlay3::DeletePlayerFromGroup removes a player from a group.

Additional Group Management Methods

DirectPlay provides these additional methods to manage group information:

·IDirectPlay3::GetGroupName gets the group's name.

·IDirectPlay3::SetGroupName changes the name of a group created by this computer.

·IDirectPlay3::GetGroupData gets the application-specific data associated with a group.

·IDirectPlay3::SetGroupData changes the application-specific data associated with a group created by this computer.

·IDirectPlay3::GetGroupFlags gets the flags describing a group.

·IDirectPlay3::GetGroupParent gets the DPID of the parent of the group.

New Group Management Methods

DirectPlay 5 has added these methods that manage groups within groups and shortcuts to groups:

·IDirectPlay3::CreateGroupInGroup creates a group within an existing group.

·IDirectPlay3::EnumGroupsInGroup enumerates all the groups within another group.

·IDirectPlay3::AddGroupToGroup adds a shortcut from a group to an already existing group.

·IDirectPlay3::DeleteGroupFromGroup removes a group previously added to another with AddGroupToGroup, but doesn't destroy the deleted group.

·IDirectPlay3::GetGroupConnectionSettings retrieves a group's connection settings.

·IDirectPlay3::SetGroupConnectionSettings sets a group's connection settings.