diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/loader/deconstructed_rom_directory.cpp | 9 | ||||
| -rw-r--r-- | src/core/telemetry_session.cpp | 24 |
2 files changed, 29 insertions, 4 deletions
diff --git a/src/core/loader/deconstructed_rom_directory.cpp b/src/core/loader/deconstructed_rom_directory.cpp index 223570431..2b8f78136 100644 --- a/src/core/loader/deconstructed_rom_directory.cpp +++ b/src/core/loader/deconstructed_rom_directory.cpp | |||
| @@ -27,6 +27,14 @@ AppLoader_DeconstructedRomDirectory::AppLoader_DeconstructedRomDirectory(FileSys | |||
| 27 | : AppLoader(std::move(file_)), override_update(override_update) { | 27 | : AppLoader(std::move(file_)), override_update(override_update) { |
| 28 | const auto dir = file->GetContainingDirectory(); | 28 | const auto dir = file->GetContainingDirectory(); |
| 29 | 29 | ||
| 30 | // Title ID | ||
| 31 | const auto npdm = dir->GetFile("main.npdm"); | ||
| 32 | if (npdm != nullptr) { | ||
| 33 | const auto res = metadata.Load(npdm); | ||
| 34 | if (res == ResultStatus::Success) | ||
| 35 | title_id = metadata.GetTitleID(); | ||
| 36 | } | ||
| 37 | |||
| 30 | // Icon | 38 | // Icon |
| 31 | FileSys::VirtualFile icon_file = nullptr; | 39 | FileSys::VirtualFile icon_file = nullptr; |
| 32 | for (const auto& language : FileSys::LANGUAGE_NAMES) { | 40 | for (const auto& language : FileSys::LANGUAGE_NAMES) { |
| @@ -138,7 +146,6 @@ ResultStatus AppLoader_DeconstructedRomDirectory::Load( | |||
| 138 | } | 146 | } |
| 139 | 147 | ||
| 140 | auto& kernel = Core::System::GetInstance().Kernel(); | 148 | auto& kernel = Core::System::GetInstance().Kernel(); |
| 141 | title_id = metadata.GetTitleID(); | ||
| 142 | process->program_id = metadata.GetTitleID(); | 149 | process->program_id = metadata.GetTitleID(); |
| 143 | process->svc_access_mask.set(); | 150 | process->svc_access_mask.set(); |
| 144 | process->resource_limit = | 151 | process->resource_limit = |
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index 65571b948..3730e85b8 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | #include "common/file_util.h" | 7 | #include "common/file_util.h" |
| 8 | 8 | ||
| 9 | #include "core/core.h" | 9 | #include "core/core.h" |
| 10 | #include "core/file_sys/control_metadata.h" | ||
| 11 | #include "core/file_sys/patch_manager.h" | ||
| 10 | #include "core/loader/loader.h" | 12 | #include "core/loader/loader.h" |
| 11 | #include "core/settings.h" | 13 | #include "core/settings.h" |
| 12 | #include "core/telemetry_session.h" | 14 | #include "core/telemetry_session.h" |
| @@ -88,12 +90,28 @@ TelemetrySession::TelemetrySession() { | |||
| 88 | std::chrono::system_clock::now().time_since_epoch()) | 90 | std::chrono::system_clock::now().time_since_epoch()) |
| 89 | .count()}; | 91 | .count()}; |
| 90 | AddField(Telemetry::FieldType::Session, "Init_Time", init_time); | 92 | AddField(Telemetry::FieldType::Session, "Init_Time", init_time); |
| 91 | std::string program_name; | 93 | |
| 92 | const Loader::ResultStatus res{System::GetInstance().GetAppLoader().ReadTitle(program_name)}; | 94 | u64 program_id{}; |
| 95 | const Loader::ResultStatus res{System::GetInstance().GetAppLoader().ReadProgramId(program_id)}; | ||
| 93 | if (res == Loader::ResultStatus::Success) { | 96 | if (res == Loader::ResultStatus::Success) { |
| 94 | AddField(Telemetry::FieldType::Session, "ProgramName", program_name); | 97 | AddField(Telemetry::FieldType::Session, "ProgramId", program_id); |
| 98 | |||
| 99 | std::string name; | ||
| 100 | System::GetInstance().GetAppLoader().ReadTitle(name); | ||
| 101 | |||
| 102 | if (name.empty()) { | ||
| 103 | auto [nacp, icon_file] = FileSys::PatchManager(program_id).GetControlMetadata(); | ||
| 104 | if (nacp != nullptr) | ||
| 105 | name = nacp->GetApplicationName(); | ||
| 106 | } | ||
| 107 | |||
| 108 | if (!name.empty()) | ||
| 109 | AddField(Telemetry::FieldType::Session, "ProgramName", name); | ||
| 95 | } | 110 | } |
| 96 | 111 | ||
| 112 | AddField(Telemetry::FieldType::Session, "ProgramFormat", | ||
| 113 | static_cast<u8>(System::GetInstance().GetAppLoader().GetFileType())); | ||
| 114 | |||
| 97 | // Log application information | 115 | // Log application information |
| 98 | Telemetry::AppendBuildInfo(field_collection); | 116 | Telemetry::AppendBuildInfo(field_collection); |
| 99 | 117 | ||