DWC_ConnectToFriendsAsync

Syntax


#include <dwc.h>

BOOL DWC_ConnectToFriendsAsync(
             const u8 friendIdxList[],
             int friendIdxListLen,
             u8  numEntry,
             BOOL distantFriend,
             DWCMatchedCallback matchedCallback,
             void* matchedParam,
             DWCEvalPlayerCallback evalCallback,
             void* evalParam );
				

Description

This function specifies friends, makes connections, and creates a mesh network. This is known as peer matchmaking by specifying friends.

The argument friendIdxList specifies a pointer to the array of indices collected in the friend roster of the friend with whom matchmaking is intended. If NULL is specified in the index list, all friends in the friends roster are candidates for matchmaking. The friend roster, referenced during peer matchmaking by specifying friends, is specified with the DWC_InitFriendsMatch function.

If FALSE is specified in the distantFriend argument, only players who have mutual friend relationships remain in the mesh network after matchmaking completes. If TRUE is specified, one player has a mutual player relationships with all the other players, but the other players do not have a mutual friend relationship — they are friends of friends. Because each of the players is likely to have a different friend list or friend index list, the rate of successful matchmaking drops sharply if FALSE is specified.

If the argument evalCallback is specified, the designated evaluation callback function is called each time a matchmaking candidate player is found. The matchmaking condition key can be referenced by using the DWC_GetMatchIntValue or DWC_GetMatchStringValue function inside the evaluation callback function. Be sure to evaluate the player based on that value and return the evaluation value as the return value. Players with an evaluation value of 0 or less are excluded from matchmaking.

When connecting to specified friends through peer matchmaking, exactly one person at a time is found as a candidate player. If the evaluation value is greater than 0, matchmaking begins. If the value is 0 or lower, no matchmaking takes place.

If DWC_ProcessFriendsMatch is called continuously after this function is called, the matchmaking process continues. If the matchmaking results in success, error, or cancellation, the matchmaking completion callback is called.

Arguments

friendIdxList Pointer to the friend index list used for requesting connections. If NULL, the entire friend roster becomes the connection request target.
friendIdxListLen Length of the friend index list used for requesting connections. The maximum value is 64, just like the length of the friend roster.
numEntry Number of people (including oneself) to make up the requested network. A value from 2 to 32 can be set in this argument.
distantFriend TRUE: Connections to friends of friends permitted. FALSE: Not permitted.
matchedCallback Pointer to the matchmaking completion callback function.
matchedParam Parameter for the matchmaking completion callback.
evalCallback Pointer to the player evaluation callback function.
evalParam Parameter for player evaluation callback.

Return Values

TRUE The process starts. The results are indicated via the callback function.
FALSE Not a good state for calling this function.

See Also

DWC_AddMatchKeyInt
DWC_GetMatchIntValue
DWC_GetMatchStringValue
DWC_ConnectToAnybodyAsync
DWCEvalPlayerCallback

Revision History

2006/01/18 Revised the description of the function arguments friendIdxList and distantFriend.
2005/12/16 Described the function in detail. Corrected errors in Return Values.
2005/07/22 Initial version.


CONFIDENTIAL