mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-06 17:43:52 +00:00
Add more rule-driven behavior
This commit is contained in:
parent
158d8a011f
commit
c8e6d031cf
@ -762,6 +762,12 @@ RULE_CATEGORY(Logging)
|
|||||||
RULE_BOOL(Logging, PrintFileFunctionAndLine, false, "Ex: [World Server] [net.cpp::main:309] Loading variables...")
|
RULE_BOOL(Logging, PrintFileFunctionAndLine, false, "Ex: [World Server] [net.cpp::main:309] Loading variables...")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
|
RULE_CATEGORY(HotReload)
|
||||||
|
RULE_BOOL(HotReload, QuestsRepopWithReload, true, "When a hot reload is triggered, the zone will repop")
|
||||||
|
RULE_BOOL(HotReload, QuestsRepopWhenPlayersNotInCombat, true, "When a hot reload is triggered, the zone will repop when no clients are in combat")
|
||||||
|
RULE_BOOL(HotReload, QuestsResetTimersWithReload, true, "When a hot reload is triggered, the zone will repop")
|
||||||
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
#undef RULE_CATEGORY
|
#undef RULE_CATEGORY
|
||||||
#undef RULE_INT
|
#undef RULE_INT
|
||||||
#undef RULE_REAL
|
#undef RULE_REAL
|
||||||
|
|||||||
@ -925,7 +925,7 @@ void RegisterConsoleFunctions(std::unique_ptr<EQ::Net::ConsoleServer>& console)
|
|||||||
console->RegisterCall("signalcharbyname", 50, "signalcharbyname charname ID", std::bind(ConsoleSignalCharByName, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
console->RegisterCall("signalcharbyname", 50, "signalcharbyname charname ID", std::bind(ConsoleSignalCharByName, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||||
console->RegisterCall("tell", 50, "tell [name] [message]", std::bind(ConsoleTell, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
console->RegisterCall("tell", 50, "tell [name] [message]", std::bind(ConsoleTell, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||||
console->RegisterCall("unlock", 150, "unlock", std::bind(ConsoleUnlock, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
console->RegisterCall("unlock", 150, "unlock", std::bind(ConsoleUnlock, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||||
console->RegisterCall("uptime", 50, "uptime [zoneID#]", std::bind(ConsoleUptime, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
console->RegisterCall("uptime", 50, "uptime [zone_server_id]", std::bind(ConsoleUptime, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||||
console->RegisterCall("version", 50, "version", std::bind(ConsoleVersion, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
console->RegisterCall("version", 50, "version", std::bind(ConsoleVersion, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||||
console->RegisterCall("who", 50, "who", std::bind(ConsoleWho, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
console->RegisterCall("who", 50, "who", std::bind(ConsoleWho, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||||
console->RegisterCall("whoami", 50, "whoami", std::bind(ConsoleWhoami, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
console->RegisterCall("whoami", 50, "whoami", std::bind(ConsoleWhoami, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
|
||||||
|
|||||||
@ -1239,11 +1239,14 @@ bool Zone::Process() {
|
|||||||
LogHotReloadDetail("Hot reload timer check...");
|
LogHotReloadDetail("Hot reload timer check...");
|
||||||
|
|
||||||
bool perform_reload = true;
|
bool perform_reload = true;
|
||||||
for (auto &it : entity_list.GetClientList()) {
|
|
||||||
auto client = it.second;
|
if (RuleB(HotReload, QuestsRepopWhenPlayersNotInCombat)) {
|
||||||
if (client->GetAggroCount() > 0) {
|
for (auto &it : entity_list.GetClientList()) {
|
||||||
perform_reload = false;
|
auto client = it.second;
|
||||||
break;
|
if (client->GetAggroCount() > 0) {
|
||||||
|
perform_reload = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -27,9 +27,20 @@ void ZoneReload::HotReloadQuests()
|
|||||||
timer.reset();
|
timer.reset();
|
||||||
|
|
||||||
entity_list.ClearAreas();
|
entity_list.ClearAreas();
|
||||||
parse->ReloadQuests();
|
|
||||||
zone->Repop(0);
|
parse->ReloadQuests(RuleB(HotReload, QuestsResetTimersWithReload));
|
||||||
|
|
||||||
|
if (RuleB(HotReload, QuestsRepopWithReload)) {
|
||||||
|
zone->Repop(0);
|
||||||
|
}
|
||||||
zone->SetQuestHotReloadQueued(false);
|
zone->SetQuestHotReloadQueued(false);
|
||||||
|
|
||||||
LogHotReload("[Quests] Reloading scripts in zone [{}] Time [{:.2f}]", zone->GetShortName(), timer.elapsed());
|
LogHotReload(
|
||||||
|
"[Quests] Reloading scripts in zone [{}] repop_with_reload [{}] reset_timers [{}] when_not_in_combat [{}] Time [{:.4f}]",
|
||||||
|
zone->GetShortName(),
|
||||||
|
(RuleB(HotReload, QuestsRepopWithReload) ? "true" : "false"),
|
||||||
|
(RuleB(HotReload, QuestsResetTimersWithReload) ? "true" : "false"),
|
||||||
|
(RuleB(HotReload, QuestsRepopWhenPlayersNotInCombat) ? "true" : "false"),
|
||||||
|
timer.elapsed()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user