mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-14 20:12:26 +00:00
[Rules] Fix rule updates that affected bot booting checks (#2841)
This commit is contained in:
parent
155ec9ac0d
commit
2b224d42ad
@ -476,10 +476,11 @@ bool Database::CheckDatabaseConversions() {
|
||||
CheckDatabaseConvertPPDeblob();
|
||||
CheckDatabaseConvertCorpseDeblob();
|
||||
|
||||
RuleManager::Instance()->LoadRules(this, "default", false);
|
||||
auto *r = RuleManager::Instance();
|
||||
r->LoadRules(this, "default", false);
|
||||
if (!RuleB(Bots, Enabled) && DoesTableExist("bot_data")) {
|
||||
LogInfo("Bot tables found but rule not enabled, enabling");
|
||||
RuleManager::Instance()->SetRule("Bots:Enabled", "true", this, true, true);
|
||||
r->SetRule("Bots:Enabled", "true", this, true, true);
|
||||
}
|
||||
|
||||
/* Run EQEmu Server script (Checks for database updates) */
|
||||
|
||||
@ -385,7 +385,16 @@ void RuleManager::_SaveRule(Database *db, RuleType type, uint16 index) {
|
||||
e.rule_value = rule_value;
|
||||
e.notes = rule_notes;
|
||||
|
||||
RuleValuesRepository::UpdateOne(*db, e);
|
||||
db->QueryDatabase(
|
||||
fmt::format(
|
||||
"UPDATE rule_values SET rule_value = '{}', notes = '{}' WHERE ruleset_id = {} AND rule_name = '{}'",
|
||||
rule_value,
|
||||
Strings::Escape(rule_notes),
|
||||
e.ruleset_id,
|
||||
e.rule_name
|
||||
)
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#include "../../common/version.h"
|
||||
#include "../../common/json/json.h"
|
||||
#include "../../common/rulesys.h"
|
||||
|
||||
void WorldserverCLI::DatabaseVersion(int argc, char **argv, argh::parser &cmd, std::string &description)
|
||||
{
|
||||
@ -9,13 +10,13 @@ void WorldserverCLI::DatabaseVersion(int argc, char **argv, argh::parser &cmd, s
|
||||
return;
|
||||
}
|
||||
|
||||
Json::Value database_version;
|
||||
Json::Value v;
|
||||
|
||||
database_version["database_version"] = CURRENT_BINARY_DATABASE_VERSION;
|
||||
database_version["bots_database_version"] = CURRENT_BINARY_BOTS_DATABASE_VERSION;
|
||||
v["database_version"] = CURRENT_BINARY_DATABASE_VERSION;
|
||||
v["bots_database_version"] = RuleB(Bots, Enabled) ? CURRENT_BINARY_BOTS_DATABASE_VERSION : 0;
|
||||
|
||||
std::stringstream payload;
|
||||
payload << database_version;
|
||||
payload << v;
|
||||
|
||||
std::cout << payload.str() << std::endl;
|
||||
}
|
||||
|
||||
@ -290,16 +290,16 @@ bool WorldBoot::DatabaseLoadRoutines(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (!ignore_db) {
|
||||
LogInfo("Checking Database Conversions");
|
||||
database.CheckDatabaseConversions();
|
||||
}
|
||||
|
||||
// logging system init
|
||||
auto logging = LogSys.SetDatabase(&database)
|
||||
->SetLogPath(path.GetLogPath())
|
||||
->LoadLogDatabaseSettings();
|
||||
|
||||
if (!ignore_db) {
|
||||
LogInfo("Checking Database Conversions");
|
||||
database.CheckDatabaseConversions();
|
||||
}
|
||||
|
||||
if (RuleB(Logging, WorldGMSayLogging)) {
|
||||
logging->SetGMSayHandler(&WorldBoot::GMSayHookCallBackProcessWorld);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user