add ui_scripts into dedi ignore

This commit is contained in:
quaK 2024-07-17 02:01:40 +03:00
parent 36b61b4323
commit 08cdeaf95b

View File

@ -31,22 +31,37 @@ namespace updater
{ {
std::vector<std::string> dedi_ignore = std::vector<std::string> dedi_ignore =
{ {
"ui_scripts/*",
"zone/iw7mod_ui_mp.ff", "zone/iw7mod_ui_mp.ff",
}; };
bool is_dedi_ignore_file(const std::string& name) bool is_dedi_ignore_file(const std::string& name)
{ {
const auto cdata_path = CLIENT_DATA_FOLDER + "/"s;
for (auto& ignore_file : dedi_ignore) for (auto& ignore_file : dedi_ignore)
{ {
if (name == CLIENT_DATA_FOLDER + "/"s + ignore_file) if (name == cdata_path + ignore_file)
{ {
return true; return true;
} }
if (ignore_file.ends_with('*'))
{
std::string ignore_prefix = ignore_file.substr(0, ignore_file.size() - 1); // Remove the last character
if (name.starts_with(cdata_path + ignore_prefix))
{
return true;
}
}
} }
return false; return false;
} }
}
namespace
{
constexpr auto override_cache = true; constexpr auto override_cache = true;
struct file_data struct file_data