DWC_SetupGameServer

Syntax

#include <dwc.h>

BOOL DWC_SetupGameServer(DWCTopologyType topology,
                         u8 maxEntry,
                         DWCMatchedSCCallback matchedCallback,
                         void *matchedParam,
                         DWCNewClientCallback newClientCallback,
                         void *newClientParam,
                         DWCConnectAttemptCallback attemptCallback,
                         u8 *connectionUserData,
                         void *attemptParam);

Arguments

topology The connection topology. Specified from inside DWCTopologyType.
maxEntry The maximum number of connected players (oneself included). A value from 2 to 32 can be set in this argument.
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.
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.

Return Values

TRUE Processing completed.
FALSE Not a good state for calling this function.

Description

This function starts up one's own console as a server host. If there is a request from a client host, this function performs the connection/disconnection processes. A server host in this context refers to a host that behaves as a parent device in DS wireless communication (see Note) during server-client matchmaking.

This function starts server-client matchmaking. Connections are accepted from client hosts until either the DWC_CloseAllConnectionsHard or DWC_ShutdownFriendsMatch functions are called. Then, if a client host that has started a connection to one's own local host is detected, a new connection client notification callback is called and the connection completion callback is called once the connection process of that client host completes.

The client host uses the DWC_ConnectToGameServerAsync function to connect to the server host.

Depending on the condition of the network connection, the process might be blocked and not return from the function for some time.

Note: DS wireless communication refers to local wireless communication using the Nintendo DS. Communication occurs directly between DS systems with a proprietary protocol; AP is not used. It consists of a single parent device and multiple child devices connected to the parent.

Revision History

2.0.0
Specification change.
1.3.2
Corrected a mistake "DS wireless connection" was changed to "DS wireless communication."
1.4.10
Added a section concerning the details of connecting to the network.
1.4.12
Added a description of DS wireless communications.

CONFIDENTIAL