Group Management

The group-management methods allow your application to create groups of players in a session. The application can then send messages to the group, rather than to one player at a time, by using a single call to the IDirectPlay2::Send method. Some service providers can send messages to groups (multicasting) more efficiently than sending them to individual players in a group, so, in addition to simplifying player management, you can use groups to conserve communication-channel bandwidth.

The IDirectPlay2::CreateGroup and IDirectPlay2::DestroyGroup methods create and delete a group of players. When a group is created, the application can assign it friendly and formal names, just as it does when it creates a player. DirectPlay assigns the group a group ID. The group is initially empty, but the application can use the IDirectPlay2::AddPlayerToGroup and IDirectPlay2::DeletePlayerFromGroup methods to add and delete players. The state of the DPSESSION_NEWPLAYERSDISABLED flag in the session description does not affect the ability to create groups, or to add or delete players from a group.

To determine what groups already exist, the application can use the IDirectPlay2::EnumGroups method. To enumerate the players in a group, it can use the IDirectPlay2::EnumGroupPlayers method.

An application can change the name of a group by using the IDirectPlay2::SetGroupName method. This causes a system message to be sent to the other players, who can determine the new name by using the IDirectPlay2::GetGroupName method.