From dc788834518891d9037d350170129ff7a670306c Mon Sep 17 00:00:00 2001 From: Tixx <83774803+WiserTixx@users.noreply.github.com> Date: Tue, 1 Apr 2025 09:09:49 +0200 Subject: [PATCH] Notify user about missing protected mods --- src/Network/Resources.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Network/Resources.cpp b/src/Network/Resources.cpp index 99c75b3..a025063 100644 --- a/src/Network/Resources.cpp +++ b/src/Network/Resources.cpp @@ -380,6 +380,11 @@ struct ModInfo { .Hash = entry["hash"], .HashAlgorithm = entry["hash_algorithm"], }; + + if (entry.contains("protected")) { + modInfo.Protected = entry["protected"]; + } + modInfos.push_back(modInfo); success = true; } @@ -393,6 +398,7 @@ struct ModInfo { size_t FileSize; std::string Hash; std::string HashAlgorithm; + bool Protected = false; }; nlohmann::json modUsage = {}; @@ -544,6 +550,16 @@ void NewSyncResources(SOCKET Sock, const std::string& Mods, const std::vectorProtected && 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(); std::string FName = ModInfoIter->FileName; do {