[Commands] Cleanup #reloadmerchants Command. (#2123)

* [Commands] Cleanup #reloadmerchants Command.
- Cleanup messages and logic.
- Make the reloading of merchants global instead of zone specific.

* Update worldserver.cpp

* Update worldserver.cpp
This commit is contained in:
Kinglykrab 2022-05-06 20:48:46 -04:00 committed by GitHub
parent 7d89c05a48
commit ee86001132
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 42 additions and 3 deletions

View File

@ -228,6 +228,7 @@
#define ServerOP_UpdateSchedulerEvents 0x4012
#define ServerOP_ReloadContentFlags 0x4013
#define ServerOP_ReloadVariablesWorld 0x4014
#define ServerOP_ReloadMerchants 0x4016
#define ServerOP_ReloadStaticZoneData 0x4020
#define ServerOP_CZDialogueWindow 0x4500

View File

@ -889,6 +889,11 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
zoneserver_list.SendPacket(pack);
break;
}
case ServerOP_ReloadMerchants:
{
zoneserver_list.SendPacket(pack);
break;
}
case ServerOP_ReloadStaticZoneData:
{
zoneserver_list.SendPacket(pack);

View File

@ -292,7 +292,7 @@ int command_init(void)
command_add("reloadcontentflags", "Executes a reload of all expansion and content flags", AccountStatus::QuestTroupe, command_reloadcontentflags) ||
command_add("reloademote", "Reloads NPC Emotes", AccountStatus::QuestTroupe, command_reloademote) ||
command_add("reloadlevelmods", nullptr, AccountStatus::Max, command_reloadlevelmods) ||
command_add("reloadmerchants", nullptr, AccountStatus::Max, command_reloadmerchants) ||
command_add("reloadmerchants", "Reloads merchant lists globally", AccountStatus::Max, command_reloadmerchants) ||
command_add("reloadperlexportsettings", "Reloads Perl event export settings globally", AccountStatus::Max, command_reloadperlexportsettings) ||
command_add("reloadqst", " - Clear quest cache (any argument causes it to also stop all timers)", AccountStatus::GMLeadAdmin, command_reloadqst) ||
command_add("reloadrulesworld", "Executes a reload of all rules in world specifically.", AccountStatus::QuestTroupe, command_reloadworldrules) ||

View File

@ -2,7 +2,9 @@
void command_reloadmerchants(Client *c, const Seperator *sep)
{
entity_list.ReloadMerchants();
c->Message(Chat::Yellow, "Reloading merchants.");
c->Message(Chat::White, "Attempting to reload merchants globally.");
auto pack = new ServerPacket(ServerOP_ReloadMerchants, 0);
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -2073,6 +2073,36 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
parse->LoadPerlEventExportSettings(parse->perl_event_export_settings);
break;
}
case ServerOP_ReloadMerchants: {
if (zone) {
worldserver.SendEmoteMessage(
0,
0,
AccountStatus::GMAdmin,
Chat::Yellow,
fmt::format(
"Merchants reloaded for {}{}.",
fmt::format(
"{} ({})",
zone->GetLongName(),
zone->GetZoneID()
),
(
zone->GetInstanceID() ?
fmt::format(
" (Instance ID {})",
zone->GetInstanceID()
) :
""
)
).c_str()
);
entity_list.ReloadMerchants();
}
break;
}
case ServerOP_ReloadStaticZoneData: {
if (zone) {
worldserver.SendEmoteMessage(
@ -2097,6 +2127,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
)
).c_str()
);
zone->ReloadStaticData();
}
break;