DWC_CreateExchangeToken

Syntax

#include <dwc.h>

void DWC_CreateExchangeToken( const DWCUserData* userdata, DWCFriendData* token );

Description

This function uses one's own user data as specified in userdata to create the friend information that is exchanged during DS Wireless Communication. The token created with this function is sent with DS Wireless Communication. The side which receives this token registers it in the friend roster as friend information.

Make sure that for the friend information exchanged between titles for which DWC_CreateUserData specifies different game codes, no friend relationship is established, even if the networking units are the same as those specified by the DWC_InitFriendsMatch function.
When using DS Wireless Networking to exchange friend information between titles for which different game codes have been specified (or if there is the possibility of such an exchange), it is recommended that you add to the friends roster after confirming on the application side that the game codes specified by the DWC_CreateUserData function are identical.

When registering friend information in the friend roster, first check all of the friend information on the roster using the DWC_IsEqualFriendData function to verify that the information is not already registered. This will avoid duplicate data registration. Next, use DWC_IsValidFriendData to search for a location in the roster that does not contain valid data. Copy the obtained friend information directly to the friend roster at that location.

When you want to delete friend information from the friend roster, call the DWC_DeleteBuddyFriendData function. When offline, friend information is cleared with zeroes. The next time the DWC_UpdateServersAsync function is called, the friend-related information on the GameSpy server is deleted. When online, friend information is cleared with zeroes and the friend-related information on the GameSpy server is deleted immediately.

The friend roster may sometimes change automatically while online, based on a request from a GameSpy server. To edit the friend roster while online, use the DWC_CanChangeFriendList function to check whether the list can be edited.

To establish a friend relationship by editing the friend roster while online, use the DWC_UpdateServersAsync function.

Arguments

userdata Pointer to the DWCUserData structure where user data is stored.
token Pointer to the buffer that stores the friend information to send over DS Wireless Communication.

Return Values

None.

See Also

DWC_CreateFriendKeyToken
DWC_IsEqualFriendData
DWC_IsValidFriendData
DWC_DeleteBuddyFriendData
DWC_CanChangeFriendList
DWC_UpdateServersAsync
DWC_CreateUserData
DWC_InitFriendsMatch

Revision History

2007/01/25 Added a caution about friend relationships not being established.
2005/12/16 Revisions.
2005/10/26 Revisions.
2005/10/20 Initial version.


CONFIDENTIAL