#include <dwc.h>BOOL DWC_ConnectToAnybodyAsync(DWCTopologyType topology,
u8 maxEntry,
const char *addFilter,
DWCMatchedSCCallback matchedCallback,
void *matchedParam,
DWCNewClientCallback newClientCallback,
void *newClientParam,
DWCEvalPlayerCallback evalCallback,
void *evalParam,
DWCConnectAttemptCallback attemptCallback,
u8 *connectionUserData,
void *attemptParam);| topology | The connection topology. Specified from inside DWCTopologyType. |
| maxEntry | The number of people (including oneself) to request to be in the network. A value from 2 to 32 can be set in this argument. |
| addFilter | Character string for the matchmaking condition to be added to the game. If no condition is added, NULL is passed. Conditions can be written in standard SQL format. The maximum string length that can be set is 127 characters. In a debug build, the number of characters is checked to see if it exceeds this maximum. The character string is copied and maintained in the library. |
| matchedCallback | Pointer to the connection completion callback function. This is called for each person who connects. |
| matchedParam | Parameter for the connection completion callback. |
| newClientCallback | Pointer to the new connection client notification callback function. |
| newClientParam | Parameter for the new connection client notification callback function. |
| evalCallback | Pointer to the player evaluation callback function. |
| evalParam | Parameter for the player evaluation callback. |
| attemptCallback | Pointer to the connection acceptance callback function. |
| connectionUserData | Pointer to the local host's own connection acceptance parameter buffer. This must be buffer of length u8[DWC_CONNECTION_USERDATA_LEN]. The buffer’s contents will be copied to the library, so it can be deallocated once this function is called. If NULL is specified, zeros are set for the entire content of the local buffer that is used for determining whether to accept a connection. |
| attemptParam | Parameter for the connection acceptance callback. |
| TRUE | The process starts. The results are indicated via the callback function. |
| FALSE | Not a good state for calling this function. |
Creates a group by specifying a number of people, without specifying friends. This is known as "peer matchmaking without friend specification."
The addFilter argument can be used to configure the conditions for the player that is searched for as a matchmaking candidate. The matchmaking condition key used in this filter character string must be registered in advance using the DWC_AddMatchKeyInt or DWC_AddMatchKeyString function.
Note that there is no distinction between the development and product servers for friend management and the matchmaking process. When testing matchmaking during the development of a remastered or localized version, matchmaking will sometimes occur with titles that have already been released even if you specify DWC_AUTHSERVER_DEBUG in the DWC_Init function.
To avoid this, use a matchmaking filter to prevent peer matchmaking with friend specified between the release and development (debugging) versions. (Refer to the DWC_AddMatchKeyString function for more on matchmaking filters.)
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. The higher a player's evaluation value, the more likely that player will be selected as a matchmaking partner.
After this function is called, matchmaking proceeds as long as the DWC_ProcessFriendsMatch function continues to be called. The matchmaking completion callback is called if matchmaking with the first server host results in success, error, or cancel status. A new connection client notification callback is called when at least one client host has already connected to the server host and a new client host arrives to connect to the server host. In addition, once the connection for the new connection client is complete, the matchmaking completion callback is called again. Peer matchmaking without a friend specified automatically determines whether the local host is a server or client.
Depending on the condition of the network connection, the process might be blocked and not return from the function for some time.
Although matchmaking will not be performed with a peer with a different connection topology, note the following points. The evaluation callback is called when the DWCEvalPlayerCallback parameter has been set for the DWC_ConnectToAnybodyAsync/DWC_ConnectToFriendsAsync functions, even if the peer has a different connection topology. Because the evaluation callback has no way of knowing the connection topology of the peer, there is no method that can be used within the evaluation callback to exclude such peers.
If a peer selected for connection in the evaluation callback's filtering results actually has a different connection topology, matchmaking cannot be performed with that peer. This behavior repeats until a peer can be found with which matchmaking is possible. When using the DWC_ConnectToAnybodyAsync or DWC_ConnectToFriendsAsync functions, be sure to establish conditions for forming groups other than connection topology and then, within those groups, make sure the connection topology is uniform.
CONFIDENTIAL