From 943889d5888908d301ccbcf4705c8c7d2033bd9f Mon Sep 17 00:00:00 2001 From: Tixx <83774803+WiserTixx@users.noreply.github.com> Date: Tue, 27 May 2025 22:08:50 +0200 Subject: [PATCH 1/3] Fix mod downloading progress --- src/Network/Resources.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Network/Resources.cpp b/src/Network/Resources.cpp index 1fe99fc..2682da4 100644 --- a/src/Network/Resources.cpp +++ b/src/Network/Resources.cpp @@ -475,9 +475,10 @@ void NewSyncResources(SOCKET Sock, const std::string& Mods, const std::vectorHash.length() < 8 || ModInfoIter->HashAlgorithm != "sha256") { error("Unsupported hash algorithm or invalid hash for '" + ModInfoIter->FileName + "'"); Terminate = true; @@ -621,7 +622,6 @@ void NewSyncResources(SOCKET Sock, const std::string& Mods, const std::vector Date: Tue, 27 May 2025 22:09:52 +0200 Subject: [PATCH 2/3] Show cached mods being loaded in download progress --- src/Network/Resources.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Network/Resources.cpp b/src/Network/Resources.cpp index 2682da4..4415db2 100644 --- a/src/Network/Resources.cpp +++ b/src/Network/Resources.cpp @@ -488,6 +488,7 @@ void NewSyncResources(SOCKET Sock, const std::string& Mods, const std::vectorHash) { debug("Mod '" + FileName + "' found in cache"); + UpdateUl(false, std::to_string(ModNo) + "/" + std::to_string(TotalMods) + ": " + ModInfoIter->FileName); std::this_thread::sleep_for(std::chrono::milliseconds(50)); try { if (!fs::exists(GetGamePath() + "mods/multiplayer")) { @@ -518,6 +519,7 @@ void NewSyncResources(SOCKET Sock, const std::string& Mods, const std::vectorFileName).filename(); fs::exists(OldCachedPath) && GetSha256HashReallyFast(OldCachedPath.string()) == ModInfoIter->Hash) { debug("Mod '" + FileName + "' found in old cache, copying it to the new cache"); + UpdateUl(false, std::to_string(ModNo) + "/" + std::to_string(TotalMods) + ": " + ModInfoIter->FileName); std::this_thread::sleep_for(std::chrono::milliseconds(50)); try { fs::copy_file(OldCachedPath, PathToSaveTo, fs::copy_options::overwrite_existing); From b1ebcfc18d4808f6f9902a86641b1575044b6649 Mon Sep 17 00:00:00 2001 From: Tixx <83774803+WiserTixx@users.noreply.github.com> Date: Tue, 27 May 2025 22:12:07 +0200 Subject: [PATCH 3/3] Fix mod protection message --- src/Network/Resources.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Network/Resources.cpp b/src/Network/Resources.cpp index 4415db2..c5e0cc4 100644 --- a/src/Network/Resources.cpp +++ b/src/Network/Resources.cpp @@ -554,7 +554,7 @@ void NewSyncResources(SOCKET Sock, const std::string& Mods, const std::vectorProtected && false) { + if (ModInfoIter->Protected) { 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);