DWC_CreateExchangeToken

Syntax

#include <dwc.h>

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

Arguments

userdata Pointer to the DWCUserData structure where the user data is stored.
token Pointer to the buffer storing the friend data.

Return Values

None.

Description

This function uses your own user data as specified in userdata to create the friend data that is used for exchanging. Send the token created with this function, and the host receiving this token will register it in their friend roster as friend data.

When registering friend data in the friend roster, first check all of the friend data on the roster using the DWC_IsEqualFriendData function to verify that the same data 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 data directly to the friend roster at that location.

When you want to delete friend data from the friend roster, call the DWC_DeleteBuddyFriendData function. When offline, friend data is simply cleared with zeroes. The next time the DWC_UpdateServersAsync 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.

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 DWC_CanChangeFriendList function to confirm that the roster can be edited.

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

See Also

DWC_CreateFriendKeyToken

Revision History

1.4.5
Created initial version.

CONFIDENTIAL