add CachingDirectory config setting to cache mods elsewhere

also moved cls/clear to the beginning, idk wtf it was doing in there.
This commit is contained in:
Lion Kortlepel
2024-09-23 22:31:58 +02:00
parent 4bedfc8e96
commit 1362471657
5 changed files with 22 additions and 16 deletions

View File

@@ -36,13 +36,8 @@
namespace fs = std::filesystem;
void CheckForDir() {
if (!fs::exists("Resources")) {
// Could we just use fs::create_directory instead?
#if defined(_WIN32)
_wmkdir(L"Resources");
#elif defined(__linux__)
fs::create_directory(L"Resources");
#endif
if (!fs::exists(CachingDirectory)) {
fs::create_directory(CachingDirectory);
}
}
void WaitForConfirm() {
@@ -297,7 +292,7 @@ void SyncResources(SOCKET Sock) {
for (auto FN = FNames.begin(), FS = FSizes.begin(); FN != FNames.end() && !Terminate; ++FN, ++FS) {
auto pos = FN->find_last_of('/');
if (pos != std::string::npos) {
PathToSaveTo = "Resources" + FN->substr(pos);
PathToSaveTo = CachingDirectory + FN->substr(pos);
} else {
continue;
}