DWC_CreateFriendKeyToken

Syntax

#include <dwc.h>

void DWC_CreateFriendKeyToken(DWCFriendData *token,
                              u64 friend_key);

Arguments

token Pointer to the buffer where the friend data to be added to the friend roster is stored.
friend_key Friend code.

Return Values

None.

Description

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 DWC_CreateFriendKey function.

When using this function to create friend data, be absolutely sure to check the validity of the friend registration key in advance using the DWC_CheckFriendKey function.

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_CreateExchangeToken
DWC_CheckFriendKey
DWC_CreateFriendKey
DWC_IsEqualFriendData
DWC_IsValidFriendData
DWC_DeleteBuddyFriendData
DWC_CanChangeFriendList
DWC_UpdateServersAsync

Revision History

1.4.5
Added a note about checking the validity of friend registration keys.

CONFIDENTIAL