[Commands] Cleanup #reloadstatic Command. (#2130)

- Cleanup messages and logic.
- Make reloading of static zone data global instead of zone specific.
This commit is contained in:
Kinglykrab 2022-05-06 20:03:22 -04:00 committed by GitHub
parent adfec15893
commit 6846deb9c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 3 deletions

View File

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

View File

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

View File

@ -296,7 +296,7 @@ int command_init(void)
command_add("reloadperlexportsettings", nullptr, AccountStatus::Max, command_reloadperlexportsettings) || command_add("reloadperlexportsettings", nullptr, 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("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) || command_add("reloadrulesworld", "Executes a reload of all rules in world specifically.", AccountStatus::QuestTroupe, command_reloadworldrules) ||
command_add("reloadstatic", "- Reload Static Zone Data", AccountStatus::GMLeadAdmin, command_reloadstatic) || command_add("reloadstatic", "- Reload Static Zone Data globally", AccountStatus::GMLeadAdmin, command_reloadstatic) ||
command_add("reloadtraps", "- Repops all traps in the current zone.", AccountStatus::QuestTroupe, command_reloadtraps) || command_add("reloadtraps", "- Repops all traps in the current zone.", AccountStatus::QuestTroupe, command_reloadtraps) ||
command_add("reloadtitles", "- Reload player titles from the database", AccountStatus::GMLeadAdmin, command_reloadtitles) || command_add("reloadtitles", "- Reload player titles from the database", AccountStatus::GMLeadAdmin, command_reloadtitles) ||
command_add("reloadworld", "[0|1] - Clear quest cache (0 - no repop, 1 - repop)", AccountStatus::Max, command_reloadworld) || command_add("reloadworld", "[0|1] - Clear quest cache (0 - no repop, 1 - repop)", AccountStatus::Max, command_reloadworld) ||

View File

@ -2,7 +2,9 @@
void command_reloadstatic(Client *c, const Seperator *sep) void command_reloadstatic(Client *c, const Seperator *sep)
{ {
c->Message(Chat::White, "Reloading zone static data..."); c->Message(Chat::White, "Attempting to reload static zone data globally.");
zone->ReloadStaticData(); auto pack = new ServerPacket(ServerOP_ReloadStaticZoneData, 0);
worldserver.SendPacket(pack);
safe_delete(pack);
} }

View File

@ -2024,6 +2024,34 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
parse->LoadPerlEventExportSettings(parse->perl_event_export_settings); parse->LoadPerlEventExportSettings(parse->perl_event_export_settings);
break; break;
} }
case ServerOP_ReloadStaticZoneData: {
if (zone) {
worldserver.SendEmoteMessage(
0,
0,
AccountStatus::GMAdmin,
Chat::Yellow,
fmt::format(
"Static zone data reloaded for {}{}.",
fmt::format(
"{} ({})",
zone->GetLongName(),
zone->GetZoneID()
),
(
zone->GetInstanceID() ?
fmt::format(
" (Instance ID {})",
zone->GetInstanceID()
) :
""
)
).c_str()
);
zone->ReloadStaticData();
}
break;
}
case ServerOP_CameraShake: case ServerOP_CameraShake:
{ {
if (zone) if (zone)