DWC_CreateFriendKey

Syntax

#include <dwc.h>

u64 DWC_CreateFriendKey(const DWCUserData *userdata);

Arguments

userdata Pointer to the DWCUserData structure where the user data is stored.

Return Values

positive value Friend code.
0 Failed because the profile has not been obtained.

Description

Generates a friend code (from user data) to be exchanged with friends. Display the friend registration key acquired with this function as a 12-digit base 10 numeric value. In friend registration, create friend data from the friend registration key entered by the user using the DWC_CreateFriendKeyToken function, then add this created friend data to the friend roster.

Furthermore, assume that friend codes may sometimes be entered incorrectly. Therefore, create an interface that allows users to re-enter the friend code until the friend relationship is established.

If the Nintendo Wi-Fi Connection service has never been used, a friend code cannot be created. Thus, you should either set up an interface to create a code after making a connection or you should display a message with the appropriate instructions.

In RVLDWC1.4.15, changed the algorithm for generating friend codes. Note that there is no compatibility with friend codes generated using previous versions. To create friend codes that are compatible with previous versions, use the DWC_CreateFriendKeyLegacy function.

See Also

DWC_CreateFriendKeyLegacy DWC_CheckFriendKey

Revision History

1.4.15
Added a precaution to reflect modification of the creation algorithm.

CONFIDENTIAL