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_SetupGameServer</title>
9<LINK rel="stylesheet" href="../css/nitro.css" type="text/css">
10</head>
11
12<body>
13<a name="dwc__main_8h_1230f0bb02b234d806cc51470e67647f1"></a>
14<h1 align="left">DWC_SetupGameServer</h1>
15<h2>Syntax</h2>
16
17<dl>
18  <dd>
19<CODE>#include &lt;dwc.h&gt;</CODE><BR>
20  <BR>
21  <PRE><CODE>BOOL <a href=DWC_SetupGameServer.html#dwc__main_8h_1230f0bb02b234d806cc51470e67647f1>DWC_SetupGameServer</a>(<a href=Macro.html#dwc__match_8h_1c3ba6e33e5dd79e1d13350b71fa22250>DWCTopologyType</a> topology,
22                         u8 maxEntry,
23                         <a href=DWCMatchedSCCallback.html#dwc__match_8h_169fa2126df86bf98f54258f5ccab9beb>DWCMatchedSCCallback</a> matchedCallback,
24                         void *matchedParam,
25                         <a href=DWCNewClientCallback.html#dwc__match_8h_133da3ed06ce23a3dbab8f2e0b9aedc96>DWCNewClientCallback</a> newClientCallback,
26                         void *newClientParam,
27                         <a href=DWCConnectAttemptCallback.html#dwc__match_8h_11f5ec37975abd1264f03e7d9247c34bf>DWCConnectAttemptCallback</a> attemptCallback,
28                         u8 *connectionUserData,
29                         void *attemptParam);</CODE></PRE></dd>
30</dl>
31
32<h2>Arguments</h2>
33
34<TABLE border="1" width="100%">
35  <TBODY>
36
37    <TR>
38<TD width="13%"><EM><STRONG>topology</STRONG></EM></TD>
39<TD width="87%">The connection topology. Specified from inside <a href=Macro.html#dwc__match_8h_1c3ba6e33e5dd79e1d13350b71fa22250><CODE>DWCTopologyType</CODE></a>.</TD>
40    </TR>
41
42    <TR>
43<TD width="13%"><EM><STRONG>maxEntry</STRONG></EM></TD>
44<TD width="87%">The maximum number of connected players (oneself included). A value from 2 to 32 can be set in this argument.</TD>
45    </TR>
46
47    <TR>
48<TD width="13%"><EM><STRONG>matchedCallback</STRONG></EM></TD>
49<TD width="87%">Pointer to the connection completion callback function. This is called for each person who connects.</TD>
50    </TR>
51
52    <TR>
53<TD width="13%"><EM><STRONG>matchedParam</STRONG></EM></TD>
54<TD width="87%">Parameter for the connection completion callback.</TD>
55    </TR>
56
57    <TR>
58<TD width="13%"><EM><STRONG>newClientCallback</STRONG></EM></TD>
59<TD width="87%">Pointer to the new connection client notification callback function.</TD>
60    </TR>
61
62    <TR>
63<TD width="13%"><EM><STRONG>newClientParam</STRONG></EM></TD>
64<TD width="87%">Parameter for the new connection client notification callback.</TD>
65    </TR>
66
67    <TR>
68<TD width="13%"><EM><STRONG>attemptCallback</STRONG></EM></TD>
69<TD width="87%">Pointer to the connection acceptance callback function.</TD>
70    </TR>
71
72    <TR>
73<TD width="13%"><EM><STRONG>connectionUserData</STRONG></EM></TD>
74<TD width="87%">Pointer to the local host's own connection acceptance parameter buffer. This must be buffer of length <CODE>u8[<a href=Macro.html#dwc__match_8h_1767334491be60055db279f50c050c695>DWC_CONNECTION_USERDATA_LEN</a>]</CODE>. The buffer&rsquo;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.</TD>
75    </TR>
76
77    <TR>
78<TD width="13%"><EM><STRONG>attemptParam</STRONG></EM></TD>
79<TD width="87%">Parameter for the connection acceptance callback.</TD>
80    </TR>
81
82  </TBODY>
83</TABLE>
84
85<h2>Return Values</h2>
86
87<TABLE border="1" width="100%">
88  <TBODY>
89
90    <TR>
91<TD width="13%"><EM><STRONG>TRUE</STRONG></EM></TD>
92<TD width="87%">Processing completed.</TD>
93    </TR>
94
95    <TR>
96<TD width="13%"><EM><STRONG>FALSE</STRONG></EM></TD>
97<TD width="87%">Not a good state for calling this function.</TD>
98    </TR>
99
100  </TBODY>
101</TABLE>
102
103<H2>Description</H2>
104<p>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 <STRONG>Note</STRONG>) during server-client matchmaking.</p><p>This function starts server-client matchmaking. Connections are accepted from client hosts until either the <a href="DWC_CloseAllConnectionsHard.html"><CODE>DWC_CloseAllConnectionsHard</CODE></a> or <a href="DWC_ShutdownFriendsMatch.html"><CODE>DWC_ShutdownFriendsMatch</CODE></A> 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.</p><p>The client host uses the <A href="DWC_ConnectToGameServerAsync.html"><CODE>DWC_ConnectToGameServerAsync</CODE></a> function to connect to the server host.</p><p>Depending on the condition of the network connection, the process might be blocked and not return from the function for some time.</p><p><STRONG>Note:</STRONG> 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.</p>
105
106<H2>Revision History</H2>
107<DL>
108
109<DT><para>2.0.0</DT>
110<DD>Specification change.</DD>
111
112<DT><para>1.3.2</DT>
113<DD>Corrected a mistake &quot;DS wireless connection&quot; was changed to &quot;DS wireless communication.&quot;</DD>
114
115<DT><para>1.4.10</DT>
116<DD>Added a section concerning the details of connecting to the network.</DD>
117
118<DT><para>1.4.12</DT>
119<DD>Added a description of DS wireless communications.</DD>
120
121</DL>
122<hr><p>CONFIDENTIAL</p></body>
123</html>
124