mirror of
https://github.com/wiiu-env/ContentRedirectionModule.git
synced 2024-09-29 11:38:50 +02:00
Add support for FS_LAYER_TYPE_SAVE_REPLACE_FOR_CURRENT_USER
This commit is contained in:
parent
d0dfbd6d4e
commit
835881abfa
@ -2,6 +2,6 @@ FROM ghcr.io/wiiu-env/devkitppc:20240423
|
||||
|
||||
COPY --from=ghcr.io/wiiu-env/libfunctionpatcher:20230621 /artifacts $DEVKITPRO
|
||||
COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:20240424 /artifacts $DEVKITPRO
|
||||
COPY --from=ghcr.io/wiiu-env/libcontentredirection:20240424 /artifacts $DEVKITPRO
|
||||
COPY --from=ghcr.io/wiiu-env/libcontentredirection:20240428 /artifacts $DEVKITPRO
|
||||
|
||||
WORKDIR project
|
||||
|
@ -3,11 +3,13 @@
|
||||
#include "FileUtils.h"
|
||||
#include "IFSWrapper.h"
|
||||
#include "malloc.h"
|
||||
#include "utils/StringTools.h"
|
||||
#include "utils/logger.h"
|
||||
#include "utils/utils.h"
|
||||
#include <content_redirection/redirection.h>
|
||||
#include <coreinit/dynload.h>
|
||||
#include <mutex>
|
||||
#include <nn/act.h>
|
||||
#include <wums/exports.h>
|
||||
|
||||
struct AOCTitle {
|
||||
@ -115,6 +117,15 @@ ContentRedirectionApiErrorType CRAddFSLayer(CRLayerHandle *handle, const char *l
|
||||
} else if (layerType == FS_LAYER_TYPE_SAVE_REPLACE) {
|
||||
DEBUG_FUNCTION_LINE_INFO("Redirecting \"/vol/save\" to \"%s\", mode: \"replace\"", replacementDir);
|
||||
ptr = make_unique_nothrow<FSWrapper>(layerName, "/vol/save", replacementDir, false, true);
|
||||
} else if (layerType == FS_LAYER_TYPE_SAVE_REPLACE_FOR_CURRENT_USER) {
|
||||
nn::act::Initialize();
|
||||
nn::act::PersistentId persistentId = nn::act::GetPersistentId();
|
||||
nn::act::Finalize();
|
||||
|
||||
std::string user = string_format("/vol/save/%08X", 0x80000000 | persistentId);
|
||||
|
||||
DEBUG_FUNCTION_LINE_INFO("Redirecting \"%s\" to \"%s\", mode: \"replace\"", user.c_str(), replacementDir);
|
||||
ptr = make_unique_nothrow<FSWrapper>(layerName, user, replacementDir, false, true);
|
||||
} else {
|
||||
DEBUG_FUNCTION_LINE_ERR("CONTENT_REDIRECTION_API_ERROR_UNKNOWN_LAYER_DIR_TYPE: %s %s %d", layerName, replacementDir, layerType);
|
||||
return CONTENT_REDIRECTION_API_ERROR_UNKNOWN_FS_LAYER_TYPE;
|
||||
|
Loading…
Reference in New Issue
Block a user