From 18dd9e6637a95ed34ff1d36c1116313b3edbdc9a Mon Sep 17 00:00:00 2001 From: hg <4683435+hgtw@users.noreply.github.com> Date: Sun, 27 Sep 2020 17:11:36 -0400 Subject: [PATCH] Add #dz expedition unlock command Add expedition name and zone to #dz expedition list Adjust #dz list output --- zone/command.cpp | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index 73eaa26e7..e806474ae 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -6844,10 +6844,14 @@ void command_dz(Client* c, const Seperator* sep) auto seconds = expedition.second->GetDynamicZone().GetSecondsRemaining(); c->Message(Chat::White, fmt::format( - "Expedition id: [{}]: leader: [{}] instance id: [{}] members: [{}] remaining: [{:02}:{:02}:{:02}]", + "Expedition id: [{}] name: [{}] leader: [{}] zone: [{}]:[{}]:[{}]:[{}] members: [{}] remaining: [{:02}:{:02}:{:02}]", expedition.second->GetID(), + expedition.second->GetName(), expedition.second->GetLeaderName(), + ZoneName(expedition.second->GetDynamicZone().GetZoneID()), + expedition.second->GetDynamicZone().GetZoneID(), expedition.second->GetInstanceID(), + expedition.second->GetDynamicZone().GetZoneVersion(), expedition.second->GetMemberCount(), seconds / 3600, // hours (seconds / 60) % 60, // minutes @@ -6868,9 +6872,8 @@ void command_dz(Client* c, const Seperator* sep) auto expedition = Expedition::FindCachedExpeditionByID(expedition_id); if (expedition) { - c->Message(Chat::White, fmt::format( - "Destroying expedition [{}] ({})", expedition_id, expedition->GetName()).c_str() - ); + c->Message(Chat::White, fmt::format("Destroying expedition [{}] ({})", + expedition_id, expedition->GetName()).c_str()); expedition->RemoveAllMembers(); } else @@ -6878,6 +6881,20 @@ void command_dz(Client* c, const Seperator* sep) c->Message(Chat::Red, fmt::format("Failed to destroy expedition [{}]", sep->arg[3]).c_str()); } } + else if (strcasecmp(sep->arg[2], "unlock") == 0 && sep->IsNumber(3)) + { + auto expedition_id = std::strtoul(sep->arg[3], nullptr, 10); + auto expedition = Expedition::FindCachedExpeditionByID(expedition_id); + if (expedition) + { + c->Message(Chat::White, fmt::format("Unlocking expedition [{}]", expedition_id).c_str()); + expedition->SetLocked(false, ExpeditionLockMessage::None, true); + } + else + { + c->Message(Chat::Red, fmt::format("Failed to find expedition [{}]", sep->arg[3]).c_str()); + } + } } else if (strcasecmp(sep->arg[1], "list") == 0) { @@ -6914,10 +6931,10 @@ void command_dz(Client* c, const Seperator* sep) if (!is_expired || strcasecmp(sep->arg[2], "all") == 0) { c->Message(Chat::White, fmt::format( - "type: [{}] instance: [{}] zone: [{}] version: [{}] members: [{}] remaining: [{:02}:{:02}:{:02}]", + "type: [{}] zone: [{}]:[{}]:[{}] members: [{}] remaining: [{:02}:{:02}:{:02}]", strtoul(row[0], nullptr, 10), - strtoul(row[1], nullptr, 10), strtoul(row[2], nullptr, 10), + strtoul(row[1], nullptr, 10), strtoul(row[3], nullptr, 10), strtoul(row[6], nullptr, 10), seconds / 3600, // hours @@ -6980,6 +6997,7 @@ void command_dz(Client* c, const Seperator* sep) c->Message(Chat::White, "#dz expedition list - list expeditions in current zone cache"); c->Message(Chat::White, "#dz expedition reload - reload expedition zone cache from database"); c->Message(Chat::White, "#dz expedition destroy - destroy expedition globally (must be in cache)"); + c->Message(Chat::White, "#dz expedition unlock - unlock expedition"); c->Message(Chat::White, "#dz list [all] - list dynamic zone instances from database -- 'all' includes expired"); c->Message(Chat::White, "#dz lockouts remove - delete all of character's expedition lockouts"); c->Message(Chat::White, "#dz lockouts remove \"\" - delete lockouts by expedition");