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_InitFriendsMatch</title> 9<LINK rel="stylesheet" href="../css/nitro.css" type="text/css"> 10</head> 11 12<body> 13<a name="dwc__main_8h_186c2f56943c3a20c05d73d4a2abad609"></a> 14<h1 align="left">DWC_InitFriendsMatch</h1> 15<h2>Syntax</h2> 16 17<dl> 18 <dd> 19<CODE>#include <dwc.h></CODE><BR> 20 <BR> 21 <PRE><CODE>void <a href=DWC_InitFriendsMatch.html#dwc__main_8h_186c2f56943c3a20c05d73d4a2abad609>DWC_InitFriendsMatch</a>(DWCFriendsMatchControl *dwccnt, 22 DWCUserData *userdata, 23 int productID, 24 const char *gameName, 25 const char *secretKey, 26 int sendBufSize, 27 int recvBufSize, 28 DWCFriendData friendList[], 29 int friendListLen);</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>dwccnt</STRONG></EM></TD> 39<TD width="87%">Retained for compatibility with past versions. Specify NULL.</TD> 40 </TR> 41 42 <TR> 43<TD width="13%"><EM><STRONG>userdata</STRONG></EM></TD> 44<TD width="87%">Pointer to the <CODE>DWCUserData</CODE> type user data object.</TD> 45 </TR> 46 47 <TR> 48<TD width="13%"><EM><STRONG>productID</STRONG></EM></TD> 49<TD width="87%">The product ID assigned by GameSpy.</TD> 50 </TR> 51 52 <TR> 53<TD width="13%"><EM><STRONG>gameName</STRONG></EM></TD> 54<TD width="87%">The game name assigned by GameSpy (C language string).</TD> 55 </TR> 56 57 <TR> 58<TD width="13%"><EM><STRONG>secretKey</STRONG></EM></TD> 59<TD width="87%">The secret key assigned by GameSpy (C language string).</TD> 60 </TR> 61 62 <TR> 63<TD width="13%"><EM><STRONG>sendBufSize</STRONG></EM></TD> 64<TD width="87%">The size of the send buffer used in peer-to-peer communication. If the value is set to 0, 8 KB is used by default.</TD> 65 </TR> 66 67 <TR> 68<TD width="13%"><EM><STRONG>recvBufSize</STRONG></EM></TD> 69<TD width="87%">The size of the receive buffer used in peer-to-peer communication. If the value is set to 0, 8 KB is used by default.</TD> 70 </TR> 71 72 <TR> 73<TD width="13%"><EM><STRONG>friendList</STRONG></EM></TD> 74<TD width="87%">Pointer to a friend roster for which an array with the maximum number of elements was allocated (NULL if unused).</TD> 75 </TR> 76 77 <TR> 78<TD width="13%"><EM><STRONG>friendListLen</STRONG></EM></TD> 79<TD width="87%">The maximum number of elements in the friends list. Max value is 64.</TD> 80 </TR> 81 82 </TBODY> 83</TABLE> 84 85<h2>Return Values</h2> 86 87<p>None.</p> 88 89<H2>Description</H2> 90<p>Initializes the FriendsMatch library, a set of features used for matchmaking and friend managment.</p><p>Call this function before calling the <a href="DWC_LoginAsync.html"><CODE>DWC_LoginAsync</CODE></a> function.</p><p>Specify the pointer to the <CODE>DWCUserData</CODE> structure created with <a href="DWC_CreateUserData.html"><CODE>DWC_CreateUserData</CODE></a> in <code>userdata</code>. Maintain this buffer until <a href="DWC_ShutdownFriendsMatch.html"><CODE>DWC_ShutdownFriendsMatch</CODE></a> is called.</p><p><CODE>productID</CODE>, <CODE>gameName</CODE>, and <CODE>secretKey</CODE> are assigned to each game title. These communication groups are used to assign GameSpy servers and to configure the ranges for matchmaking and friend relationship creation. If you want to configure the ranges within the same game type or game title based on the market region (for example, so that Japanese and North American game versions cannot communicate), be sure to use a namespace that can be created using the <a href="DWC_CreateUserData.html"><CODE>DWC_CreateUserData</CODE></a> function.</p><p><CODE>sendBuffSize</CODE> and <CODE>recvBuffSize</CODE> specify the size of buffers to be used for Reliable send/receive between peers. The buffers are allocated by the DWC library after matchmaking is complete. (For information on Reliable send, see the function <A href="DWC_SendReliable.html"><CODE>DWC_SendReliable</CODE></a>.) A buffer of this specified size will then be allocated for each target peer through the memory allocation function passed by <A href="DWC_Init.html"><CODE>DWC_Init</CODE></a>. If a 0 is specified here, the default size of 8 kilobytes is allocated.</p><p>Unlike the buffer specified by the <A href="DWC_SetRecvBuffer.html"><CODE>DWC_SetRecvBuffer</CODE></a> function, the buffer whose size is specified here is used internally by the library.</p><p>When adjusting this buffer size, consider the size of the data exchanged between peers and the frequency of the data exchange and set it so that the buffer overflow would not occur. In addition, even if an application does not use Reliable communication, a minimum buffer region is required in order to perform Reliable communication when the library establishes peer-to-peer connections. For details, see the Nintendo Wi-Fi Connection Programming Manual for Wii.</p><p>When the send/receive buffer size is reduced, it is possible to make adjustments so that the buffer does not overflow by using the <CODE><A href="DWC_SetSendSplitMax.html">DWC_SetSendSplitMax</A></CODE> function to reduce the maximum size of the send data.</p><p>Specify the friend roster to be managed by the application using <CODE>friendList</CODE> and <CODE>friendListLen</CODE>. The application should save the friend roster along with save data. The friend roster automatically updates within the library. For details about operations performed on the friend roster, see the description of the <A href="DWC_CreateFriendKeyToken.html"><CODE>DWC_CreateFriendKeyToken</CODE></a> function. This function is used to create the friend data that will be stored in the friend roster. Furthermore, because the friend roster uses the passed buffer as-is without making a copy in the library, keep the entity in the application until the <a href="DWC_ShutdownFriendsMatch.html"><CODE>DWC_ShutdownFriendsMatch</CODE></a> function is called.</p> 91 92<H2>Revision History</H2> 93<DL> 94 95<DT><para>1.4.1</DT> 96<DD>Deleted the description about DWC_CreateExchangeToken.</DD> 97 98<DT><para>1.3.0</DT> 99<DD>Made it so that the first argument is ignored.</DD> 100 101<DT><para>1.1.2</DT> 102<DD>The <CODE>DWCFriendsMatchControl</CODE> definition has changed from a structure to a pointer variable. Corrected an error regarding <CODE>DWC_SetMemFunc()</CODE>.</DD> 103 104</DL> 105<hr><p>CONFIDENTIAL</p></body> 106</html> 107