FRDU:IsValidFriendCode

From 3dbrew
Revision as of 18:18, 14 December 2024 by TimmSkiller (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Request

Index Word Description
0
Header 0x00260080 Cmd 0x0026 Param 2 Xlat 0
1-2 u64, Friend Code

Response

Index Word Description
0
Header 0x00260080 Cmd 0x0026 Param 2 Xlat 0
1 Result code
2 bool, IsValidFriendCode

Description

Returns whether or not the given friend code is valid. The following logic is used (everything is in little-endian byte order):

is_valid = friend_code != 0 &&

(u32)(friend_code >> 32) <= 127 &&

FRDU:PrincipalIdToFriendCode((u32)(friend_code & 0xFFFFFFFF)) == friend_code