mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 08:21:28 +00:00
Tweak content flag filtering [skip ci]
This commit is contained in:
parent
56c4eb280f
commit
e474df2b12
@ -54,22 +54,17 @@ namespace ContentFilterCriteria {
|
|||||||
);
|
);
|
||||||
|
|
||||||
std::vector<std::string> flags = content_service.GetContentFlags();
|
std::vector<std::string> flags = content_service.GetContentFlags();
|
||||||
|
std::string flags_in_filter;
|
||||||
for (auto &flag: flags) {
|
|
||||||
flag = "'" + flag + "'";
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string flags_in_filter;
|
|
||||||
if (!flags.empty()) {
|
if (!flags.empty()) {
|
||||||
flags_in_filter = fmt::format(
|
flags_in_filter = fmt::format(
|
||||||
" OR {}content_flags IN ({})",
|
" OR CONCAT(',', {}content_flags, ',') REGEXP ',({}),' ",
|
||||||
table_prefix,
|
table_prefix,
|
||||||
implode(", ", flags)
|
implode("|", flags)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
criteria += fmt::format(
|
criteria += fmt::format(
|
||||||
" AND ({}content_flags IS NULL{})",
|
" AND ({}content_flags IS NULL{}) ",
|
||||||
table_prefix,
|
table_prefix,
|
||||||
flags_in_filter
|
flags_in_filter
|
||||||
);
|
);
|
||||||
|
|||||||
@ -417,7 +417,7 @@ int main(int argc, char** argv) {
|
|||||||
set_content_flags.push_back(flags.flag_name);
|
set_content_flags.push_back(flags.flag_name);
|
||||||
|
|
||||||
LogInfo(
|
LogInfo(
|
||||||
"Enabling content-flag [{}]",
|
"Enabled content flag [{}]",
|
||||||
flags.flag_name
|
flags.flag_name
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user