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_CreateExchangeToken</title>
9<LINK rel="stylesheet" href="../css/nitro.css" type="text/css">
10</head>
11
12<body>
13<a name="dwc__account_8h_1c2e7cfd93ddb4b6625b962647a3a7878"></a>
14<h1 align="left">DWC_CreateExchangeToken</h1>
15<h2>Syntax</h2>
16
17<dl>
18  <dd>
19<CODE>#include &lt;dwc.h&gt;</CODE><BR>
20  <BR>
21  <PRE><CODE>void <a href=DWC_CreateExchangeToken.html#dwc__account_8h_1c2e7cfd93ddb4b6625b962647a3a7878>DWC_CreateExchangeToken</a>(const DWCUserData *userdata,
22                             DWCFriendData *token);</CODE></PRE></dd>
23</dl>
24
25<h2>Arguments</h2>
26
27<TABLE border="1" width="100%">
28  <TBODY>
29
30    <TR>
31<TD width="13%"><EM><STRONG>userdata</STRONG></EM></TD>
32<TD width="87%">Pointer to the <CODE>DWCUserData</CODE> structure where the user data is stored.</TD>
33    </TR>
34
35    <TR>
36<TD width="13%"><EM><STRONG>token</STRONG></EM></TD>
37<TD width="87%">Pointer to the buffer storing the friend data.</TD>
38    </TR>
39
40  </TBODY>
41</TABLE>
42
43<h2>Return Values</h2>
44
45<p>None.</p>
46
47<H2>Description</H2>
48<p>This function uses your own user data as specified in <CODE>userdata</CODE> to create the friend data that is used for exchanging. Send the <CODE>token</CODE> created with this function, and the host receiving this <CODE>token</CODE> will register it in their friend roster as friend data.</p><p>When registering friend data in the friend roster, first check all of the friend data on the roster using the <a href="DWC_IsEqualFriendData.html"><CODE>DWC_IsEqualFriendData</CODE></a> function to verify that the same data is not already registered. This will avoid duplicate data registration. Next, use <a href="DWC_IsValidFriendData.html"><CODE>DWC_IsValidFriendData</CODE></a> to search for a location in the roster that does not contain valid data. Copy the obtained friend data directly to the friend roster at that location.</p><p>When you want to delete friend data from the friend roster, call the <A href="DWC_DeleteBuddyFriendData.html"><CODE>DWC_DeleteBuddyFriendData</CODE></a> function. When offline, friend data is simply cleared with zeroes. The next time the <A href="DWC_UpdateServersAsync.html"><CODE>DWC_UpdateServersAsync</CODE></a> function is called, the friend relationship on the GameSpy server is also deleted. When online, friend data is cleared with zeroes and the friend relationship on the GameSpy server is deleted immediately.</p><p>The friend roster may sometimes change automatically while online, based on a request from a GameSpy server. For this reason, to edit the friend roster while online, first use the <A href="DWC_CanChangeFriendList.html"><CODE>DWC_CanChangeFriendList</CODE></a> function to confirm that the roster can be edited.</p><p>To establish a friend relationship by editing the friend roster while online, use the <A href="DWC_UpdateServersAsync.html"><CODE>DWC_UpdateServersAsync</CODE></a> function.</p>
49
50<h2>See Also</h2>
51<p>
52
53  <CODE><A href="DWC_CreateFriendKeyToken.html">DWC_CreateFriendKeyToken</A></CODE>
54
55</p>
56
57<H2>Revision History</H2>
58<DL>
59
60<DT><para>1.4.5</DT>
61<DD>Created initial version.</DD>
62
63</DL>
64<hr><p>CONFIDENTIAL</p></body>
65</html>
66