[Quests] Hot Reload Changes (#4302)

* [Quests] Hot Reload Changes

* snake_case
This commit is contained in:
Chris Miles 2024-05-09 00:51:43 -05:00 committed by GitHub
parent fe136e58e4
commit 257935d33a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 9 deletions

View File

@ -918,6 +918,8 @@ void ConsoleReloadWorld(
safe_delete(pack); safe_delete(pack);
} }
auto debounce_reload = std::chrono::system_clock::now();
/** /**
* @param connection * @param connection
* @param command * @param command
@ -934,6 +936,14 @@ void ConsoleReloadZoneQuests(
return; return;
} }
// if now is within 1 second, return
if (std::chrono::system_clock::now() - debounce_reload < std::chrono::seconds(1)) {
debounce_reload = std::chrono::system_clock::now();
return;
}
debounce_reload = std::chrono::system_clock::now();
std::string zone_short_name = args[0]; std::string zone_short_name = args[0];
connection->SendLine(fmt::format("Reloading Zone [{}]...", zone_short_name)); connection->SendLine(fmt::format("Reloading Zone [{}]...", zone_short_name));

View File

@ -3550,18 +3550,18 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
zone->SetQuestHotReloadQueued(true); zone->SetQuestHotReloadQueued(true);
} else if (request_zone_short_name == "all") { } else if (request_zone_short_name == "all") {
std::string reload_quest_saylink = Saylink::Silent("#reload quest", "Locally"); std::string reload_quest_saylink = Saylink::Silent("#reload quest", "Locally");
std::string reload_world_saylink = Saylink::Silent("#reload world", "Globally"); std::string reload_world_saylink = Saylink::Silent("#reload world 1", "Globally");
worldserver.SendEmoteMessage( for (const auto& [client_id, client] : entity_list.GetClientList()) {
0, if (client->Admin() < AccountStatus::ApprenticeGuide) {
0, continue;
AccountStatus::ApprenticeGuide, }
Chat::Yellow,
fmt::format( client->Message(Chat::Yellow, fmt::format(
"A quest, plugin, or global script has changed. Reload: [{}] [{}]", "A quest, plugin, or global script has changed. Reload: [{}] [{}]",
reload_quest_saylink, reload_quest_saylink,
reload_world_saylink reload_world_saylink
).c_str() ).c_str());
); }
} }
break; break;
} }