libctru v2.5.0
Loading...
Searching...
No Matches
act.h
Go to the documentation of this file.
1/**
2 * @file act.h
3 * @brief ACT (Account) Services
4 */
5#pragma once
6#include <3ds/services/frd.h>
7#include <3ds/types.h>
8#include <3ds/mii.h>
9
10#define ACCOUNT_ID_LEN 16+1 ///< 16-character NULL-terminated ASCII Account ID
11#define ACCOUNT_EMAIL_LEN 256+1 ///< 256-character NULL-terminated ASCII email address
12#define ACCOUNT_PASSWORD_LEN 17+1 ///< 17-character NULL-terminated ASCII password
13
14#define ACT_NNAS_SUBDOMAIN_LEN 32+1 ///< 32-character NULL-terminated ASCII NNAS (Nintendo Network Authentication Server) subdomain
15#define ACT_UUID_LEN 16 ///< RFC9562 Version 1 UUID
16
17#define ACT_DEFAULT_ACCOUNT 0xFE
18
19#define ACT_UUID_REGULAR -1 ///< The final UUID will not be based on any unique ID.
20#define ACT_UUID_CURRENT_PROCESS -2 ///< The final UUID will be based on the unique ID of the current process.
21
22#define ACT_TRANSFERABLE_ID_BASE_COMMON 0xFF ///< Use a common transferable ID base.
23#define ACT_TRANSFERABLE_ID_BASE_CURRENT_ACCOUNT 0xFE ///< Use the transferable ID base of the currently loaded account.
24
25typedef u8 ActUuid[ACT_UUID_LEN];
26
27typedef char ActNnasSubdomain[ACT_NNAS_SUBDOMAIN_LEN];
28
29typedef char AccountId[ACCOUNT_ID_LEN];
30typedef char AccountPassword[ACCOUNT_PASSWORD_LEN];
31typedef char AccountMailAddress[ACCOUNT_EMAIL_LEN];
32
33/// Enum for common / account specific info types
34typedef enum
35{
39 INFO_TYPE_COMMON_NETWORK_TIME_DIFF, ///< s64, difference between server time and device time in nanoseconds.
43 INFO_TYPE_MII, ///< CFLStoreData
44 INFO_TYPE_ACCOUNT_ID, ///< AccountId
45 INFO_TYPE_MAIL_ADDRESS, ///< AccountMailAddress
46 INFO_TYPE_BIRTH_DATE, ///< BirthDate structure
47 INFO_TYPE_COUNTRY_NAME, ///< char[2+1]
49 INFO_TYPE_STUB_0xD, /* not handled */
51 INFO_TYPE_STUB_0xF, /* not handled */
52 INFO_TYPE_STUB_0x10, /* not handled */
53 INFO_TYPE_ACCOUNT_INFO, ///< AccountInfo structure
54 INFO_TYPE_ACCOUNT_SERVER_TYPES, /// AccountServerTypes
55 INFO_TYPE_GENDER, ///< u8, F = 0, M = 1
60 INFO_TYPE_STUB_0x18, /* not handled */
63 INFO_TYPE_MII_NAME, ///< MiiScreenName
64 INFO_TYPE_NFS_PASSWORD, ///< char[0x10+1]
66 INFO_TYPE_TIMEZONE_ID, ///< char[0x40+1]
69 INFO_TYPE_ACCOUNT_ACCESS_TOKEN, ///< AccountAccessToken structure
73 INFO_TYPE_MII_IMAGE_URL, ///< char[0x100+1]
75 INFO_TYPE_ACCOUNT_ACCESS_TOKEN_STATE, ///< u32, AccountAccessTokenState enum
76 INFO_TYPE_ACCOUNT_SERVER_ENVIRONMENT, ///< AccountServerTypesStr structure
77 INFO_TYPE_COMMON_DEFAULT_ACCOUNT_SERVER_ENVIRONMENT, ///< AccountServerTypesStr structure
80 INFO_TYPE_AGE, ///< u16
85
86typedef enum
87{
88 REQUEST_INQUIRE_BINDING_TO_EXISTENT_SERVER_ACCOUNT = 1, ///< ExistentServerAccountData struct
89 REQUEST_BIND_TO_EXISTENT_SERVER_ACCOUNT, ///< u32, parentalConsentApprovalId
90 REQUEST_ACQUIRE_EULA, ///< EulaList structure (dynamically sized)
91 REQUEST_ACQUIRE_EULA_LIST = REQUEST_ACQUIRE_EULA, ///< EulaList structure (dynamically sized)
92 REQUEST_ACQUIRE_EULA_LANGUAGE_LIST = REQUEST_ACQUIRE_EULA, ///< EulaList structure with only the languageNameOffsets populated (dynamically sized)
93 REQUEST_ACQUIRE_TIMEZONE_LIST, ///< TimezoneList structure
94 REQUEST_ACQUIRE_ACCOUNT_INFO, ///< INFO_TYPE_MAIL_ADDRESS: AccountMailAddress
99 REQUEST_APPROVE_BY_CREDIT_CARD, ///< u32, approvalId
100 REQUEST_SEND_COPPA_CODE_MAIL, ///< CoppaCodeMailData structure
101 REQUEST_ACQUIRE_MII, ///< CFLStoreData[count]
102 REQUEST_ACQUIRE_ACCOUNT_INFO_RAW, ///< char[0xC00+1], NULL-terminate ASCII raw profile XML data
104
105/// Enum for Mii image type
106typedef enum
107{
108 MII_IMAGE_PRIMARY = 0, ///< The user's primary Mii image.
109 MII_IMAGE_1,
110 MII_IMAGE_2,
111 MII_IMAGE_3,
112 MII_IMAGE_4,
113 MII_IMAGE_5,
114 MII_IMAGE_6,
115 MII_IMAGE_7,
116 MII_IMAGE_8,
118
119/// Enum for NNAS (Nintendo Network Authentication Server) type
120typedef enum
121{
122 NNAS_PRODUCTION = 0,
123 NNAS_GAME_DEVELOPMENT,
124 NNAS_SYSTEM_DEVELOPMENT,
125 NNAS_LIBRARY_DEVELOPMENT,
126 NNAS_STAGING,
128
129/// Enum for account access token state
130typedef enum
131{
132 ACCESS_TOKEN_UNINITIALIZED = 0,
133 ACCESS_TOKEN_EXPIRED,
134 ACCESS_TOKEN_VALID,
136
137/// Enum for account access token invalidation action
138typedef enum
139{
140 INVALIDATE_ACCESS_TOKEN = BIT(0), ///< Invalidates only the account token itself (and the expiry date).
141 INVALIDATE_REFRESH_TOKEN = BIT(1), ///< Invalidates only the refresh token.
143
144/// Coppa Code Mail Data Structure
145typedef struct
146{
147 char coppaCode[5+1];
148 AccountMailAddress parentEmail;
150
151#pragma pack(push, 1)
152
153/// Mii CFLStoreData (CTR Face Library Store Data) structure
154typedef struct
155{
156 MiiData miiData;
157 u8 pad[2];
158 u16 crc16;
160
161/// Birth date structure
162typedef struct
163{
164 u16 year;
165 u8 month;
166 u8 day;
167} BirthDate;
168
169/// Account info structure
170typedef struct
171{
172 u32 persistentId;
173 u8 pad[4];
174 u64 transferableIdBase;
175 CFLStoreData mii;
176 MiiScreenName screenName;
177 char accountId[ACCOUNT_ID_LEN];
178 u8 pad2;
179 BirthDate birthDate;
180 u32 principalId;
182
183/// Account Timezone structure
184typedef struct
185{
186 char timezoneArea[0x40+1];
187 char pad[3];
188 char timezoneId[0x40+1];
189 char pad2[3];
190 s64 utcOffset;
192
193/// Timezone List structure
194typedef struct
195{
196 u32 capacity;
197 u32 count;
198 AccountTimezone timezones[32];
200
201/// EULA Info structure
202typedef struct
203{
204 char countryCode[2+1]; ///< ISO 3166-1 A-2 country code
205 char languageCode[2+1]; ///< ISO 639 Set 1 language code
206 u16 eulaVersion;
207} EulaInfo;
208
209/// Existent Server Account Data structure
210typedef struct
211{
212 bool hasMii;
213 u8 pad[3];
214 CFLStoreData miiData;
215 u32 principalId;
216 bool coppaRequiredFlag;
217 u8 pad2[3];
218 CoppaCodeMailData coppaMailData;
219 u8 pad3;
220 BirthDate birthDate;
222
223/// EULA entry header structure
224typedef struct
225{
226 char countryCode[2+1]; ///< ISO 3166-1 A-2 country code
227 u8 pad;
228 char languageCode[2+1]; ///< ISO 639 Set 1 language code
229 u8 pad2;
230 u16 eulaVersion;
231 u8 pad3[2];
232 u32 nextEntryOffset; ///< Offset of next EULA entry, relative to full data blob.
233 u32 eulaTypeOffset; ///< Offset of the EulaType within textData.
234 u32 agreeTextOffset; ///< Offset of the AgreeText within textData.
235 u32 nonAgreeTextOffset; ///< Offset of the NonAgreeText within textData.
236 u32 languageNameOffset; ///< Offset of the LanguageName within textData.
237 u32 mainTitleOffset; ///< Offset of the MainTitle within textData.
238 u32 mainTextOffset; ///< Offset of the MainText within textData.
239 u32 subTitleOffset; ///< Offset of the SubTitle within textData.
240 u32 subTextOffset; ///< Offset of the SubText within textData.
241 char textData[];
242} EulaEntry;
243
244/// Support Context structure
245typedef struct
246{
247 AccountId accountId; ///< Account ID of the account.
248 u8 pad[3];
249 u32 serialNumber; ///< Serial number of the console (only digits).
250 u32 principalId;
251 u16 randomNumber; ///< Random number based on the principalId and serialNumber.
252 u8 pad2[2];
254
255#pragma pack(pop)
256
257/// EULA list structure
258typedef struct
259{
260 u8 numEntries; ///< Number of entries within the list.
261 u8 entries[]; ///< EULA Entries (dynamically sized)
262} EulaList;
263
264/// Device Info structure
265typedef struct
266{
267 u32 deviceId;
268 char serialNumber[0xF+1];
269} DeviceInfo;
270
271/// NEX service token structure
272typedef struct
273{
274 char serviceToken[0x200+1];
275 u8 pad[3];
276 char password[0x40+1];
277 u8 pad2[3];
278 char serverHost[0x10];
279 u16 serverPort;
280 u8 pad3[2];
282
283/// Credit Card Info structure
284typedef struct
285{
286 u8 cardType;
287 char cardNumber[0x10+1];
288 char securityCode[3+1];
289 u8 expirationMonth;
290 u8 expirationYear;
291 char postalCode[6+1];
292 AccountMailAddress mailAddress;
294
295/// V1 Independent service token structure
296typedef struct
297{
298 char token[0x200+1]; ///< base64
300
301/// V2 Independent service token structure
302typedef struct
303{
304 char token[0x200+1]; ///< base64
305 char iv[0x18+1]; ///< base64
306 char signature[0x158+1]; ///< base64
307 NfsTypeStr nfsTypeStr;
309
310/// Account server types structure (raw format)
311typedef struct
312{
313 u8 nnasType; ///< NNAS (Nintendo Network Authentication Server) type
314 u8 nfsType; ///< NFS (Nintendo Friend Server) type
315 u8 nfsNo; ///< NFS (Nintendo Friend Server) number
316 u8 pad;
318
319/// Account server types structure (string format)
320typedef struct
321{
322 ActNnasSubdomain nnasSubdomain; ///< NNAS (Nintendo Network Authentication Server) subdomain
323 NfsTypeStr nfsTypeStr; ///< NFS (Nintendo Friend Server) type string (letter + number)
325
326/// Account access token structure
327typedef struct
328{
329 u8 state; ///< AccountAccessTokenState enum
330 char accessToken[0x20+1];
331 char refreshToken[0x28+1];
332 u8 pad;
334
335/**
336 * @brief Initializes ACT services.
337 * @param forceUser Whether or not to force using the user service act:u instead of the default (admin service act:a).
338 */
339Result actInit(bool forceUser);
340
341/// Exits ACT services.
342void actExit(void);
343
344/// Get the ACT user/admin service handle.
346
347/**
348 * @brief Initializes the current ACT session.
349 * @param sdkVersion The SDK version of the client process.
350 * @param sharedMemSize The size of the shared memory block.
351 * @param sharedMem Handle to the shared memory block.
352 */
353Result ACT_Initialize(u32 sdkVersion, u32 sharedMemSize, Handle sharedMem);
354
355/**
356 * @brief Returns a support error code (XXX-YYYY) for the given ACT result code.
357 * @param code The result code to convert.
358 */
360
361/**
362 * @brief Gets the result of the last internal operation.
363 */
365
366/**
367 * @brief Cancels any currently running async operation.
368 */
370
371/**
372 * @brief Retrieves information not specific to any one account.
373 * @param output Pointer to buffer to output the data to.
374 * @param outputSize Size of the output buffer.
375 * @param infoType The type of data to retrieve.
376 */
377Result ACT_GetCommonInfo(void *output, u32 outputSize, u32 infoType);
378
379/**
380 * @brief Retrieves information of a certain account.
381 * @param output Pointer to buffer to output the data to.
382 * @param outputSize Size of the output buffer.
383 * @param accountSlot The account slot number of the account to retrieve information for.
384 * @param infoType The type of data to retrieve.
385 */
386Result ACT_GetAccountInfo(void *output, u32 outputSize, u8 accountSlot, u32 infoType);
387
388/**
389 * @brief Returns the data resulting from an async request.
390 * @param outReadSize Pointer to output the number of retrieved bytes to.
391 * @param output Pointer to buffer to output the data to.
392 * @param outputSize Size of the output buffer.
393 * @param requestType The type of async request to retrieve data for.
394 */
395Result ACT_GetAsyncResult(u32 *outReadSize, void *output, u32 outputSize, u32 requestType);
396
397/**
398 * @brief Gets one of the Mii images of a certain account.
399 * @param outSize Pointer to output the raw size of the image to.
400 * @param output Pointer to output the image data to.
401 * @param outputSize Size of the output buffer.
402 * @param accountSlot The account slot number of the account to get the Mii image for.
403 * @param miiImageType The type of the Mii image to get.
404 */
405Result ACT_GetMiiImage(u32 *outSize, void *output, u32 outputSize, u8 accountSlot, u8 miiImageType);
406
407/**
408 * @brief Sets the NFS (Nintendo Friend Server) password for a certain account.
409 * @param accountSlot The account slot number of the account to set the NfsPassword for.
410 * @param password Pointer to the new NFS password to use.
411 */
412Result ACT_SetNfsPassword(u8 accountSlot, char *password);
413
414/**
415 * @brief Sets the `IsApplicationUpdateRequired` field in the internal account manager.
416 * @param required The new value to use.
417 */
419
420/**
421 * @brief Acquires a list of EULA agreements for the specified country.
422 * @param countryCode The country code of the country to acquire EULA agreements for.
423 * @param completionEvent The event handle to signal when the request has finished.
424 */
425Result ACT_AcquireEulaList(u8 countryCode, Handle completionEvent);
426
427/**
428 * @brief Acquires a list of timezones for the specified country and language combination.
429 * @param countryCode The country code of the country to acquire time zones for.
430 * @param language code The language code of the language to acquire the time zones in.
431 * @param completionEvent The event handle to signal when the request has finished.
432 */
433Result ACT_AcquireTimezoneList(u8 countryCode, u8 languageCode, Handle completionEvent);
434
435/**
436 * @brief Generates a UUID.
437 * @param uuid Pointer to output the generated UUID to.
438 * @param uniqueId The unique ID to use during generation. Special values include `ACT_UUID_REGULAR` and `ACT_UUID_CURRENT_PROCESS`.
439 */
440Result ACT_GenerateUuid(ActUuid *uuid, u32 uniqueId);
441
442/**
443 * @brief Gets a specific account's UUID.
444 * @param uuid Pointer to output the UUID to.
445 * @param uniqueId The unique ID to use during the retrieval of the UUID. Special values include `ACT_UUID_REGULAR` and `ACT_UUID_CURRENT_PROCESS`.
446 */
447Result ACT_GetUuid(ActUuid *uuid, u8 accountSlot, u32 uniqueId);
448
449/**
450 * @brief Finds the account slot number of the account having the specified UUID.
451 * @param accountSlot Pointer to output the account slot number to.
452 * @param uuid Pointer to the UUID to find the account slot number for.
453 * @param uniqueId The unique ID to use during internal UUID generation. Special values include `ACT_UUID_REGULAR` and `ACT_UUID_CURRENT_PROCESS`.
454 */
455Result ACT_FindSlotNoByUuid(u8 *accountSlot, ActUuid *uuid, u32 uniqueId);
456
457/**
458 * @brief Saves all pending changes to the ACT system save data.
459 */
461
462/**
463 * @brief Returns a TransferableID for a certain account.
464 * @param transferableId Pointer to output the generated TransferableID to.
465 * @param accountSlot The account slot number of the account to generate the TransferableID for. Special values include `ACT_TRANSFERABLE_ID_BASE_COMMON` and `ACT_TRANSFERABLE_ID_BASE_CURRENT_ACCOUNT`.
466 * @param saltValue The value to use as a salt during generation.
467 */
468Result ACT_GetTransferableId(u64 *transferableId, u8 accountSlot, u8 saltValue);
469
470/**
471 * @brief Acquires an account-specific service token for a NEX server.
472 * @param accountSlot The account slot number of the account to use for acquiring the token.
473 * @param serverId The NEX server ID to request a service token for.
474 * @param doParentalControlsCheck Whether or not to perform a parental controls check before requesting the token. (unused)
475 * @param callerProcessId The process ID of the process requesting the token.
476 * @param completionEvent The event handle to signal once the request has finished.
477 */
478Result ACT_AcquireNexServiceToken(u8 accountSlot, u32 serverId, bool doParentralControlsCheck, u32 callerProcessId, Handle completionEvent);
479
480/**
481 * @brief Gets a NEX service token requested using ACT_AcquireNexServiceToken.
482 * @param token Pointer to output the NEX service token data to.
483 */
485
486/**
487 * @brief Requests a V1 independent service token for a specific account.
488 * @param accountSlot The account slot number of the account to request the token with.
489 * @param clientId The client ID to use for requesting the independent service token.
490 * @param cacheDuration The duration in seconds to cache the token. If a token was requested within the past cacheDuration seconds, this command returns that token instead of requesting a new one. Passing 0 will cause ACT to always request a new token.
491 * @param doParentalControlsCheck Whether or not to perform a parental controls check before requesting the token. (unused)
492 * @param shared Whether or not this token should be shared with other processes. If set to false, it will only be accessible to the process with the given process ID.
493 * @param callerProcessId The process ID of the process requesting the token.
494 * @param completionEvent The event handle to signal once the request has finished.
495 */
496Result ACT_AcquireIndependentServiceToken(u8 accountSlot, char *clientId, u32 cacheDuration, bool doParentalControlsCheck, bool shared, u32 callerProcessId, Handle completionEvent);
497
498/**
499 * @brief Gets a V1 independent service token requested using ACT_AcquireIndependentServiceToken.
500 * @param token Pointer to output the V1 independent service token to.
501 */
503
504/**
505 * @brief Acquires account information for the specified account.
506 * @param accountSlot The account slot number to acquire information for.
507 * @param infoType The type of info to obtain. (only INFO_TYPE_MAIL_ADDRESS is supported.)
508 * @param completionEvent The event handle to signal once the request has finished.
509 */
510Result ACT_AcquireAccountInfo(u8 accountSlot, u32 infoType, Handle completionEvent);
511
512/**
513 * @brief Acquires account IDs from a list of principal IDs.
514 * @param principalIds Pointer to the input principal IDs.
515 * @param principalIdsSize Size of the input principal IDs buffer.
516 * @param unk Unknown value. Must be 0.
517 * @param completionEvent The event handle to signal once the request has finished.
518 */
519Result ACT_AcquireAccountIdByPrincipalId(u32 *principalIds, u32 principalIdsSize, u8 unk, Handle completionEvent);
520
521/**
522 * @brief Acquires principal IDs from a list of account IDs.
523 * @param accountIds Pointer to input account IDs.
524 * @param accountIdsSize Size of the input account IDs buffer.
525 * @param completionEvent The event handle to signal once the request has finished.
526 */
527Result ACT_AcquirePrincipalIdByAccountId(AccountId *accountIds, u32 accountIdsSize, Handle completionHandle);
528
529/**
530 * @brief Acquires Miis corresponding to a given list of persistent IDs.
531 * @param persistentIds Pointer to input persistent IDs to use.
532 * @param persistentIdsSize Size of the input persistent IDs buffer.
533 * @param completionEvent The event handle to signal once the request has finished.
534 */
535Result ACT_AcquireMii(u32 *persistentIds, u32 persistentIdsSize, Handle completionEvent);
536
537/**
538 * @brief Acquires raw (XML) account info for the specified account.
539 * @param accountSlot The account slot number of the account to acquire raw info for.
540 */
541Result ACT_AcquireAccountInfoRaw(u8 accountSlot, Handle completionEvent);
542
543/**
544 * @brief Gets a cached V1 independent service token for a specific account.
545 * @param accountSlot The account slot number of the account to get the token for.
546 * @param clientId The client ID to use for the cache lookup.
547 * @param cacheDuration The duration in seconds ago this token must have been requested in at least for it to be eligible for retrieval.
548 * @param doParentalControlsCheck Whether or not to perform a parental controls check before getting the token. (unused)
549 * @param shared Whether or not to only look for shared (non-process-specific) tokens in the cache.
550 */
551Result ACT_GetCachedIndependentServiceToken(IndependentServiceTokenV1 *token, u8 accountSlot, char *clientId, u32 cacheDuration, bool doParentralControlsCheck, bool shared);
552
553/**
554 * @brief Inquires whether or not the given email address is available for creating a new account.
555 * @param mailAddress Pointer to the input email address to check.
556 * @param completionEvent The event handle to signal once the request has finished.
557 */
558Result ACT_InquireMailAddressAvailability(AccountMailAddress *mailAddress, Handle completionEvent);
559
560/**
561 * @brief Acquires the EULA for the given country and language combination.
562 * @param countryCode The country code of the country for the EULA.
563 * @param languageCode The 2-character ISO 639 Set 1 language code for the EULA.
564 * @param completionEvent The event handle to signal once the request has finished.
565 */
566Result ACT_AcquireEula(u8 countryCode, char *languageCode, Handle completionEvent);
567
568/**
569 * @brief Acquires a list of languages the EULA is available in for a given country.
570 * @param countryCode The country code to acquire the EULA language list for.
571 * @param completionEvent The event handle to signal once the request has finished.
572 */
573Result ACT_AcquireEulaLanguageList(u8 countryCode, Handle completionEvent);
574
575/**
576 * @brief Requests a V2 independent service token for a specific account.
577 * @param accountSlot The account slot number of the account to request the token with.
578 * @param clientId The client ID to use for requesting the independent service token.
579 * @param cacheDuration The duration in seconds to cache the token. If a token was requested within the past cacheDuration seconds, this command returns that token instead of requesting a new one. Passing 0 will cause ACT to always request a new token.
580 * @param doParentalControlsCheck Whether or not to perform a parental controls check before requesting the token. (unused)
581 * @param shared Whether or not this token should be shared with other processes. If set to false, it will only be accessible to the process with the given process ID.
582 * @param callerProcessId The process ID of the process requesting the token.
583 * @param completionEvent The event handle to signal once the request has finished.
584 */
585Result ACT_AcquireIndependentServiceTokenV2(u8 accountSlot, char *clientId, u32 cacheDuration, bool doParentalControlsCheck, bool shared, u32 callerProcessId, Handle completionEvent);
586
587/**
588 * @brief Gets a V2 independent service token requested using ACT_AcquireIndependentServiceTokenV2.
589 * @param token Pointer to output the V2 independent service token to.
590 */
592
593/**
594 * @brief Gets a cached V2 independent service token for a specific account.
595 * @param accountSlot The account slot number of the account to get the token for.
596 * @param clientId The client ID to use for the cache lookup.
597 * @param cacheDuration The duration in seconds ago this token must have been requested in at least for it to be eligible for retrieval.
598 * @param doParentalControlsCheck Whether or not to perform a parental controls check before getting the token. (unused)
599 * @param shared Whether or not to only look for shared (non-process-specific) tokens in the cache.
600 */
601Result ACT_GetCachedIndependentServiceTokenV2(IndependentServiceTokenV2 *token, u8 accountSlot, char *clientId, u32 cacheDuration, bool doParentralControlsCheck, bool shared);
602
603/**
604 * @brief Swaps the account slot numbers of two accounts.
605 * @param accountSlot1 The first account slot number.
606 * @param accountSlot2 The second account slot number.
607 */
608Result ACTA_SwapAccounts(u8 accountSlot1, u8 accountSlot2);
609
610/**
611 * @brief Creates a new local console account.
612 */
614
615/**
616 * @brief Sets a local console account as committed.
617 * @param accountSlot The account slot number of the account to set as committed.
618 */
620
621/**
622 * @brief Clears (but does not delete) account data for the given account slot. The FpLocalAccountId will not be cleared.
623 * @param accountSlot The account slot number of the account to clear.
624 * @param completely Whether or not to also clear the AssignedAccountId and AssignedPrincipalId in the account data.
625 */
626Result ACTA_UnbindServerAccount(u8 accountSlot, bool completely);
627
628/**
629 * @brief Deletes a local console account.
630 * @param accountSlot The account slot number of the local console account to delete.
631 */
633
634/**
635 * @brief Loads ("logs in to") a local console account.
636 * @param accountSlot The account slot number of the local console account to load.
637 * @param doPasswordCheck Whether or not the check the input password, or if one isn't provided, the cached password (if enabled).
638 * @param password Pointer to the input password.
639 * @param useNullPassword Whether or not to forcefully use NULL as the password (= no password).
640 * @param dryRun Whether or not to execute this command as a "dry run," not actually changing the current account to specified one.
641 */
642Result ACTA_LoadConsoleAccount(u8 accountSlot, bool doPasswordCheck, AccountPassword *password, bool useNullPassword, bool dryRun);
643
644/**
645 * @brief Unloads the currently loaded local console account.
646 */
648
649/**
650 * @brief Enables or disables the account password cache for a specific account. When the account password cache is enabled, entering the password is not required to log into the account.
651 * @param accountSlot The account slot number to enable/disable the account password cache for.
652 * @param enabled Whether or not to enable the account password cache.
653 */
654Result ACTA_EnableAccountPasswordCache(u8 accountSlot, bool enabled);
655
656/**
657 * @brief Sets the default account that is loaded when the ACT module is initialized.
658 * @param accountSlot The account slot number of the account to set as the default.
659 */
661
662/**
663 * @brief Replaces the AccountId with the AssignedAccountId for a specific account.
664 * @param accountSlot The account slot number of the account to perform this replacement for.
665 */
667
668/**
669 * @brief Creates a support context for a specific account.
670 * @param supportContext Pointer to write the support context data to.
671 * @param accountSlot The account slot number of the account to create the support context for.
672 */
673Result ACTA_GetSupportContext(SupportContext *supportContext, u8 accountSlot);
674
675/**
676 * @brief Sets server environment settings for a specific account. This will also update CFG configuration block 0x150002 accordingly.
677 * @param accountSlot The account slot number of the account to set the host server settings for.
678 * @param nnasType The NNAS (Nintendo Network Authentication Server) type.
679 * @param nfsType The NFS (Nintendo Friend Server) type.
680 * @param nfsNo The NFS (Nintendo Friend Server) number.
681 */
682Result ACTA_SetHostServerSettings(u8 accountSlot, u8 nnasType, u8 nfsType, u8 nfsNo);
683
684/**
685 * @brief Sets default server environment settings. This will also update CFG configuration block 0x150002 accordingly.
686 * @param nnasType The NNAS (Nintendo Network Authentication Server) type.
687 * @param nfsType The NFS (Nintendo Friend Server) type.
688 * @param nfsNo The NFS (Nintendo Friend Server) number.
689 */
691
692/**
693 * @brief Sets server environment settings (in string form) for a specific account. This will also update CFG configuration block 0x150002 accordingly.
694 * @param accountSlot The account slot number of the account to set the host server settings for.
695 * @param nnasSubdomain Pointer to the new NNAS (Nintendo Network Authentication Server) subdomain to use.
696 * @param nfsTypeStr Pointer to the new NFS (Nintendo Friend Server) type to use.
697 */
698Result ACTA_SetHostServerSettingsStr(u8 accountSlot, ActNnasSubdomain *nnasSubdomain, NfsTypeStr *nfsTypeStr);
699
700/**
701 * @brief Sets default server environment settings (in string form). This will also update CFG configuration block 0x150002 accordingly.
702 * @param nnasSubdomain Pointer to the new NNAS (Nintendo Network Authentication Server) subdomain to use.
703 * @param nfsTypeStr Pointer to the new NFS (Nintendo Friend Server) type to use.
704 */
705Result ACTA_SetDefaultHostServerSettingsStr(ActNnasSubdomain *nnasSubdomain, NfsTypeStr *nfsTypeStr);
706
707/**
708 * @brief Sets the internal base value for generating new persistent IDs.
709 * @param head The new base value to use.
710 */
712
713/**
714 * @brief Sets the internal base value for generating new transferable IDs.
715 * @param counter The new base value to use.
716 */
718
719/**
720 * @brief Updates a specific account's Mii data and screen name.
721 * @param accountSlot The account slot number of the account to update the Mii and screen name of.
722 * @param miiData Pointer to the new Mii data to use.
723 * @param screenName Pointer to the new screen name to use.
724 */
725Result ACTA_UpdateMiiData(u8 accountSlot, CFLStoreData *miiData, MiiScreenName *screenName);
726
727/**
728 * @brief Updates a Mii image of a specific account.
729 * @param accountSlot The account slot number of the account to update the Mii image for.
730 * @param miiImageType The type of Mii image to update.
731 * @param image Pointer to the Mii image data to use.
732 * @param imageSize Size of the Mii image data.
733 */
734Result ACTA_UpdateMiiImage(u8 accountSlot, u8 miiImageType, void *image, u32 imageSize);
735
736/**
737 * @brief Checks whether or not the given account ID is available for creating a new server account.
738 * @param accountSlot The account slot number of the account to perform the check for.
739 * @param accountId Pointer to the input account ID to check.
740 * @param completionEvent The event handle to signal once the request has finished.
741 */
742Result ACTA_InquireAccountIdAvailability(u8 accountSlot, AccountId *accountId, Handle completionEvent);
743
744/**
745 * @brief Links a new server account to a local console account. In other words, this creates and links an NNID.
746 * @param accountSlot The account slot number of the local console account to bind.
747 * @param accountId Pointer to the account ID to use for the new server account.
748 * @param mailAddress Pointer to the email address to use for the new server account.
749 * @param password Pointer to the password to use for the new server account.
750 * @param isParentEmail Whether or not the input email address is a parental email address.
751 * @param marketingFlag Whether or not the user has consented to receiving marketing emails. ("Customized Email Offers")
752 * @param offDeviceFlag Whether or not the user has allowed using the server account from other devices. ("Access from PCs and Other Devices")
753 * @param birthDateTimestamp A birth date timestamp in the format milliseconds elapsed since 01.01.2000 00:00:00 UTC.
754 * @param parentalConsentTimestamp When parental consent is required, the timestamp of parental consent in the format milliseconds elapsed since 01.01.2000 00:00:00 UTC.
755 * @param parentalConsentId When parental consent is required, the resulting ID corresponding to the consent.
756 * @param completionEvent The event handle to signal once the request has finished.
757 */
758Result ACTA_BindToNewServerAccount(u8 accountSlot, AccountId *accountId, AccountMailAddress *mailAddress, AccountPassword *password, bool isParentEmail, bool marketingFlag, bool offDeviceFlag, s64 birthDateTimestatmp, u8 gender, u32 region, AccountTimezone *timezone, EulaInfo *eulaInfo, s64 parentalConsentTimestamp, u32 parentalConsentId, Handle completionEvent);
759
760/**
761 * @brief Links a local console account to an existing server account. In other words, this links an existing NNID.
762 * @param accountSlot The account slot number of the local console account to bind.
763 * @param accountId Pointer to the account ID of the existing server account.
764 * @param mailAddress Pointer to the email address of the existing server account.
765 * @param password Pointer to the password of the existing server account.
766 * @param completionEvent The event handle to signal once the request has finished.
767 */
768Result ACTA_BindToExistentServerAccount(u8 accountSlot, AccountId *accountId, AccountMailAddress *mailAddress, AccountPassword *password, Handle completionEvent);
769
770/**
771 * @brief Acquires information about an existing server account.
772 * @param accountSlot The account slot number of the local console account to use for the request.
773 * @param accountId Pointer to the account ID of the existing server account.
774 * @param mailAddress Pointer to the email address of the existing server account.
775 * @param password Pointer to the password of the existing server account.
776 * @param completionEvent The event handle to signal once the request has finished.
777 */
778Result ACTA_InquireBindingToExistentServerAccount(u8 accountSlot, AccountId *accountId, AccountMailAddress *mailAddress, AccountPassword *password, Handle completionEvent);
779
780/**
781 * @brief Deletes a server account. In other words, this deletes an NNID (server-side).
782 * @param accountSlot The account slot number of the local console account bound to the server account to delete.
783 * @param completionEvent The event handle to signal once the request has finished.
784 */
785Result ACTA_DeleteServerAccount(u8 accountSlot, Handle completionEvent);
786
787/**
788 * @brief Acquires an account token for a specific account.
789 * @param accountSlot The account slot number of the account to acquire the account token for.
790 * @param password Pointer to the password of the account.
791 * @param useNullPassword Whether or not to force NULL as the password (no password). This will cause the account password cache to be used instead, if it is enabled.
792 * @param completionEvent The event handle to signal once the request has finished.
793 */
794Result ACTA_AcquireAccountTokenEx(u8 accountSlot, AccountPassword *password, bool useNullPassword, Handle completionEvent);
795
796/**
797 * @brief Submits a EULA agreement to the account server.
798 * @param accountSlot The account slot number of the account to use to submit the agreement.
799 * @param eulaInfo Pointer to a EULA information structure describing the agreed EULA.
800 * @param agreementTimestamp A timestamp in the format milliseconds elapsed since 01.01.2000 00:00:00 UTC of when the user agreed to the EULA.
801 * @param completionEvent The event handle to signal once the request has finished.
802 */
803Result ACTA_AgreeEula(u8 accountSlot, EulaInfo *eulaInfo, s64 agreementTimestamp, Handle completionEvent);
804
805/**
806 * @brief Reloads account information from the server for a specific account.
807 * @param accountSlot The account slot number of the account to reload information for.
808 * @param completionEvent The event handle to signal once the request has finished.
809 */
810Result ACTA_SyncAccountInfo(u8 accountSlot, Handle completionEvent);
811
812/**
813 * @brief Invalidates a specific account's access token in different ways.
814 * @param accountSlot The account slot number of the account to invalidate the access token for.
815 * @param invalidationMask A bitfield of the actions to take to invalidate the access token.
816 */
817Result ACTA_InvalidateAccountToken(u8 accountSlot, u32 invalidationActionMask);
818
819/**
820 * @brief Updates the account password for a specific account.
821 * @param accountSlot The account slot number of the account to update the password for.
822 * @param password Pointer to the new password to use.
823 * @param completionEvent The event handle to signal once the request has finished.
824 */
825Result ACTA_UpdateAccountPassword(u8 accountSlot, AccountPassword *newPassword, Handle completionEvent);
826
827/**
828 * @brief Requests the issuing of a temporary password (valid for 24 hours) to the email address associated with a specific account.
829 * @param accountSlot The account slot number of the account to issue the temporary password for.
830 * @param completionEvent The event handle to signal once the request has finished.
831 */
832Result ACTA_ReissueAccountPassword(u8 accountSlot, Handle completionEvent);
833
834/**
835 * @brief Sets the account password input for a specific account. This value is not stored in the save data and only resides in memory. Following up a call to this command with a call to ACTA_EnableAccountPasswordCache will lead to the account password cache being updated.
836 */
837Result ACTA_SetAccountPasswordInput(u8 accountSlot, AccountPassword *passwordInput);
838
839/**
840 * @brief Uploads the Mii data of a specific account to the account server.
841 * @param accountSlot The account slot number of the account to upload the Mii for.
842 * @param completionEvent The event handle to signal once the request has finished.
843 */
844Result ACTA_UploadMii(u8 accountSlot, Handle completionEvent);
845
846/**
847 * @brief Inactivates the device association for a specific account.
848 * @param accountSlot The account slot number of the account to inactive the device association for.
849 * @param completionEvent The event handle to signal once the request has finished.
850 */
851Result ACTA_InactivateDeviceAssociation(u8 accountSlot, Handle completionEvent);
852
853/**
854 * @brief Validates the email address of a specific account using the code received via the confirmation email.
855 * @param accountSlot The account slot number of the account to validate the email address for.
856 * @param confirmationCode The confirmation code received via email.
857 * @param completionEvent The event handle to signal once the request has finished.
858 */
859Result ACTA_ValidateMailAddress(u8 accountSlot, u32 confirmationCode, Handle completionEvent);
860
861/**
862 * @brief Requests parental approval for a specific account.
863 * @param accountSlot The account slot number of the account to request parental approval for.
864 * @param parentalEmail Pointer to a parental email to use for parental consent.
865 * @param completionEvent The event handle to signal once the request has finished.
866 */
867Result ACTA_SendPostingApprovalMail(u8 accountSlot, AccountMailAddress *parentalEmail, Handle completionEvent);
868
869/**
870 * @brief Requests the email address confirmation mail to be resent for a specific account.
871 * @param accountSlot The account slot number of the account for which the confirmation mail should be resent.
872 * @param completionEvent The event handle to signal once the request has finished.
873 */
874Result ACTA_SendConfirmationMail(u8 accountSlot, Handle completionEvent);
875
876/**
877 * @brief Registers a parental email address to be used in case the parental controls PIN has been forgotten for a specific account.
878 * @param accountSlot The account slot number of the account to register the fallback parental email for.
879 * @param parentalEmail Pointer to the parental email to use.
880 * @param completionEvent The event handle to signal once the request has finished.
881 */
882Result ACTA_SendConfirmationMailForPin(u8 accountSlot, AccountMailAddress *parentalEmail, Handle completionEvent);
883
884/**
885 * @brief Sends the master key for resetting parental controls to a parental email for a specific account.
886 * @param accountSlot The account slot number for the account to be used for this operation.
887 * @param masterKey The master key to send to the parental email address.
888 * @param parentalEmail Pointer to the parental email address to send the master key to.
889 * @param completionEvent The event handle to signal once the request has finished.
890 */
891Result ACTA_SendMasterKeyMailForPin(u8 accountSlot, u32 masterKey, AccountMailAddress *parentalEmail, Handle completionEvent);
892
893/**
894 * @brief Requests COPPA parental consent using credit card information.
895 * @param accountSlot The account slot number for the account to request approval for.
896 * @param cardInfo Pointer to the credit card information to use for the approval process.
897 * @param completionEvent The event handle to signal once the request has finished.
898 */
899Result ACTA_ApproveByCreditCard(u8 accountSlot, CreditCardInfo *cardInfo, Handle completionEvent);
900
901/**
902 * @brief Requests a COPPA code for a specific account.
903 * @param accountSlot The account slot number for the account to send the request for.
904 * @param principalId The principalId of the account to send the request for.
905 * @param completionEvent The event handle to signal once the request has finished.
906 */
907Result ACTA_SendCoppaCodeMail(u8 accountSlot, u32 principalId, Handle completionEvent);
908
909/**
910 * @brief Set a flag in a specifc account's data that determines whether or not it is necessary to upload the account Mii data to the account server.
911 * @param accountSlot The account slot number of the account to set the flag for.
912 * @param isDirty Whether or not the Mii data should be reuploaded to the account server.
913 */
914Result ACTA_SetIsMiiUpdated(u8 accountSlot, bool isDirty);
915
916/**
917 * @brief Initializes a server account transfer of a specific account to another device.
918 * @param accountSlot The account slot number of the account to transfer the server account of.
919 * @param newDevice Pointer to device info of the target device.
920 * @param operatorData Pointer to operator data for the transfer.
921 * @param operatorSize Size of the operator data buffer (max: 0x100)
922 * @param completionEvent The event handle to signal once the request has finished.
923 */
924Result ACTA_ReserveTransfer(u8 accountSlot, DeviceInfo *newDevice, char *operatorData, u32 operatorSize, Handle completionEvent);
925
926/**
927 * @brief Finalizes a server account transfer of a specifc account to another device.
928 * @param accountSlot The account slot number of the account to complete the transfer for.
929 * @param completionEvent The event handle to signal once the request has finished.
930 */
931Result ACTA_CompleteTransfer(u8 accountSlot, Handle completionEvent);
932
933/**
934 * @brief Inactivates the account-device association for a specific account. In other words, this deletes an NNID.
935 * @param accountSlot The account slot number of the account to perform this action on.
936 * @param completionEvent The event handle to signal once the request has finished.
937 */
939
940/**
941 * @brief Set the internal network time field.
942 * @param timestamp The new server time timestamp to use. The timestamp format is milliseconds elapsed since 01.01.2000 00:00:00 UTC.
943 */
945
946/**
947 * @brief Updates the account info of a specific account using raw XML data.
948 * @param accountSlot The account slot number of the account to update information for.
949 * @param xmlData Pointer to the input XML data.
950 * @param xmlDataSize Size of the input XML data.
951 * @param completionEvent The event handle to signal once the request has finished.
952 */
953Result ACTA_UpdateAccountInfo(u8 accountSlot, char *xmlData, u32 xmlDataSize, Handle completionEvent);
954
955/**
956 * @brief Updates the email address of a specific account.
957 * @param accountSlot The account slot number of the account to update the email address for.
958 * @param newEmail Pointer to the new email address to use.
959 * @param completionEvent The event handle to signal once the request has finished.
960 */
961Result ACTA_UpdateAccountMailAddress(u8 accountSlot, AccountMailAddress *newEmail, Handle completionEvent);
962
963/**
964 * @brief Deletes the device association for a specific account.
965 * @param accountSlot The account slot of the account to perform this action on.
966 * @param completionEvent The event handle to signal once the request has finished.
967 */
968Result ACTA_DeleteDeviceAssociation(u8 accountSlot, Handle completionEvent);
969
970/**
971 * @brief Deletes the account-device association for a specific account.
972 * @param accountSlot The account slot of the account to perform this action on.
973 * @param completionEvent The event handle to signal once the request has finished.
974 */
976
977/**
978 * @brief Cancels a pending server account transfer of a specific account to another device.
979 * @param accountSlot The account slot number of the account to cancel the transfer for.
980 * @param completionEvent The event handle to signal once the request has finished.
981 */
982Result ACTA_CancelTransfer(u8 accountSlot, Handle completionEvent);
983
984/**
985 * @brief Cancels any running HTTP requests, saves all pending changes to the system save data, then signals unloadFinishedEvent. Then, waits for remountAndBlockEvent, and once this has been signaled, remounts the system save, and blocks subsequent attempts to save the system save data (which can be bypassed by entering and exiting sleep mode).
986 * @param unloadFinishedEvent The event handle for ACT to signal once it has saved pending changes and has unmounted its system save.
987 * @param remountAndBlockEvent The event handle for the caller to signal once ACT should remount its save data and block subsequent save attempts.
988 */
989Result ACTA_ReloadAndBlockSaveData(Handle unloadFinishedEvent, Handle remountAndBlockEvent);
990
991/**
992 * @brief Initializes server-side account deletion for a specific account. In other words, this deletes an NNID.
993 * @param accountSlot The account slot number of the account to perform this action on.
994 * @param completionEvent The event handle to signal once the request has finished.
995 */
996Result ACTA_ReserveServerAccountDeletion(u8 accountSlot, Handle completionEvent);
NnasServerType
Enum for NNAS (Nintendo Network Authentication Server) type.
Definition act.h:121
Result ACTA_ReloadAndBlockSaveData(Handle unloadFinishedEvent, Handle remountAndBlockEvent)
Cancels any running HTTP requests, saves all pending changes to the system save data,...
#define ACCOUNT_EMAIL_LEN
256-character NULL-terminated ASCII email address
Definition act.h:11
Result ACT_GetAccountInfo(void *output, u32 outputSize, u8 accountSlot, u32 infoType)
Retrieves information of a certain account.
Result ACTA_UpdateMiiData(u8 accountSlot, CFLStoreData *miiData, MiiScreenName *screenName)
Updates a specific account's Mii data and screen name.
Result ACTA_ApproveByCreditCard(u8 accountSlot, CreditCardInfo *cardInfo, Handle completionEvent)
Requests COPPA parental consent using credit card information.
Result ACT_GetIndependentServiceTokenV2(IndependentServiceTokenV2 *token)
Gets a V2 independent service token requested using ACT_AcquireIndependentServiceTokenV2.
Result ACTA_SendPostingApprovalMail(u8 accountSlot, AccountMailAddress *parentalEmail, Handle completionEvent)
Requests parental approval for a specific account.
Result ACT_GenerateUuid(ActUuid *uuid, u32 uniqueId)
Generates a UUID.
Result ACTA_ReserveServerAccountDeletion(u8 accountSlot, Handle completionEvent)
Initializes server-side account deletion for a specific account.
Result ACTA_AgreeEula(u8 accountSlot, EulaInfo *eulaInfo, s64 agreementTimestamp, Handle completionEvent)
Submits a EULA agreement to the account server.
Result ACT_Cancel()
Cancels any currently running async operation.
Result ACTA_SyncAccountInfo(u8 accountSlot, Handle completionEvent)
Reloads account information from the server for a specific account.
Result ACTA_ReissueAccountPassword(u8 accountSlot, Handle completionEvent)
Requests the issuing of a temporary password (valid for 24 hours) to the email address associated wit...
Result ACTA_UnloadConsoleAccount()
Unloads the currently loaded local console account.
Result ACT_GetCachedIndependentServiceTokenV2(IndependentServiceTokenV2 *token, u8 accountSlot, char *clientId, u32 cacheDuration, bool doParentralControlsCheck, bool shared)
Gets a cached V2 independent service token for a specific account.
Result ACT_ResultToErrorCode(Result code)
Returns a support error code (XXX-YYYY) for the given ACT result code.
Result ACT_AcquireAccountInfoRaw(u8 accountSlot, Handle completionEvent)
Acquires raw (XML) account info for the specified account.
Result ACTA_DeleteDeviceAssociation(u8 accountSlot, Handle completionEvent)
Deletes the device association for a specific account.
Result ACT_AcquireEula(u8 countryCode, char *languageCode, Handle completionEvent)
Acquires the EULA for the given country and language combination.
Result ACT_AcquireIndependentServiceToken(u8 accountSlot, char *clientId, u32 cacheDuration, bool doParentalControlsCheck, bool shared, u32 callerProcessId, Handle completionEvent)
Requests a V1 independent service token for a specific account.
Result ACT_GetCachedIndependentServiceToken(IndependentServiceTokenV1 *token, u8 accountSlot, char *clientId, u32 cacheDuration, bool doParentralControlsCheck, bool shared)
Gets a cached V1 independent service token for a specific account.
Result ACTA_ValidateMailAddress(u8 accountSlot, u32 confirmationCode, Handle completionEvent)
Validates the email address of a specific account using the code received via the confirmation email.
Result ACTA_ReserveTransfer(u8 accountSlot, DeviceInfo *newDevice, char *operatorData, u32 operatorSize, Handle completionEvent)
Initializes a server account transfer of a specific account to another device.
Result ACTA_UpdateMiiImage(u8 accountSlot, u8 miiImageType, void *image, u32 imageSize)
Updates a Mii image of a specific account.
Result ACTA_SetTransferableIdCounter(u16 counter)
Sets the internal base value for generating new transferable IDs.
Result ACTA_LoadConsoleAccount(u8 accountSlot, bool doPasswordCheck, AccountPassword *password, bool useNullPassword, bool dryRun)
Loads ("logs in to") a local console account.
Result ACTA_CancelTransfer(u8 accountSlot, Handle completionEvent)
Cancels a pending server account transfer of a specific account to another device.
Result ACT_FindSlotNoByUuid(u8 *accountSlot, ActUuid *uuid, u32 uniqueId)
Finds the account slot number of the account having the specified UUID.
Result ACTA_InactivateDeviceAssociation(u8 accountSlot, Handle completionEvent)
Inactivates the device association for a specific account.
Result ACT_AcquireEulaLanguageList(u8 countryCode, Handle completionEvent)
Acquires a list of languages the EULA is available in for a given country.
Result ACT_AcquireTimezoneList(u8 countryCode, u8 languageCode, Handle completionEvent)
Acquires a list of timezones for the specified country and language combination.
Result ACTA_UnbindServerAccount(u8 accountSlot, bool completely)
Clears (but does not delete) account data for the given account slot.
Result ACTA_BindToExistentServerAccount(u8 accountSlot, AccountId *accountId, AccountMailAddress *mailAddress, AccountPassword *password, Handle completionEvent)
Links a local console account to an existing server account.
Result ACTA_UpdateAccountInfo(u8 accountSlot, char *xmlData, u32 xmlDataSize, Handle completionEvent)
Updates the account info of a specific account using raw XML data.
Result ACTA_SetAccountPasswordInput(u8 accountSlot, AccountPassword *passwordInput)
Sets the account password input for a specific account.
Result ACTA_UpdateAccountMailAddress(u8 accountSlot, AccountMailAddress *newEmail, Handle completionEvent)
Updates the email address of a specific account.
Result ACTA_GetSupportContext(SupportContext *supportContext, u8 accountSlot)
Creates a support context for a specific account.
Result ACTA_AcquireAccountTokenEx(u8 accountSlot, AccountPassword *password, bool useNullPassword, Handle completionEvent)
Acquires an account token for a specific account.
Result ACTA_SendCoppaCodeMail(u8 accountSlot, u32 principalId, Handle completionEvent)
Requests a COPPA code for a specific account.
Result ACT_AcquireMii(u32 *persistentIds, u32 persistentIdsSize, Handle completionEvent)
Acquires Miis corresponding to a given list of persistent IDs.
Result ACT_SetIsApplicationUpdateRequired(bool required)
Sets the IsApplicationUpdateRequired field in the internal account manager.
Result ACTA_SendConfirmationMail(u8 accountSlot, Handle completionEvent)
Requests the email address confirmation mail to be resent for a specific account.
Result ACT_GetNexServiceToken(NexServiceToken *token)
Gets a NEX service token requested using ACT_AcquireNexServiceToken.
Result ACTA_SwapAccounts(u8 accountSlot1, u8 accountSlot2)
Swaps the account slot numbers of two accounts.
AccountAccessTokenState
Enum for account access token state.
Definition act.h:131
Result ACT_GetMiiImage(u32 *outSize, void *output, u32 outputSize, u8 accountSlot, u8 miiImageType)
Gets one of the Mii images of a certain account.
Result ACT_AcquireEulaList(u8 countryCode, Handle completionEvent)
Acquires a list of EULA agreements for the specified country.
Result ACT_SetNfsPassword(u8 accountSlot, char *password)
Sets the NFS (Nintendo Friend Server) password for a certain account.
Result ACTA_DeleteConsoleAccount(u8 accountSlot)
Deletes a local console account.
Result ACTA_SetDefaultHostServerSettings(u8 nnasType, u8 nfsType, u8 nfsNo)
Sets default server environment settings.
Result ACTA_CompleteTransfer(u8 accountSlot, Handle completionEvent)
Finalizes a server account transfer of a specifc account to another device.
Result ACTA_EnableAccountPasswordCache(u8 accountSlot, bool enabled)
Enables or disables the account password cache for a specific account.
Result ACT_AcquireAccountIdByPrincipalId(u32 *principalIds, u32 principalIdsSize, u8 unk, Handle completionEvent)
Acquires account IDs from a list of principal IDs.
Result ACTA_InactivateAccountDeviceAssociation(u8 accountSlot, Handle completionEvent)
Inactivates the account-device association for a specific account.
MiiImageType
Enum for Mii image type.
Definition act.h:107
@ MII_IMAGE_PRIMARY
The user's primary Mii image.
Definition act.h:108
ACT_InfoType
Enum for common / account specific info types.
Definition act.h:35
@ INFO_TYPE_MII_IMAGE_URL
char[0x100+1]
Definition act.h:73
@ INFO_TYPE_COMMON_DEVICE_HASH
u8[8]
Definition act.h:78
@ INFO_TYPE_IS_MII_UPDATED
bool
Definition act.h:67
@ INFO_TYPE_COUNTRY_NAME
char[2+1]
Definition act.h:47
@ INFO_TYPE_TRANSLATED_SIMPLE_ADDRESS_ID
u32
Definition act.h:83
@ INFO_TYPE_BIRTH_DATE
BirthDate structure.
Definition act.h:46
@ INFO_TYPE_MAIL_ADDRESS
AccountMailAddress.
Definition act.h:45
@ INFO_TYPE_TIMEZONE_ID
char[0x40+1]
Definition act.h:66
@ INFO_TYPE_HAS_ECI_VIRTUAL_ACCOUNT
bool
Definition act.h:65
@ INFO_TYPE_LAST_AUTHENTICATION_RESULT
Result.
Definition act.h:56
@ INFO_TYPE_ACCOUNT_SERVER_ENVIRONMENT
AccountServerTypesStr structure.
Definition act.h:76
@ INFO_TYPE_AGE
u16
Definition act.h:80
@ INFO_TYPE_NFS_PASSWORD
char[0x10+1]
Definition act.h:64
@ INFO_TYPE_ACCOUNT_INFO
AccountInfo structure.
Definition act.h:53
@ INFO_TYPE_IS_OFF_DEVICE_ENABLED
bool
Definition act.h:82
@ INFO_TYPE_COMMON_DEFAULT_ACCOUNT_SERVER_TYPES
AccountServerTypes.
Definition act.h:71
@ INFO_TYPE_IS_ENABLED_RECEIVE_ADS
bool
Definition act.h:81
@ INFO_TYPE_COMMON_DEFAULT_ACCOUNT_SLOT
u8
Definition act.h:38
@ INFO_TYPE_COMMON_DEFAULT_ACCOUNT_SERVER_ENVIRONMENT
AccountServerTypesStr structure.
Definition act.h:77
@ INFO_TYPE_COMMON_NUM_ACCOUNTS
u8
Definition act.h:36
@ INFO_TYPE_ASSIGNED_ACCOUNT_ID
AccountId.
Definition act.h:57
@ INFO_TYPE_TRANSFERABLE_ID_BASE
u64
Definition act.h:42
@ INFO_TYPE_IS_COMMITTED
bool
Definition act.h:62
@ INFO_TYPE_COMMON_IS_APPLICATION_UPDATE_REQUIRED
bool
Definition act.h:70
@ INFO_TYPE_IS_PASSWORD_CACHE_ENABLED
bool
Definition act.h:50
@ INFO_TYPE_PRINCIPAL_ID
u32
Definition act.h:48
@ INFO_TYPE_IS_MAIL_ADDRESS_VALIDATED
bool
Definition act.h:68
@ INFO_TYPE_UTC_OFFSET
s64
Definition act.h:61
@ INFO_TYPE_COMMON_CURRENT_ACCOUNT_SLOT
u8
Definition act.h:37
@ INFO_TYPE_COMMON_TRANSFERABLE_ID_BASE
u64
Definition act.h:41
@ INFO_TYPE_MII
CFLStoreData.
Definition act.h:43
@ INFO_TYPE_ACCOUNT_ACCESS_TOKEN
AccountAccessToken structure.
Definition act.h:69
@ INFO_TYPE_ACCOUNT_ID
AccountId.
Definition act.h:44
@ INFO_TYPE_GENDER
AccountServerTypes.
Definition act.h:55
@ INFO_TYPE_FP_LOCAL_ACCOUNT_ID
u8
Definition act.h:79
@ INFO_TYPE_SIMPLE_ADDRESS_ID
u32
Definition act.h:59
@ INFO_TYPE_PERSISTENT_ID
u32
Definition act.h:40
@ INFO_TYPE_COMMON_NETWORK_TIME_DIFF
s64, difference between server time and device time in nanoseconds.
Definition act.h:39
@ INFO_TYPE_PARENTAL_CONTROL_SLOT_NUMBER
u8
Definition act.h:58
@ INFO_TYPE_ACCOUNT_ACCESS_TOKEN_STATE
u32, AccountAccessTokenState enum
Definition act.h:75
@ INFO_TYPE_IS_SERVER_ACCOUNT_DELETED
bool
Definition act.h:72
@ INFO_TYPE_ASSIGNED_PRINCIPAL_ID
u32
Definition act.h:74
@ INFO_TYPE_MII_NAME
MiiScreenName.
Definition act.h:63
Result ACTA_UpdateAccountPassword(u8 accountSlot, AccountPassword *newPassword, Handle completionEvent)
Updates the account password for a specific account.
Result ACTA_ReplaceAccountId(u8 accountSlot)
Replaces the AccountId with the AssignedAccountId for a specific account.
Result ACTA_SetIsMiiUpdated(u8 accountSlot, bool isDirty)
Set a flag in a specifc account's data that determines whether or not it is necessary to upload the a...
Result ACTA_SetDefaultAccount(u8 accountSlot)
Sets the default account that is loaded when the ACT module is initialized.
Result ACTA_SetDefaultHostServerSettingsStr(ActNnasSubdomain *nnasSubdomain, NfsTypeStr *nfsTypeStr)
Sets default server environment settings (in string form).
Result ACT_AcquireNexServiceToken(u8 accountSlot, u32 serverId, bool doParentralControlsCheck, u32 callerProcessId, Handle completionEvent)
Acquires an account-specific service token for a NEX server.
ACT_AsyncRequestType
Definition act.h:87
@ REQUEST_ACQUIRE_EULA
EulaList structure (dynamically sized)
Definition act.h:90
@ REQUEST_ACQUIRE_EULA_LIST
EulaList structure (dynamically sized)
Definition act.h:91
@ REQUEST_ACQUIRE_PRINCIPAL_ID_BY_ACCOUNT_ID_MULTI
u32[count]
Definition act.h:97
@ REQUEST_BIND_TO_EXISTENT_SERVER_ACCOUNT
u32, parentalConsentApprovalId
Definition act.h:89
@ REQUEST_ACQUIRE_PRINCIPAL_ID_BY_ACCOUNT_ID
u32
Definition act.h:98
@ REQUEST_ACQUIRE_TIMEZONE_LIST
TimezoneList structure.
Definition act.h:93
@ REQUEST_INQUIRE_BINDING_TO_EXISTENT_SERVER_ACCOUNT
ExistentServerAccountData struct.
Definition act.h:88
@ REQUEST_ACQUIRE_ACCOUNT_INFO
INFO_TYPE_MAIL_ADDRESS: AccountMailAddress.
Definition act.h:94
@ REQUEST_ACQUIRE_ACCOUNT_INFO_RAW
char[0xC00+1], NULL-terminate ASCII raw profile XML data
Definition act.h:102
@ REQUEST_ACQUIRE_ACCOUNT_ID_BY_PRINCIPAL_ID
AccountId.
Definition act.h:96
@ REQUEST_SEND_COPPA_CODE_MAIL
CoppaCodeMailData structure.
Definition act.h:100
@ REQUEST_ACQUIRE_EULA_LANGUAGE_LIST
EulaList structure with only the languageNameOffsets populated (dynamically sized)
Definition act.h:92
@ REQUEST_APPROVE_BY_CREDIT_CARD
u32, approvalId
Definition act.h:99
@ REQUEST_ACQUIRE_MII
CFLStoreData[count].
Definition act.h:101
@ REQUEST_ACQUIRE_ACCOUNT_ID_BY_PRINCIPAL_ID_MULTI
AccountId[count].
Definition act.h:95
Result ACTA_SetNetworkTime(s64 timestamp)
Set the internal network time field.
#define ACCOUNT_PASSWORD_LEN
17-character NULL-terminated ASCII password
Definition act.h:12
#define ACT_UUID_LEN
RFC9562 Version 1 UUID.
Definition act.h:15
Result ACTA_SendMasterKeyMailForPin(u8 accountSlot, u32 masterKey, AccountMailAddress *parentalEmail, Handle completionEvent)
Sends the master key for resetting parental controls to a parental email for a specific account.
Result ACTA_SetHostServerSettingsStr(u8 accountSlot, ActNnasSubdomain *nnasSubdomain, NfsTypeStr *nfsTypeStr)
Sets server environment settings (in string form) for a specific account.
Result ACT_AcquireAccountInfo(u8 accountSlot, u32 infoType, Handle completionEvent)
Acquires account information for the specified account.
Result ACT_GetCommonInfo(void *output, u32 outputSize, u32 infoType)
Retrieves information not specific to any one account.
Result ACTA_DeleteServerAccount(u8 accountSlot, Handle completionEvent)
Deletes a server account.
Result ACT_GetAsyncResult(u32 *outReadSize, void *output, u32 outputSize, u32 requestType)
Returns the data resulting from an async request.
Result actInit(bool forceUser)
Initializes ACT services.
Result ACTA_UploadMii(u8 accountSlot, Handle completionEvent)
Uploads the Mii data of a specific account to the account server.
Result ACT_AcquirePrincipalIdByAccountId(AccountId *accountIds, u32 accountIdsSize, Handle completionHandle)
Acquires principal IDs from a list of account IDs.
Result ACT_GetTransferableId(u64 *transferableId, u8 accountSlot, u8 saltValue)
Returns a TransferableID for a certain account.
Result ACTA_InquireAccountIdAvailability(u8 accountSlot, AccountId *accountId, Handle completionEvent)
Checks whether or not the given account ID is available for creating a new server account.
void actExit(void)
Exits ACT services.
#define ACT_NNAS_SUBDOMAIN_LEN
32-character NULL-terminated ASCII NNAS (Nintendo Network Authentication Server) subdomain
Definition act.h:14
Result ACTA_SetHostServerSettings(u8 accountSlot, u8 nnasType, u8 nfsType, u8 nfsNo)
Sets server environment settings for a specific account.
Result ACTA_BindToNewServerAccount(u8 accountSlot, AccountId *accountId, AccountMailAddress *mailAddress, AccountPassword *password, bool isParentEmail, bool marketingFlag, bool offDeviceFlag, s64 birthDateTimestatmp, u8 gender, u32 region, AccountTimezone *timezone, EulaInfo *eulaInfo, s64 parentalConsentTimestamp, u32 parentalConsentId, Handle completionEvent)
Links a new server account to a local console account.
Result ACTA_DeleteAccountDeviceAssociation(u8 accountSlot, Handle completionEvent)
Deletes the account-device association for a specific account.
InvalidateAccessTokenAction
Enum for account access token invalidation action.
Definition act.h:139
@ INVALIDATE_ACCESS_TOKEN
Invalidates only the account token itself (and the expiry date).
Definition act.h:140
@ INVALIDATE_REFRESH_TOKEN
Invalidates only the refresh token.
Definition act.h:141
#define ACCOUNT_ID_LEN
16-character NULL-terminated ASCII Account ID
Definition act.h:10
Result ACTA_SendConfirmationMailForPin(u8 accountSlot, AccountMailAddress *parentalEmail, Handle completionEvent)
Registers a parental email address to be used in case the parental controls PIN has been forgotten fo...
Result ACT_GetLastResponseResult()
Gets the result of the last internal operation.
Result ACT_GetUuid(ActUuid *uuid, u8 accountSlot, u32 uniqueId)
Gets a specific account's UUID.
Result ACTA_InquireBindingToExistentServerAccount(u8 accountSlot, AccountId *accountId, AccountMailAddress *mailAddress, AccountPassword *password, Handle completionEvent)
Acquires information about an existing server account.
Result ACT_AcquireIndependentServiceTokenV2(u8 accountSlot, char *clientId, u32 cacheDuration, bool doParentalControlsCheck, bool shared, u32 callerProcessId, Handle completionEvent)
Requests a V2 independent service token for a specific account.
Result ACT_InquireMailAddressAvailability(AccountMailAddress *mailAddress, Handle completionEvent)
Inquires whether or not the given email address is available for creating a new account.
Result ACT_Initialize(u32 sdkVersion, u32 sharedMemSize, Handle sharedMem)
Initializes the current ACT session.
Result ACTA_CommitConsoleAccount(u8 accountSlot)
Sets a local console account as committed.
Result ACT_Save()
Saves all pending changes to the ACT system save data.
Result ACTA_CreateConsoleAccount()
Creates a new local console account.
Handle * actGetSessionHandle(void)
Get the ACT user/admin service handle.
Result ACTA_InvalidateAccountToken(u8 accountSlot, u32 invalidationActionMask)
Invalidates a specific account's access token in different ways.
Result ACTA_SetPersistentIdHead(u32 head)
Sets the internal base value for generating new persistent IDs.
Result ACT_GetIndependentServiceToken(IndependentServiceTokenV1 *token)
Gets a V1 independent service token requested using ACT_AcquireIndependentServiceToken.
Friend Services.
Shared Mii struct.
Account access token structure.
Definition act.h:328
u8 state
AccountAccessTokenState enum.
Definition act.h:329
Account info structure.
Definition act.h:171
Account server types structure (string format)
Definition act.h:321
NfsTypeStr nfsTypeStr
NFS (Nintendo Friend Server) type string (letter + number)
Definition act.h:323
ActNnasSubdomain nnasSubdomain
NNAS (Nintendo Network Authentication Server) subdomain.
Definition act.h:322
Account server types structure (raw format)
Definition act.h:312
u8 nnasType
NNAS (Nintendo Network Authentication Server) type.
Definition act.h:313
u8 nfsNo
NFS (Nintendo Friend Server) number.
Definition act.h:315
u8 nfsType
NFS (Nintendo Friend Server) type.
Definition act.h:314
Account Timezone structure.
Definition act.h:185
Birth date structure.
Definition act.h:163
Mii CFLStoreData (CTR Face Library Store Data) structure.
Definition act.h:155
Coppa Code Mail Data Structure.
Definition act.h:146
Credit Card Info structure.
Definition act.h:285
Device Info structure.
Definition act.h:266
EULA entry header structure.
Definition act.h:225
u32 eulaTypeOffset
Offset of the EulaType within textData.
Definition act.h:233
u32 languageNameOffset
Offset of the LanguageName within textData.
Definition act.h:236
u32 mainTextOffset
Offset of the MainText within textData.
Definition act.h:238
u32 agreeTextOffset
Offset of the AgreeText within textData.
Definition act.h:234
u32 nonAgreeTextOffset
Offset of the NonAgreeText within textData.
Definition act.h:235
u32 subTitleOffset
Offset of the SubTitle within textData.
Definition act.h:239
u32 mainTitleOffset
Offset of the MainTitle within textData.
Definition act.h:237
u32 subTextOffset
Offset of the SubText within textData.
Definition act.h:240
u32 nextEntryOffset
Offset of next EULA entry, relative to full data blob.
Definition act.h:232
EULA Info structure.
Definition act.h:203
EULA list structure.
Definition act.h:259
u8 numEntries
Number of entries within the list.
Definition act.h:260
Existent Server Account Data structure.
Definition act.h:211
V1 Independent service token structure.
Definition act.h:297
V2 Independent service token structure.
Definition act.h:303
Shared Base Mii struct.
Definition mii.h:17
NEX service token structure.
Definition act.h:273
Support Context structure.
Definition act.h:246
AccountId accountId
Account ID of the account.
Definition act.h:247
u16 randomNumber
Random number based on the principalId and serialNumber.
Definition act.h:251
u32 serialNumber
Serial number of the console (only digits).
Definition act.h:249
Timezone List structure.
Definition act.h:195
Various system types.
int64_t s64
64-bit signed integer
Definition types.h:29
#define BIT(n)
Creates a bitmask from a bit number.
Definition types.h:47
uint64_t u64
64-bit unsigned integer
Definition types.h:24
uint8_t u8
would be nice if newlib had this already
Definition types.h:21
u32 Handle
Resource handle.
Definition types.h:41
s32 Result
Function result.
Definition types.h:42
uint16_t u16
16-bit unsigned integer
Definition types.h:22
uint32_t u32
32-bit unsigned integer
Definition types.h:23