#include <dwc.h>
u64 DWC_CreateFriendKey(const DWCUserData *userdata);userdata |
Pointer to the DWCUserData structure where the user data is stored. |
| positive value | Friend registration key. |
| 0 | Failed because the profile is not obtained. |
Generates a friend registration key from user data so that the friend registration key can be passed to other hosts. Display the acquired friend registration key as a 12-digit base-10 numerical value.
In friend registration, first verify the validity of the user-entered friend registration key with the DWC_CheckFriendKey function, create the friend information using the DWC_CreateFriendKeyToken function, and add the created information to the friend roster.
Also consider the possibility that the user might make a mistake when entering the friend registration key, and prepare an interface that enables friend registration keys to be reentered up until the friend relationship is established.
When the Nintendo Wi-Fi Connection has never been used, a friend registration key cannot be created, so make some kind of interface to create one after making a connection, or display a message with those instructions.
Note: Starting with NITRO-DWC 3.0, the DWC_CreateFriendKey function employs a different method to generate the value used to check the validity of friend registration keys. Because of this change, the friend registration keys created with older versions of NITRO-DWC are no longer compatible. If for some special reason you need to handle these legacy friend registration keys, use the DWC_CreateFriendKeyLegacy and DWC_CheckFriendKeyLegacy functions.
DWC_CreateFriendKeyToken
DWC_CheckFriendKey
DWC_CreateFriendKeyLegacy
For the changelog prior to 5.1 PR2, click here.
CONFIDENTIAL