#include <dwc.h>int DWC_Init(DWCAUTHSERVER authserver,
const char *gamename,
u32 gamecode,
DWCAllocEx alloc,
DWCFreeEx free);| authserver | Specifies the authentication server. |
| gamename | Game name (NULL if not using the GameSpy service). |
| gamecode | Normally, the initial code (in half-width alphanumeric capital letters) assigned to each game. For example, 'RABA' is assigned when the game code is RABA. |
| alloc | Pointer to the DWCAllocEx function used to allocate the memory. |
| free | Pointer to the DWCFreeEx function used to free the memory. |
| 0 | Function completed successfully. |
This function initializes the DWC library. Be absolutely sure to call this function first when using the DWC library.
After initialization of the DWC library, DWC will transition to the error state if the network has been disconnected. Once the DWC library has completed normally during reconnection, the appropriate recovery processing must be performed for the SO library as well.
The authentication server selected here affects the server selected for the following modules:
Authentication server | DWC_AUTHSERVER_DEBUG | DWC_AUTHSERVER_RELEASE |
Ranking server | Debug server | Actual server |
Data storage server | Debug server | Actual server |
Download server | Debug server | Actual server |
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.)
Use the DWC_InitFriendsMatch function to set communication groups for each game title to avoid mixed communications with other games when using Nintendo Wi-Fi Connection. The gamecode value sets the range of friend relationships (namespace) in these communication groups.
In gamecode, specify the initial code normally assigned to each game title. When forming friend relationships outside the marketing region, set one of the initial codes to be shared.
Since the memory allocation and deallocation functions used with this function may be used by another thread, be sure to use thread exclusion control. For an example, see the demo.
There is no problem allocating memory from either MEM1 or MEM2.
DWC_Init is a block function.
DWC_LoginAsync so that now this function can be called without being connected to the network.gamecode is now passed as an argument.gamename is passed as an argument, and changed specifications so that an allocator is passed as an argument.CONFIDENTIAL