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_CreateFriendKeyToken</title> 9<LINK rel="stylesheet" href="../css/nitro.css" type="text/css"> 10</head> 11 12<body> 13<a name="dwc__account_8h_1ee6428c09226af4095fa326f10097347"></a> 14<h1 align="left">DWC_CreateFriendKeyToken</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_CreateFriendKeyToken.html#dwc__account_8h_1ee6428c09226af4095fa326f10097347>DWC_CreateFriendKeyToken</a>(DWCFriendData *token, 22 u64 friend_key);</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>token</STRONG></EM></TD> 32<TD width="87%">Pointer to the buffer where the friend data to be added to the friend roster is stored.</TD> 33 </TR> 34 35 <TR> 36<TD width="13%"><EM><STRONG>friend_key</STRONG></EM></TD> 37<TD width="87%">Friend code.</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>Creates friend data from the friend code in order to add this friend data to the friend roster. Create friend registration keys to send to another user using the <A href="DWC_CreateFriendKey.html"><CODE>DWC_CreateFriendKey</CODE></a> function.</p><p>When using this function to create friend data, be absolutely sure to check the validity of the friend registration key in advance using the <A href="DWC_CheckFriendKey.html"><CODE>DWC_CheckFriendKey</CODE></a> function.</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_CreateExchangeToken.html">DWC_CreateExchangeToken<BR></A></CODE> 54 55<CODE><A href="DWC_CheckFriendKey.html">DWC_CheckFriendKey<BR></A></CODE> 56 57<CODE><A href="DWC_CreateFriendKey.html">DWC_CreateFriendKey<BR></A></CODE> 58 59<CODE><A href="DWC_IsEqualFriendData.html">DWC_IsEqualFriendData<BR></A></CODE> 60 61<CODE><A href="DWC_IsValidFriendData.html">DWC_IsValidFriendData<BR></A></CODE> 62 63<CODE><A href="DWC_DeleteBuddyFriendData.html">DWC_DeleteBuddyFriendData<BR></A></CODE> 64 65<CODE><A href="DWC_CanChangeFriendList.html">DWC_CanChangeFriendList<BR></A></CODE> 66 67<CODE><A href="DWC_UpdateServersAsync.html">DWC_UpdateServersAsync<BR></A></CODE> 68 69</p> 70 71<H2>Revision History</H2> 72<DL> 73 74<DT><para>1.4.5</DT> 75<DD>Added a note about checking the validity of friend registration keys.</DD> 76 77</DL> 78<hr><p>CONFIDENTIAL</p></body> 79</html> 80