mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 02:11:30 +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();
|
||||
|
||||
for (auto &flag: flags) {
|
||||
flag = "'" + flag + "'";
|
||||
}
|
||||
|
||||
std::string flags_in_filter;
|
||||
std::string flags_in_filter;
|
||||
if (!flags.empty()) {
|
||||
flags_in_filter = fmt::format(
|
||||
" OR {}content_flags IN ({})",
|
||||
" OR CONCAT(',', {}content_flags, ',') REGEXP ',({}),' ",
|
||||
table_prefix,
|
||||
implode(", ", flags)
|
||||
implode("|", flags)
|
||||
);
|
||||
}
|
||||
|
||||
criteria += fmt::format(
|
||||
" AND ({}content_flags IS NULL{})",
|
||||
" AND ({}content_flags IS NULL{}) ",
|
||||
table_prefix,
|
||||
flags_in_filter
|
||||
);
|
||||
|
||||
@ -417,7 +417,7 @@ int main(int argc, char** argv) {
|
||||
set_content_flags.push_back(flags.flag_name);
|
||||
|
||||
LogInfo(
|
||||
"Enabling content-flag [{}]",
|
||||
"Enabled content flag [{}]",
|
||||
flags.flag_name
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user