mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-27 04:07:39 +00:00
[Rules] Auto Update Rule Notes from Source
This commit is contained in:
@@ -502,6 +502,18 @@ bool RuleManager::UpdateInjectedRules(Database *db, const std::string &rule_set_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update rules in the database where the description is different
|
||||||
|
for (const auto &e : RuleValuesRepository::All(*db)) {
|
||||||
|
auto i = rule_data.find(e.rule_name);
|
||||||
|
if (i != rule_data.end()) {
|
||||||
|
// if notes are different, update them
|
||||||
|
if (i->second.second != nullptr && !Strings::EqualFold(*i->second.second, e.notes)) {
|
||||||
|
LogInfo("Updating rule [{}] notes to [{}]", i->first, *i->second.second);
|
||||||
|
RuleValuesRepository::ReplaceOne(*db, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (injected_rule_entries.size()) {
|
if (injected_rule_entries.size()) {
|
||||||
if (!RuleValuesRepository::InjectRules(*db, injected_rule_entries)) {
|
if (!RuleValuesRepository::InjectRules(*db, injected_rule_entries)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user