From 9cbe25f712d12d27886a0bb11638b73c2b31faf7 Mon Sep 17 00:00:00 2001 From: Alex King <89047260+Kinglykrab@users.noreply.github.com> Date: Sun, 20 Aug 2023 16:42:45 -0400 Subject: [PATCH] [Feature] Change #reload zone to reload zone headers globally. (#3557) * [Feature] Change #reload zone to reload zone headers globally. # Notes - This allows operators to globally reload zone headers without going to every zone individually to do so. * Update worldserver.cpp * Update worldserver.cpp --- zone/gm_commands/reload.cpp | 70 ++----------------------------------- 1 file changed, 2 insertions(+), 68 deletions(-) diff --git a/zone/gm_commands/reload.cpp b/zone/gm_commands/reload.cpp index 41e3a80f5..49c614255 100644 --- a/zone/gm_commands/reload.cpp +++ b/zone/gm_commands/reload.cpp @@ -230,74 +230,8 @@ void command_reload(Client *c, const Seperator *sep) auto RW = (ReloadWorld_Struct *) pack->pBuffer; RW->global_repop = global_repop; } else if (is_zone) { - zone_store.LoadZones(content_db); - - if (arguments < 2) { - c->Message( - Chat::White, - fmt::format( - "Zone Header Load {} | Zone: {}", - ( - zone->LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion()) ? - "Succeeded" : - "Failed" - ), - zone->GetZoneDescription() - ).c_str() - ); - return; - } - - auto zone_id = ( - sep->IsNumber(2) ? - Strings::ToUnsignedInt(sep->arg[2]) : - ZoneID(sep->arg[2]) - ); - if (!zone_id) { - c->Message( - Chat::White, - fmt::format( - "Zone ID {} could not be found.", - zone_id - ).c_str() - ); - return; - } - - auto zone_short_name = ZoneName(zone_id); - auto zone_long_name = ZoneLongName(zone_id); - auto version = ( - sep->IsNumber(3) ? - Strings::ToUnsignedInt(sep->arg[3]) : - 0 - ); - - auto outapp = new EQApplicationPacket(OP_NewZone, sizeof(NewZone_Struct)); - memcpy(outapp->pBuffer, &zone->newzone_data, outapp->size); - entity_list.QueueClients(c, outapp); - safe_delete(outapp); - - c->Message( - Chat::White, - fmt::format( - "Zone Header Load {} | Zone: {} ({}){}", - ( - zone->LoadZoneCFG(zone_short_name, version) ? - "Succeeded" : - "Failed" - ), - zone_long_name, - zone_short_name, - ( - version ? - fmt::format( - " Version: {}", - version - ) : - "" - ) - ).c_str() - ); + c->Message(Chat::White, "Attempting to reloading Zone data globally."); + pack = new ServerPacket(ServerOP_ReloadZoneData, sizeof(NewZone_Struct)); } else if (is_zone_points) { c->Message(Chat::White, "Attempting to reloading Zone Points globally."); pack = new ServerPacket(ServerOP_ReloadZonePoints, 0);