link resources path from config

This commit is contained in:
Anonymous275 2022-08-19 16:23:20 +03:00
parent 70099af7c7
commit 65ce374f3c
3 changed files with 6 additions and 1 deletions

View File

@ -44,6 +44,7 @@ class Launcher {
static void setExit(bool exit) noexcept; static void setExit(bool exit) noexcept;
const std::string& getFullVersion(); const std::string& getFullVersion();
const std::string& getMPUserPath(); const std::string& getMPUserPath();
const std::string& getCachePath();
static bool Terminated() noexcept; static bool Terminated() noexcept;
const std::string& getPublicKey(); const std::string& getPublicKey();
const std::string& getUserRole(); const std::string& getUserRole();

View File

@ -215,3 +215,7 @@ const std::string& Launcher::getMPUserPath() {
const std::string& Launcher::getPublicKey() { const std::string& Launcher::getPublicKey() {
return PublicKey; return PublicKey;
} }
const std::string& Launcher::getCachePath() {
return LauncherCache;
}

View File

@ -255,7 +255,7 @@ void Server::SyncResources() {
FN != FNames.end() && !Terminate; ++FN, ++FS) { FN != FNames.end() && !Terminate; ++FN, ++FS) {
auto pos = FN->find_last_of('/'); auto pos = FN->find_last_of('/');
if (pos != std::string::npos) { if (pos != std::string::npos) {
a = "Resources" + FN->substr(pos); a = LauncherInstance->getCachePath() + FN->substr(pos);
} else continue; } else continue;
Pos++; Pos++;
if (fs::exists(a)) { if (fs::exists(a)) {