Add mod hash caching and mod protection

This commit is contained in:
Tixx
2025-03-31 08:04:15 +02:00
parent 6c3174ac08
commit 7a439bb5b9
3 changed files with 63 additions and 0 deletions
+5
View File
@@ -810,6 +810,11 @@ void TNetwork::SendFile(TClient& c, const std::string& UnsafeName) {
auto FileName = fs::path(UnsafeName).filename().string();
FileName = Application::Settings.getAsString(Settings::Key::General_ResourceFolder) + "/Client/" + FileName;
for (auto mod : mResourceManager.GetMods()) {
if (mod["filename"] == FileName && mod["protected"] == true)
return;
}
if (!std::filesystem::exists(FileName)) {
if (!TCPSend(c, StringToVector("CO"))) {
// TODO: handle