Conversation
fe98759 to
a688903
Compare
|
It looks like the This may still be the better approach overall but I need to be sure that it will not make things worse for Windows users. |
BenjaminAmos
left a comment
There was a problem hiding this comment.
At a cursory glance, these changes appear to break several existing workflows, especially those using a different home directory.
engine/src/main/java/org/terasology/engine/core/PathManager.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/terasology/engine/core/PathManager.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/terasology/engine/core/PathManager.java
Outdated
Show resolved
Hide resolved
engine/src/main/java/org/terasology/engine/core/PathManager.java
Outdated
Show resolved
Hide resolved
| private PathManager() { | ||
| installPath = findInstallPath(); | ||
| homePath = installPath; | ||
| homePath = PROJECT_PATH; |
There was a problem hiding this comment.
| homePath = PROJECT_PATH; | |
| homePath = installPath; |
findInstallPath() provides a fallback path for unusual scenarios that I think we should keep. Defaulting to the current directory is normal for development anyway, I think. You can default to PROJECT_PATH in findInstallPath if needed.
There was a problem hiding this comment.
returning projectpath in a function called findinstallpath i thought is too much :) but let me digest your suggestion ...
| } else { | ||
| PathManager.getInstance().useDefaultHomePath(); | ||
| } | ||
| PathManager.getInstance().useDefaultHomePath(); |
There was a problem hiding this comment.
This should not have been removed. Having the ability to override the game's home directory is important for testing with multiple clients.
There was a problem hiding this comment.
how is this test done, or in other words, why setting XDG environment variables is not good enough?
| logPath = homePath.resolve(LOG_DIR); | ||
| shaderLogPath = logPath.resolve(SHADER_LOG_DIR); | ||
| logPath = Paths.get(LOG_DIR); | ||
| shaderLogPath = Paths.get(SHADER_LOG_DIR); |
There was a problem hiding this comment.
Why are logPath and shaderLogPath absolute paths when all the other paths are relative to the home directory?
There was a problem hiding this comment.
Why are
logPathandshaderLogPathabsolute paths when all the other paths are relative to the home directory?
the reason why i like the new appdir / xdg / macos directory structure so much is that one can properly separate stuff which should be in a backup and what not. config i want to backup. shared data as well. local data not, but depends on the use case. cache and logs i never want a backup. coming back to your question: i did not see any harm at the moment to leave e.g. config in homedirectory, even it is not xdg compliant.
i share your concern, and put a comment on dirs-dev/directories-jvm#61, am thinking that one could make a pull request towards that library even ... and, i left a rant at microsofts openjdk, which i am less fond of: microsoft/openjdk#628. |
the library works according to the XDG standard, and offers translations for linux, macosx, windows. see for details: https://github.com/dirs-dev/directories-jvm fixes #5281. Co-authored-by: BenjaminAmos <24301287+BenjaminAmos@users.noreply.github.com>
| shaderLogPath = Paths.get(SHADER_LOG_DIR); | ||
| screenshotPath = homePath.resolve(SCREENSHOT_DIR); | ||
| nativesPath = installPath.resolve(NATIVES_DIR); | ||
| configsPath = homePath.resolve(CONFIGS_DIR); |
There was a problem hiding this comment.
| configsPath = homePath.resolve(CONFIGS_DIR); | |
| configsPath = Paths.get(CONFIGS_DIR); |
| private static final String MODULE_CACHE_DIR = PROJECT_DIRS.cacheDir + "/cachedModules"; | ||
| private static final String SCREENSHOT_DIR = "screenshots"; | ||
| private static final String NATIVES_DIR = "natives"; | ||
| private static final String CONFIGS_DIR = "configs"; |
There was a problem hiding this comment.
| private static final String CONFIGS_DIR = "configs"; | |
| private static final String CONFIGS_DIR = PROJECT_DIRS.configDir; |
the library works according to the XDG standard, and offers translations for linux, macosx, windows. see for details:
https://github.com/dirs-dev/directories-jvm
so ...