Notify user about missing protected mods

This commit is contained in:
Tixx 2025-04-01 09:09:49 +02:00
parent fa8627a22b
commit dc78883451
No known key found for this signature in database
GPG Key ID: EC6E7A2BAABF0B8C

View File

@ -380,6 +380,11 @@ struct ModInfo {
.Hash = entry["hash"], .Hash = entry["hash"],
.HashAlgorithm = entry["hash_algorithm"], .HashAlgorithm = entry["hash_algorithm"],
}; };
if (entry.contains("protected")) {
modInfo.Protected = entry["protected"];
}
modInfos.push_back(modInfo); modInfos.push_back(modInfo);
success = true; success = true;
} }
@ -393,6 +398,7 @@ struct ModInfo {
size_t FileSize; size_t FileSize;
std::string Hash; std::string Hash;
std::string HashAlgorithm; std::string HashAlgorithm;
bool Protected = false;
}; };
nlohmann::json modUsage = {}; nlohmann::json modUsage = {};
@ -544,6 +550,16 @@ void NewSyncResources(SOCKET Sock, const std::string& Mods, const std::vector<Mo
WaitForConfirm(); WaitForConfirm();
continue; continue;
} }
if (ModInfoIter->Protected && false) {
std::string message = "Mod '" + ModInfoIter->FileName + "' is protected and therefore must be placed in the Resources/Caching folder manually here: " + fs::absolute(CachingDirectory).string();
error(message);
UUl(message);
Terminate = true;
return;
}
CheckForDir(); CheckForDir();
std::string FName = ModInfoIter->FileName; std::string FName = ModInfoIter->FileName;
do { do {