1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows"> 8<title>DWC_Init</title> 9<LINK rel="stylesheet" href="../css/nitro.css" type="text/css"> 10</head> 11 12<body> 13<a name="dwc__init_8h_1ba520615e52faced35b4cbaba253f29b"></a> 14<h1 align="left">DWC_Init</h1> 15<h2>Syntax</h2> 16 17<dl> 18 <dd> 19<CODE>#include <dwc.h></CODE><BR> 20 <BR> 21 <PRE><CODE>int <a href=DWC_Init.html#dwc__init_8h_1ba520615e52faced35b4cbaba253f29b>DWC_Init</a>(<a href=Macro.html#dwc__init_8h_198dbb93ff33fc8cf55e08525c6cb8aad>DWCAUTHSERVER</a> authserver, 22 const char *gamename, 23 u32 gamecode, 24 <a href=DWCAllocEx.html#dwc__memfunc_8h_1b5f2b223b85ed60bd0d8e2e762b29eca>DWCAllocEx</a> alloc, 25 <a href=DWCFreeEx.html#dwc__memfunc_8h_11be107310163287289a67f7d768cd535>DWCFreeEx</a> free);</CODE></PRE></dd> 26</dl> 27 28<h2>Arguments</h2> 29 30<TABLE border="1" width="100%"> 31 <TBODY> 32 33 <TR> 34<TD width="13%"><EM><STRONG>authserver</STRONG></EM></TD> 35<TD width="87%">Specifies the authentication server.</TD> 36 </TR> 37 38 <TR> 39<TD width="13%"><EM><STRONG>gamename</STRONG></EM></TD> 40<TD width="87%">Game name (NULL if not using the GameSpy service).</TD> 41 </TR> 42 43 <TR> 44<TD width="13%"><EM><STRONG>gamecode</STRONG></EM></TD> 45<TD width="87%">Normally, the initial code (in half-width alphanumeric capital letters) assigned to each game.<br>For example, 'RABA' is assigned when the game code is RABA.</TD> 46 </TR> 47 48 <TR> 49<TD width="13%"><EM><STRONG>alloc</STRONG></EM></TD> 50<TD width="87%">Pointer to the <A href="DWCAllocEx.html"><CODE>DWCAllocEx</CODE></a> function used to allocate the memory.</TD> 51 </TR> 52 53 <TR> 54<TD width="13%"><EM><STRONG>free</STRONG></EM></TD> 55<TD width="87%">Pointer to the <A href="DWCFreeEx.html"><CODE>DWCFreeEx</CODE></a> function used to free the memory.</TD> 56 </TR> 57 58 </TBODY> 59</TABLE> 60 61<h2>Return Values</h2> 62 63<TABLE border="1" width="100%"> 64 <TBODY> 65 66 <TR> 67 <TD width="13%"><EM><STRONG>0</STRONG></EM></TD> 68<TD width="87%">Function completed successfully.</TD> 69 </TR> 70 71 </TBODY> 72</TABLE> 73 74<H2>Description</H2> 75<p>This function initializes the DWC library. Be absolutely sure to call this function first when using the DWC library.</p><p>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.</p><p>The authentication server selected here affects the server selected for the following modules:</p><p><table border="1"><tr><td><br>Authentication server<br></td><td><br><a href=Macro.html#dwc__init_8h_198dbb93ff33fc8cf55e08525c6cb8aadfce8a5ddc7b95c60c6ba0e341cb4f872><CODE>DWC_AUTHSERVER_DEBUG</CODE></a><br></td><td><br><a href=Macro.html#dwc__init_8h_198dbb93ff33fc8cf55e08525c6cb8aad3103528e32386ebfcff75668fcca28ea><CODE>DWC_AUTHSERVER_RELEASE</CODE></a><br></td></tr><tr><td><br>Ranking server<br></td><td><br>Debug server<br></td><td><br>Actual server<br></td></tr><tr><td><br>Data storage server<br></td><td><br>Debug server<br></td><td><br>Actual server<br></td></tr><tr><td><br>Download server<br></td><td><br>Debug server<br></td><td><br>Actual server<br></td></tr></table></p><p>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 <a href=Macro.html#dwc__init_8h_198dbb93ff33fc8cf55e08525c6cb8aadfce8a5ddc7b95c60c6ba0e341cb4f872><CODE>DWC_AUTHSERVER_DEBUG</CODE></a> in the <a href=DWC_Init.html#dwc__init_8h_1ba520615e52faced35b4cbaba253f29b><CODE>DWC_Init</CODE></a> function.</p><p>To avoid this, use a matchmaking filter to prevent peer matchmaking with friend specified between the release and development (debugging) versions. (Refer to the <a href=DWC_AddMatchKeyString.html#dwc__match_8h_1a6dc592558f9f69faff4f1911782f3a8><CODE>DWC_AddMatchKeyString</CODE></a> function for more on matchmaking filters.)</p><p>Use the <CODE><a href="DWC_InitFriendsMatch.html">DWC_InitFriendsMatch</a></CODE> function to set communication groups for each game title to avoid mixed communications with other games when using Nintendo Wi-Fi Connection. The <CODE>gamecode</CODE> value sets the range of friend relationships (namespace) in these communication groups.</p><p>In <CODE>gamecode</CODE>, 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.</p><p>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.<br>There is no problem allocating memory from either <CODE>MEM1</CODE> or <CODE>MEM2</CODE>. </p><p><CODE>DWC_Init</CODE> is a block function.</p> 76 77<H2>Revision History</H2> 78<DL> 79 80<DT><para>1.4.12</DT> 81<DD>Added a gamecode example.</DD> 82 83<DT><para>1.4.10</DT> 84<DD>Moved the process for creating DNS cache to <CODE>DWC_LoginAsync</CODE> so that now this function can be called without being connected to the network.</DD> 85 86<DT><para>1.4.1</DT> 87<DD>Added a description about network disconnection cases.</DD> 88 89<DT><para>1.4.0</DT> 90<DD>Added a section concerning the details of connecting to the network.</DD> 91 92<DT><para>1.3.2</DT> 93<DD>Changed operation so that the function returns -1 if it failed to create a DNS cache.</DD> 94 95<DT><para>1.1.2</DT> 96<DD>Made changes so that data storage server connection target can be changed.</DD> 97 98<DT><para>1.1.0</DT> 99<DD>Added a note that thread-exclusive control of the memory allocation and deallocation functions is required.</DD> 100 101<DT><para>1.0.0</DT> 102<DD>Added a description of changes to NWC24 specifications in which <CODE>gamecode</CODE> is now passed as an argument.</DD> 103 104<DT><para>0.0.8</DT> 105<DD>Changed specifications so that <CODE>gamename</CODE> is passed as an argument, and changed specifications so that an allocator is passed as an argument.</DD> 106 107</DL> 108<hr><p>CONFIDENTIAL</p></body> 109</html> 110