FRDU:IsValidFriendCode: Difference between revisions
Jump to navigation
Jump to search
Created page with "=Request= {| class="wikitable" border="1" |- ! Index Word ! Description |- | 0 | Header code [0x00260080] |- | 1-2 | (u64) friend code to validate |} The friend code can be..." |
TimmSkiller (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
=Request= | =Request= | ||
{ | {{IPC/Request}} | ||
| | {{IPC/RequestHeader|0x0026|2|0}} | ||
{{IPC/RequestEntryRange|2|u64, Friend Code}} | |||
{{IPC/RequestEnd}} | |||
| | |||
| 0 | |||
| | |||
| | |||
=Response= | |||
{{IPC/Request}} | |||
{{#vardefine:ipc_offset|0}} | |||
{{IPC/RequestHeader|0x0026|2|0}} | |||
{{IPC/RequestEntry|Result code}} | |||
{{IPC/RequestEntry|bool, IsValidFriendCode}} | |||
{{IPC/RequestEnd}} | |||
=Description= | |||
Returns whether or not the given friend code is valid. The following logic is used (everything is in little-endian byte order): | |||
<code> | |||
is_valid = friend_code != 0 && | |||
(u32)(friend_code >> 32) <= 127 && | |||
= | [[FRDU:PrincipalIdToFriendCode]]((u32)(friend_code & 0xFFFFFFFF)) == friend_code | ||
</code> | |||
Latest revision as of 19:18, 14 December 2024
Request
Index Word | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
0 |
| ||||||||
1-2 | u64, Friend Code |
Response
Index Word | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
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