Shared Database services: Difference between revisions
No edit summary |
No edit summary |
||
(12 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
= pl:u = | = pl:u, pl:s = | ||
These are "nn::pl::detail::IPlatformServiceManager". | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 23: | Line 23: | ||
|- | |- | ||
| 101 || [8.0.0+] RequestApplicationFunctionAuthorizationForSystem | | 101 || [8.0.0+] RequestApplicationFunctionAuthorizationForSystem | ||
|- | |||
| 1000 || [9.0.0+] LoadNgWordDataForPlatformRegionChina | |||
|- | |||
| 1001 || [9.0.0+] GetNgWordDataSizeForPlatformRegionChina | |||
|} | |} | ||
Line 253: | Line 257: | ||
== Cmd8 == | == Cmd8 == | ||
Takes an input u8 [[#AppletEventType]], an u8 | Takes an input u8 [[#AppletEventType]], an u8 [[Applet_Manager_services#LibraryAppletMode|LibraryAppletMode]], an u8 [[Applet_Manager_services#AppletId|AppletId]], an u8 [[Filesystem_services#StorageId|StorageId]], an u8 [[#PlayLogPolicy]], and an u64 '''titleID'''. Returns no output. | ||
This is similar to [[#NotifyAppletEvent]]. | This is similar to [[#NotifyAppletEvent]]. | ||
Line 264: | Line 268: | ||
* Sets the 3 timestamps. | * Sets the 3 timestamps. | ||
* Converts '''titleID''' and writes it to +0x0. | * Converts '''titleID''' and writes it to +0x0. | ||
* u8 +0x9 = | * u8 +0x9 = [[Applet_Manager_services#LibraryAppletMode|LibraryAppletMode]]. | ||
* u8 +0x8 = 1. | * u8 +0x8 = 1. | ||
* u8 +0xC = [[Applet_Manager_services#AppletId|AppletId]], u8 +0xD = [[Filesystem_services#StorageId|StorageId]], and u8 +0xE = [[#PlayLogPolicy]]. | * u8 +0xC = [[Applet_Manager_services#AppletId|AppletId]], u8 +0xD = [[Filesystem_services#StorageId|StorageId]], and u8 +0xE = [[#PlayLogPolicy]]. | ||
Line 284: | Line 288: | ||
! Cmd || Name | ! Cmd || Name | ||
|- | |- | ||
| 0 || [[# | | 0 || [[#QueryAppletEvent]] ([1.0.0-7.0.1] QueryApplicationEvent) | ||
|- | |- | ||
| [1.0.0-6.2.0] 1 || QueryPlayStatistics | | [1.0.0-6.2.0] 1 || [[#QueryPlayStatistics]] | ||
|- | |- | ||
| [1.0.0-6.2.0] 2 || QueryPlayStatisticsByUserAccountId | | [1.0.0-6.2.0] 2 || [[#QueryPlayStatisticsByUserAccountId]] | ||
|- | |- | ||
| [1.0.0-6.2.0] 3 || QueryPlayStatisticsByNetworkServiceAccountId | | [1.0.0-6.2.0] 3 || [[#QueryPlayStatisticsByNetworkServiceAccountId]] | ||
|- | |- | ||
| 4 || [[#QueryPlayStatisticsByApplicationId]] | | 4 || [[#QueryPlayStatisticsByApplicationId]] | ||
Line 296: | Line 300: | ||
| 5 || [[#QueryPlayStatisticsByApplicationIdAndUserAccountId]] | | 5 || [[#QueryPlayStatisticsByApplicationIdAndUserAccountId]] | ||
|- | |- | ||
| [1.0.0-6.2.0] 6 || QueryPlayStatisticsByApplicationIdAndNetworkServiceAccountId | | [1.0.0-6.2.0] 6 || [[#QueryPlayStatisticsByApplicationIdAndNetworkServiceAccountId]] | ||
|- | |- | ||
| 7 || [[#QueryLastPlayTime]] | | 7 || [[#QueryLastPlayTime]] | ||
Line 312: | Line 316: | ||
| 13 || [5.0.0+] [[#QueryApplicationPlayStatisticsForSystem]] | | 13 || [5.0.0+] [[#QueryApplicationPlayStatisticsForSystem]] | ||
|- | |- | ||
| 14 || [6.0.0+] | | 14 || [6.0.0+] [[#QueryRecentlyPlayedApplication]] | ||
|- | |- | ||
| 15 || [6.0.0+] | | 15 || [6.0.0+] [[#GetRecentlyPlayedApplicationUpdateEvent]] | ||
|- | |- | ||
| 16 || [6.0.0+] | | 16 || [6.0.0+] [[#QueryApplicationPlayStatisticsByUserAccountIdForSystem]] | ||
|} | |} | ||
== | == QueryAppletEvent == | ||
Takes an input | Takes an input s32 entry_index, a type-0x6 output buffer containing an array of [[#AppletEvent]], and returns an output s32 for actual total output entries. | ||
== QueryPlayStatistics == | |||
Takes a type-0x6 output buffer containing an array of [[#PlayStatistics]] and returns an output s32 for actual total output entries. | |||
[6.2.0+] This command was removed. | |||
== QueryPlayStatisticsByUserAccountId == | |||
Takes an input u128 '''Uid''', a type-0x6 output buffer containing an array of [[#PlayStatistics]] and returns an output s32 for actual total output entries. | |||
[6.2.0+] This command was removed. | |||
== QueryPlayStatisticsByNetworkServiceAccountId == | |||
Takes an input u64 '''NetworkServiceAccountId''', a type-0x6 output buffer containing an array of [[#PlayStatistics]] and returns an output s32 for actual total output entries. | |||
[6.2.0+] This command was removed. | |||
== QueryPlayStatisticsByApplicationId == | == QueryPlayStatisticsByApplicationId == | ||
Takes an input u64 | Takes an input u64 '''ApplicationId''' and returns an output [[#PlayStatistics]]. | ||
== QueryPlayStatisticsByApplicationIdAndUserAccountId == | == QueryPlayStatisticsByApplicationIdAndUserAccountId == | ||
Takes an input u64 | Takes an input u64 '''ApplicationId''', an input u128 '''Uid''' and returns an output [[#PlayStatistics]]. | ||
== QueryPlayStatisticsByApplicationIdAndNetworkServiceAccountId == | |||
Takes an input u64 '''ApplicationId''', an input u64 '''NetworkServiceAccountId''' and returns an output [[#PlayStatistics]]. | |||
[6.2.0+] This command was removed. | |||
== QueryLastPlayTime == | == QueryLastPlayTime == | ||
Takes a type-0x6 output buffer containing an array of [[#LastPlayTime]], and a type-0x5 input buffer containing an array of u64 | Takes a type-0x6 output buffer containing an array of [[#LastPlayTime]], and a type-0x5 input buffer containing an array of u64 '''ApplicationId'''. Returns an output s32 for actual total output entries. | ||
== QueryPlayEvent == | == QueryPlayEvent == | ||
Takes an input | Takes an input s32 entry_index, a type-0x6 output buffer containing an array of [[#PlayEvent]], and returns an output s32 for actual total output entries. | ||
== GetAvailablePlayEventRange == | == GetAvailablePlayEventRange == | ||
No input, returns 3 output | No input, returns 3 output s32s: total_entries, start_entry_index, and end_entry_index. | ||
== QueryAccountEvent == | == QueryAccountEvent == | ||
Takes an input | Takes an input s32 entry_index, a type-0x6 output buffer containing an array of [[#AccountEvent]], and returns an output s32 for actual total output entries. | ||
== QueryAccountPlayEvent == | == QueryAccountPlayEvent == | ||
Takes an input | Takes an input s32 entry_offset, an input u128 '''Uid''', a type-0x6 output buffer containing an array of [[#AccountPlayEvent]], and returns an output s32 for actual total output entries. | ||
== GetAvailableAccountPlayEventRange == | == GetAvailableAccountPlayEventRange == | ||
Takes an input u128 | Takes an input u128 '''Uid''' and returns 3 output s32s: total_entries, start_entry_index, and end_entry_index. | ||
== QueryApplicationPlayStatisticsForSystem == | == QueryApplicationPlayStatisticsForSystem == | ||
Takes a type-0x6 output buffer containing an array of [[#ApplicationPlayStatistics]] and a type-0x5 input buffer containing an array of u64 | Takes a type-0x6 output buffer containing an array of [[#ApplicationPlayStatistics]] and a type-0x5 input buffer containing an array of u64 '''ApplicationId'''. Returns an output s32 for actual total output entries. | ||
The number of entries in each array is the same. | The number of entries in each array is the same. | ||
== | == QueryRecentlyPlayedApplication == | ||
Takes an input u128 | Takes an input u128 '''Uid''', a type-0x6 output buffer containing an array of u64 '''ApplicationId''', and returns an output s32 for actual total output entries. | ||
Returns a list of titles played by the specified user. | Returns a list of titles played by the specified user. | ||
== | == GetRecentlyPlayedApplicationUpdateEvent == | ||
No input, returns an output Event handle with autoclear=false. | No input, returns an output Event handle with autoclear=false. | ||
This is signaled when logging a new [[#PlayEvent]] which would be available via [[#QueryAccountEvent]], where [[#PlayEvent]] +0x18 is 0. | This is signaled when logging a new [[#PlayEvent]] which would be available via [[#QueryAccountEvent]], where [[#PlayEvent]] +0x18 is 0. | ||
== | == QueryApplicationPlayStatisticsByUserAccountIdForSystem == | ||
Takes a u128 | Takes a u128 '''Uid''', a type-0x6 output buffer containing an array of [[#ApplicationPlayStatistics]] and a type-0x5 input buffer containing an array of u64 '''ApplicationId'''. Returns an output s32 for actual total output entries. | ||
Same as [[#QueryApplicationPlayStatisticsForSystem]] except this gets playstats specific to | Same as [[#QueryApplicationPlayStatisticsForSystem]] except this gets playstats specific to '''Uid'''. | ||
= avm = | = avm = | ||
Line 410: | Line 434: | ||
|} | |} | ||
= ApplicationEvent | = AppletEvent = | ||
This is "nn::pdm::AppletEvent" ([1.0.0-7.0.1] "nn::pdm::ApplicationEvent"). | |||
This is a 0x18-byte struct. | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 429: | Line 457: | ||
| 0x15 || 0x3 || Padding | | 0x15 || 0x3 || Padding | ||
|} | |} | ||
Timestamp format, converted from PosixTime: total minutes since epoch UTC 1999/12/31 00:00. | Timestamp format, converted from PosixTime: total minutes since epoch UTC 1999/12/31 00:00. | ||
= PlayStatistics = | = PlayStatistics = | ||
This is "nn::pdm::PlayStatistics". | |||
This is a 0x28-byte struct. | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 445: | Line 475: | ||
| 0x8 || 0x4 || First entryindex | | 0x8 || 0x4 || First entryindex | ||
|- | |- | ||
| 0xC || 0x4 || First timestamp0. Same as the first [[# | | 0xC || 0x4 || First timestamp0. Same as the first [[#AppletEvent]] timestamp. | ||
|- | |- | ||
| 0x10 || 0x4 || First timestamp1. Same as the second [[# | | 0x10 || 0x4 || First timestamp1. Same as the second [[#AppletEvent]] timestamp. | ||
|- | |- | ||
| 0x14 || 0x4 || Last entryindex | | 0x14 || 0x4 || Last entryindex | ||
|- | |- | ||
| 0x18 || 0x4 || Last timestamp0. Same as the first [[# | | 0x18 || 0x4 || Last timestamp0. Same as the first [[#AppletEvent]] timestamp. | ||
|- | |- | ||
| 0x1C || 0x4 || Last timestamp1. Same as the second [[# | | 0x1C || 0x4 || Last timestamp1. Same as the second [[#AppletEvent]] timestamp. | ||
|- | |- | ||
| 0x20 || 0x4 || Total play-time in minutes. | | 0x20 || 0x4 || Total play-time in minutes. | ||
Line 460: | Line 490: | ||
|} | |} | ||
This is a | = LastPlayTime = | ||
This is "nn::pdm::LastPlayTime". | |||
This is a 0x18-byte struct and contains data from the last time the title was played. | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 471: | Line 503: | ||
| 0x0 || 0x8 || titleID | | 0x0 || 0x8 || titleID | ||
|- | |- | ||
| 0x8 || 0x4 || Same as the first [[# | | 0x8 || 0x4 || Same as the first [[#AppletEvent]] timestamp. | ||
|- | |- | ||
| 0xC || 0x4 || Same as the second [[# | | 0xC || 0x4 || Same as the second [[#AppletEvent]] timestamp. | ||
|- | |- | ||
| 0x10 || 0x4 || Total minutes since the title was last played. | | 0x10 || 0x4 || Total minutes since the title was last played. | ||
Line 482: | Line 514: | ||
|} | |} | ||
This is | = PlayEventType = | ||
This is an enum for [[#PlayEvent]] +0x1C, which indicates the type of [[#PlayEvent]]. | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 497: | Line 529: | ||
|- | |- | ||
| 3 || OperationModeChange | | 3 || OperationModeChange | ||
|- | |||
| 4 || Initialize. Used for the very first [[#PlayEvent]] entry in the log. | |||
|} | |} | ||
This is an enum for [[#PlayEvent]] + | = AppletEventType = | ||
This is an enum for [[#PlayEvent]] +0xF with [[#PlayEventType]] = Applet, this indicates the type of the Applet event. | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 521: | Line 555: | ||
| 6 || "exit" | | 6 || "exit" | ||
|} | |} | ||
= PlayLogPolicy = | = PlayLogPolicy = | ||
Line 541: | Line 573: | ||
= PlayEvent = | = PlayEvent = | ||
This is "nn::pdm::PlayEvent". | |||
This is a 0x38-byte struct and is the raw entry struct directly read from FS, without any entry filtering. The other structs are extracted+converted from this one, with filtering. | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 557: | Line 593: | ||
| 0x30 || 0x8 || Timestamp in seconds derived from [[PCV_services|StandardSteadyClock]]. | | 0x30 || 0x8 || Timestamp in seconds derived from [[PCV_services|StandardSteadyClock]]. | ||
|} | |} | ||
Filtering: | Filtering: | ||
* [[# | * [[#QueryAppletEvent]], [[#QueryLastPlayTime]], and [[#QueryApplicationPlayStatisticsForSystem]]: PlayEvent +0x1C must be 0, +0xC must be 1, and +0xE must be 0. | ||
* [[#QueryPlayStatisticsByApplicationId]]: PlayEvent +0x1C must be 0, +0xC must be 1, and the titleID must match. | * [[#QueryPlayStatisticsByApplicationId]]: PlayEvent +0x1C must be 0, +0xC must be 1, and the titleID must match. | ||
* [[#QueryAccountEvent]]: PlayEvent +0x1C must be 1 and PlayEvent +0x18 must be <=1. | * [[#QueryAccountEvent]]: PlayEvent +0x1C must be 1 and PlayEvent +0x18 must be <=1. | ||
Line 571: | Line 603: | ||
Applet: | Applet: | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 580: | Line 611: | ||
| 0x0 || 0x8 || titleID | | 0x0 || 0x8 || titleID | ||
|- | |- | ||
| 0x8 || 0x4 || | | 0x8 || 0x4 || Title version, set by pdm:ntfy [[#NotifyAppletEvent]] and [[#Cmd9]]. | ||
|- | |- | ||
| 0x9 || 0x1 || See above. | | 0x8 || 0x1 || When set to u8 0x1 by pdm:ntfy [[#Cmd8]], this indicates that +0x9 is set. Only used for non-applications. | ||
|- | |||
| 0x9 || 0x1 || See above. [[Applet_Manager_services#LibraryAppletMode|LibraryAppletMode]] | |||
|- | |- | ||
| 0xC || 0x1 || [[Applet_Manager_services#AppletId|AppletId]] | | 0xC || 0x1 || [[Applet_Manager_services#AppletId|AppletId]] | ||
Line 596: | Line 629: | ||
Account: | Account: | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 615: | Line 647: | ||
= AccountEvent = | = AccountEvent = | ||
This is "nn::pdm::AccountEvent". | |||
This is a 0x38-byte struct. | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 638: | Line 674: | ||
|} | |} | ||
This is a | = AccountPlayEvent = | ||
This is "nn::pdm::AccountPlayEvent". | |||
This is a 0x28-byte struct and is the raw entry struct directly read from FS, without any entry filtering. This is separate from [[#PlayEvent]]. | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 658: | Line 696: | ||
|} | |} | ||
This is | = ApplicationPlayStatistics = | ||
This is "nn::pdm::ApplicationPlayStatistics". | |||
This is | This is a 0x18-byte struct. | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 675: | Line 713: | ||
| 0x10 || 0x8 || Total times the application title was launched. | | 0x10 || 0x8 || Total times the application title was launched. | ||
|} | |} | ||
[[Category:Services]] | [[Category:Services]] |