Various fixes. Note: This contains debug stuff which will be removed later. I was getting tired of having to cherrypick tiny changes
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
#include "impl/ncm_content_manager.hpp"
|
||||
#include "lr_contentlocationresolver.hpp"
|
||||
|
||||
#include "debug.hpp"
|
||||
|
||||
namespace sts::lr {
|
||||
|
||||
ContentLocationResolverInterface::~ContentLocationResolverInterface() {
|
||||
@@ -28,6 +30,7 @@ namespace sts::lr {
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::ResolveProgramPath(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
R_DEBUG_START
|
||||
Path path;
|
||||
|
||||
if (this->program_redirector.FindRedirection(&path, tid)) {
|
||||
@@ -46,14 +49,18 @@ namespace sts::lr {
|
||||
R_ASSERT(this->content_storage->GetPath(&path, program_content_id));
|
||||
*out.pointer = path;
|
||||
return ResultSuccess;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::RedirectProgramPath(InPointer<const Path> path, ncm::TitleId tid) {
|
||||
R_DEBUG_START
|
||||
this->program_redirector.SetRedirection(tid, *path.pointer);
|
||||
return ResultSuccess;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::ResolveApplicationControlPath(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
R_DEBUG_START
|
||||
Path path;
|
||||
|
||||
if (this->app_control_redirector.FindRedirection(&path, tid)) {
|
||||
@@ -62,9 +69,11 @@ namespace sts::lr {
|
||||
}
|
||||
|
||||
return ResultLrControlNotFound;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::ResolveApplicationHtmlDocumentPath(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
R_DEBUG_START
|
||||
Path path;
|
||||
|
||||
if (this->html_docs_redirector.FindRedirection(&path, tid)) {
|
||||
@@ -73,9 +82,11 @@ namespace sts::lr {
|
||||
}
|
||||
|
||||
return ResultLrHtmlDocumentNotFound;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::ResolveDataPath(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
R_DEBUG_START
|
||||
Path path;
|
||||
ncm::ContentId data_content_id;
|
||||
|
||||
@@ -83,19 +94,25 @@ namespace sts::lr {
|
||||
R_ASSERT(this->content_storage->GetPath(&path, data_content_id));
|
||||
*out.pointer = path;
|
||||
return ResultSuccess;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::RedirectApplicationControlPath(InPointer<const Path> path, ncm::TitleId tid) {
|
||||
R_DEBUG_START
|
||||
this->app_control_redirector.SetRedirection(tid, *path.pointer, impl::RedirectionFlags_Application);
|
||||
return ResultSuccess;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::RedirectApplicationHtmlDocumentPath(InPointer<const Path> path, ncm::TitleId tid) {
|
||||
R_DEBUG_START
|
||||
this->html_docs_redirector.SetRedirection(tid, *path.pointer, impl::RedirectionFlags_Application);
|
||||
return ResultSuccess;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::ResolveApplicationLegalInformationPath(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
R_DEBUG_START
|
||||
Path path;
|
||||
|
||||
if (this->legal_info_redirector.FindRedirection(&path, tid)) {
|
||||
@@ -104,14 +121,18 @@ namespace sts::lr {
|
||||
}
|
||||
|
||||
return ResultLrLegalInformationNotFound;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::RedirectApplicationLegalInformationPath(InPointer<const Path> path, ncm::TitleId tid) {
|
||||
R_DEBUG_START
|
||||
this->legal_info_redirector.SetRedirection(tid, *path.pointer, impl::RedirectionFlags_Application);
|
||||
return ResultSuccess;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::Refresh() {
|
||||
R_DEBUG_START
|
||||
std::shared_ptr<ncm::IContentMetaDatabase> content_meta_database;
|
||||
std::shared_ptr<ncm::IContentStorage> content_storage;
|
||||
R_TRY(ncm::impl::OpenContentMetaDatabase(&content_meta_database, this->storage_id));
|
||||
@@ -126,43 +147,57 @@ namespace sts::lr {
|
||||
this->legal_info_redirector.ClearRedirections();
|
||||
|
||||
return ResultSuccess;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::RedirectApplicationProgramPath(InPointer<const Path> path, ncm::TitleId tid) {
|
||||
R_DEBUG_START
|
||||
this->program_redirector.SetRedirection(tid, *path.pointer, impl::RedirectionFlags_Application);
|
||||
return ResultSuccess;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::ClearApplicationRedirection() {
|
||||
R_DEBUG_START
|
||||
this->program_redirector.ClearRedirections(impl::RedirectionFlags_Application);
|
||||
this->debug_program_redirector.ClearRedirections(impl::RedirectionFlags_Application);
|
||||
this->app_control_redirector.ClearRedirections(impl::RedirectionFlags_Application);
|
||||
this->html_docs_redirector.ClearRedirections(impl::RedirectionFlags_Application);
|
||||
this->legal_info_redirector.ClearRedirections(impl::RedirectionFlags_Application);
|
||||
return ResultSuccess;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::EraseProgramRedirection(ncm::TitleId tid) {
|
||||
R_DEBUG_START
|
||||
this->program_redirector.EraseRedirection(tid);
|
||||
return ResultSuccess;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::EraseApplicationControlRedirection(ncm::TitleId tid) {
|
||||
R_DEBUG_START
|
||||
this->app_control_redirector.EraseRedirection(tid);
|
||||
return ResultSuccess;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::EraseApplicationHtmlDocumentRedirection(ncm::TitleId tid) {
|
||||
R_DEBUG_START
|
||||
this->html_docs_redirector.EraseRedirection(tid);
|
||||
return ResultSuccess;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::EraseApplicationLegalInformationRedirection(ncm::TitleId tid) {
|
||||
R_DEBUG_START
|
||||
this->legal_info_redirector.EraseRedirection(tid);
|
||||
return ResultSuccess;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::ResolveProgramPathForDebug(OutPointerWithServerSize<Path, 0x1> out, ncm::TitleId tid) {
|
||||
R_DEBUG_START
|
||||
Path path;
|
||||
|
||||
if (this->debug_program_redirector.FindRedirection(&path, tid)) {
|
||||
@@ -178,21 +213,28 @@ namespace sts::lr {
|
||||
|
||||
*out.pointer = path;
|
||||
return ResultSuccess;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::RedirectProgramPathForDebug(InPointer<const Path> path, ncm::TitleId tid) {
|
||||
R_DEBUG_START
|
||||
this->debug_program_redirector.SetRedirection(tid, *path.pointer);
|
||||
return ResultSuccess;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::RedirectApplicationProgramPathForDebug(InPointer<const Path> path, ncm::TitleId tid) {
|
||||
R_DEBUG_START
|
||||
this->debug_program_redirector.SetRedirection(tid, *path.pointer, impl::RedirectionFlags_Application);
|
||||
return ResultSuccess;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
Result ContentLocationResolverInterface::EraseProgramRedirectionForDebug(ncm::TitleId tid) {
|
||||
R_DEBUG_START
|
||||
this->debug_program_redirector.EraseRedirection(tid);
|
||||
return ResultSuccess;
|
||||
R_DEBUG_END
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user