updater ignore file change

This commit is contained in:
quaK 2024-08-05 02:48:35 +03:00
parent 496537d7b6
commit 66c3626e77

View File

@ -35,16 +35,19 @@ namespace updater
"zone/iw7mod_ui_mp.ff", "zone/iw7mod_ui_mp.ff",
}; };
bool is_dedi_ignore_file(const std::string& name) std::vector<std::string> client_ignore =
{ {
if (!game::environment::is_dedi()) "sounddata/*",
};
bool is_ignore_file(const std::string& name)
{ {
return false; const auto is_dedi = game::environment::is_dedi();
}
const auto cdata_path = CLIENT_DATA_FOLDER + "/"s; const auto cdata_path = CLIENT_DATA_FOLDER + "/"s;
for (auto& ignore_file : dedi_ignore) const auto& ignore_files = is_dedi ? dedi_ignore : client_ignore;
for (auto& ignore_file : ignore_files)
{ {
if (name == cdata_path + ignore_file) if (name == cdata_path + ignore_file)
{ {
@ -289,7 +292,7 @@ namespace updater
const auto name = file[0].GetString(); const auto name = file[0].GetString();
const auto sha = file[2].GetString(); const auto sha = file[2].GetString();
if (is_dedi_ignore_file(name)) if (is_ignore_file(name))
{ {
continue; continue;
} }
@ -364,7 +367,7 @@ namespace updater
} }
const auto file_ = std::string(file.begin() + appdata_folder.generic_string().size() + 1, file.end()); const auto file_ = std::string(file.begin() + appdata_folder.generic_string().size() + 1, file.end());
if (!found && std::filesystem::is_regular_file(file) && !is_dedi_ignore_file(file_)) if (!found && std::filesystem::is_regular_file(file) && !is_ignore_file(file_))
{ {
console::info("[Updater] Deleting extra file %s\n", file.data()); console::info("[Updater] Deleting extra file %s\n", file.data());
utils::io::remove_file(file); utils::io::remove_file(file);