mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-29 12:47:54 +00:00
[Expansion] Content Filtering Adjustments (#1910)
* Change default expansion values for ALL to -1 from 0 * Adjust content_filter_criteria * Refactor content filtering logic * Allow flag strings to also just be empty instead of null * Formatting * Editor oops
This commit is contained in:
@@ -160,41 +160,3 @@ ZoneRepository::Zone ZoneStore::GetZone(const char *in_zone_name)
|
||||
|
||||
return ZoneRepository::Zone();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
void ZoneStore::LoadContentFlags()
|
||||
{
|
||||
content_service.ReloadContentFlags(database);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value in the database and proceeds to load content flags into the server context again
|
||||
*
|
||||
* @param content_flag_name
|
||||
* @param enabled
|
||||
*/
|
||||
void ZoneStore::SetContentFlag(const std::string &content_flag_name, bool enabled)
|
||||
{
|
||||
auto content_flags = ContentFlagsRepository::GetWhere(database,
|
||||
fmt::format("flag_name = '{}'", content_flag_name)
|
||||
);
|
||||
|
||||
auto content_flag = ContentFlagsRepository::NewEntity();
|
||||
if (!content_flags.empty()) {
|
||||
content_flag = content_flags.front();
|
||||
}
|
||||
|
||||
content_flag.enabled = enabled ? 1 : 0;
|
||||
content_flag.flag_name = content_flag_name;
|
||||
|
||||
if (!content_flags.empty()) {
|
||||
ContentFlagsRepository::UpdateOne(database, content_flag);
|
||||
}
|
||||
else {
|
||||
ContentFlagsRepository::InsertOne(database, content_flag);
|
||||
}
|
||||
|
||||
LoadContentFlags();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user