Compare commits
5 Commits
12e102a4a7
...
0d5bf8c78f
Author | SHA1 | Date |
---|---|---|
Maschell | 0d5bf8c78f | |
Maschell | 9d0dbda1db | |
Maschell | 75854a05e5 | |
dependabot[bot] | 6c2748569d | |
Maschell | 71406e2044 |
|
@ -48,7 +48,7 @@ jobs:
|
|||
- name: zip artifact
|
||||
run: zip -r ${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip *.wms
|
||||
- name: Create Release
|
||||
uses: "softprops/action-gh-release@v1"
|
||||
uses: "softprops/action-gh-release@v2"
|
||||
with:
|
||||
tag_name: ${{ env.REPOSITORY_NAME }}-${{ env.DATETIME }}
|
||||
draft: false
|
||||
|
|
|
@ -8,3 +8,4 @@ build/
|
|||
cmake-build-debug/
|
||||
CMakeLists.txt
|
||||
*.wms
|
||||
*.zip
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
FROM ghcr.io/wiiu-env/devkitppc:20231112
|
||||
FROM ghcr.io/wiiu-env/devkitppc:20240423
|
||||
|
||||
COPY --from=ghcr.io/wiiu-env/libfunctionpatcher:20230621 /artifacts $DEVKITPRO
|
||||
COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:20230719 /artifacts $DEVKITPRO
|
||||
COPY --from=ghcr.io/wiiu-env/libcontentredirection:20230621 /artifacts $DEVKITPRO
|
||||
COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:20240424 /artifacts $DEVKITPRO
|
||||
COPY --from=ghcr.io/wiiu-env/libcontentredirection:20240424 /artifacts $DEVKITPRO
|
||||
|
||||
WORKDIR project
|
||||
|
|
|
@ -670,7 +670,15 @@ bool FSWrapper::IsFileModeAllowed(const char *mode) {
|
|||
}
|
||||
|
||||
bool FSWrapper::IsPathToReplace(const std::string_view &path) {
|
||||
return path.starts_with(pPathToReplace);
|
||||
if (!path.starts_with(pPathToReplace)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (std::ranges::any_of(pIgnorePaths.cbegin(), pIgnorePaths.cend(), [&path](auto &ignorePath) { return path.starts_with(ignorePath); })) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string FSWrapper::GetNewPath(const std::string_view &path) {
|
||||
|
|
|
@ -10,16 +10,20 @@
|
|||
|
||||
class FSWrapper : public IFSWrapper {
|
||||
public:
|
||||
FSWrapper(const std::string &name, const std::string &pathToReplace, const std::string &replacePathWith, bool fallbackOnError, bool isWriteable) {
|
||||
FSWrapper(const std::string &name, const std::string &pathToReplace, const std::string &replacePathWith, bool fallbackOnError, bool isWriteable, std::vector<std::string> ignorePaths = {}) {
|
||||
this->pName = name;
|
||||
this->pPathToReplace = pathToReplace;
|
||||
this->pReplacePathWith = replacePathWith;
|
||||
this->pFallbackOnError = fallbackOnError;
|
||||
this->pIsWriteable = isWriteable;
|
||||
this->pCheckIfDeleted = fallbackOnError;
|
||||
this->pIgnorePaths = std::move(ignorePaths);
|
||||
|
||||
std::replace(pPathToReplace.begin(), pPathToReplace.end(), '\\', '/');
|
||||
std::replace(pReplacePathWith.begin(), pReplacePathWith.end(), '\\', '/');
|
||||
for (auto &ignorePath : pIgnorePaths) {
|
||||
std::replace(ignorePath.begin(), ignorePath.end(), '\\', '/');
|
||||
}
|
||||
}
|
||||
~FSWrapper() override {
|
||||
{
|
||||
|
@ -129,6 +133,7 @@ protected:
|
|||
private:
|
||||
std::string pPathToReplace;
|
||||
std::string pReplacePathWith;
|
||||
std::vector<std::string> pIgnorePaths;
|
||||
bool pIsWriteable = false;
|
||||
std::mutex openFilesMutex;
|
||||
std::mutex openDirsMutex;
|
||||
|
|
|
@ -115,6 +115,10 @@ 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_IGNORE_VOL_SAVE_COMMON) {
|
||||
DEBUG_FUNCTION_LINE_INFO("Redirecting \"/vol/save\" to \"%s\", mode: \"replace\", ignore: (\"/vol/save/common\")", replacementDir);
|
||||
std::vector<std::string> ignorePaths({"/vol/save/common"});
|
||||
ptr = make_unique_nothrow<FSWrapper>(layerName, "/vol/save", replacementDir, false, true, ignorePaths);
|
||||
} 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;
|
||||
|
|
|
@ -10,7 +10,7 @@ WUMS_MODULE_EXPORT_NAME("homebrew_content_redirection");
|
|||
WUMS_USE_WUT_DEVOPTAB();
|
||||
WUMS_DEPENDS_ON(homebrew_functionpatcher);
|
||||
|
||||
#define VERSION "v0.2.5"
|
||||
#define VERSION "v0.2.6"
|
||||
|
||||
DECL_FUNCTION(void, OSCancelThread, OSThread *thread) {
|
||||
if (thread == gThreadData[0].thread || thread == gThreadData[1].thread || thread == gThreadData[2].thread) {
|
||||
|
|
Loading…
Reference in New Issue