[Commands] Cleanup #reloadlevelmods Command. (#2122)

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

* Remove unnecessary message.

* Update worldserver.cpp

* Update worldserver.cpp

* Update worldserver.cpp
This commit is contained in:
Kinglykrab 2022-05-06 22:31:17 -04:00 committed by GitHub
parent e26eba8e03
commit 7549fbbeea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 44 additions and 9 deletions

View File

@ -228,6 +228,7 @@
#define ServerOP_UpdateSchedulerEvents 0x4012
#define ServerOP_ReloadContentFlags 0x4013
#define ServerOP_ReloadVariablesWorld 0x4014
#define ServerOP_ReloadLevelEXPMods 0x4015
#define ServerOP_ReloadMerchants 0x4016
#define ServerOP_ReloadAAData 0x4017
#define ServerOP_ReloadStaticZoneData 0x4020

View File

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

View File

@ -287,7 +287,7 @@ int command_init(void)
command_add("reloadallrules", "Executes a reload of all rules globally.", AccountStatus::QuestTroupe, command_reloadallrules) ||
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("reloadlevelmods", "Reloads level based experience modifiers globally", AccountStatus::Max, command_reloadlevelmods) ||
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) ||

View File

@ -2,14 +2,14 @@
void command_reloadlevelmods(Client *c, const Seperator *sep)
{
if (sep->arg[1][0] == 0) {
if (RuleB(Zone, LevelBasedEXPMods)) {
zone->LoadLevelEXPMods();
c->Message(Chat::Yellow, "Level based EXP Mods have been reloaded zonewide");
}
else {
c->Message(Chat::Yellow, "Level based EXP Mods are disabled in rules!");
}
}
if (!RuleB(Zone, LevelBasedEXPMods)) {
c->Message(Chat::White, "Level based experience modifiers are disabled.");
return;
}
c->Message(Chat::White, "Attempted to reload level based experience modifiers globally.");
auto pack = new ServerPacket(ServerOP_ReloadLevelEXPMods, 0);
worldserver.SendPacket(pack);
safe_delete(pack);
}

View File

@ -2073,6 +2073,35 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
parse->LoadPerlEventExportSettings(parse->perl_event_export_settings);
break;
}
case ServerOP_ReloadLevelEXPMods: {
if (zone) {
worldserver.SendEmoteMessage(
0,
0,
AccountStatus::GMAdmin,
Chat::Yellow,
fmt::format(
"Level based experience modifiers reloaded for {}{}.",
fmt::format(
"{} ({})",
zone->GetLongName(),
zone->GetZoneID()
),
(
zone->GetInstanceID() ?
fmt::format(
" (Instance ID {})",
zone->GetInstanceID()
) :
""
)
).c_str()
);
zone->LoadLevelEXPMods();
}
break;
}
case ServerOP_ReloadAAData: {
if (zone) {
worldserver.SendEmoteMessage(