Microsoft SDK for Java

createGroup

This method of the DirectPlay2 Class creates a logical group of players in the current session.

Syntax

public int createGroup(String friendlyName, String formalName, byte[] data, int dataSize);

Return Value

Returns a unique DirectPlay ID that identifies the new group.

Parameters

formalName The formal name of the group. Use null to indicate that the group has no formal name.
friendlyName The friendly name of the group. Use null to indicate that the group has no friendly name.
data A block of application-defined remote data to associate with the group ID. Null indicates that the group has no initial data. The data specified here is assumed to be remote data that will be propagated to all the other applications in the session as if setGroupData were called.
dataSize The size, in bytes, of data.

Remarks

Messages can be sent to a group, and DirectPlay will forward the message to every player in the group. The Group ID returned to the caller should be used to identify the group for message passing and data association. Player and Group identifiers assigned by DirectPlay will always be unique within the session. This method will generate a DPSYS_CREATEPLAYERORGROUP message that will be sent to all the other players.

See Also

DPMSG_CREATEPLAYERORGROUP, destroyGroup, enumGroups, enumGroupPlayers, send

© 1999 Microsoft Corporation. All rights reserved. Terms of use.