From a9c65cd4b27db765a973073a1f88092e4fa3a501 Mon Sep 17 00:00:00 2001 From: hg <4683435+hgtw@users.noreply.github.com> Date: Sat, 9 May 2020 19:44:04 -0400 Subject: [PATCH] Filter out expired instances from #dz list Add 'all' argument to #dz list to optionally show expired instances --- zone/command.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index 0d8386803..a85bbc868 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -6900,15 +6900,18 @@ void command_dz(Client* c, const Seperator* sep) auto expire_time = std::chrono::system_clock::from_time_t(start_time + duration); bool is_expired = std::chrono::system_clock::now() > expire_time; - c->Message(Chat::White, fmt::format( - "type: [{}] instance: [{}] zone: [{}] version: [{}] members: [{}] expired: [{}]", - strtoul(row[0], nullptr, 10), - strtoul(row[1], nullptr, 10), - strtoul(row[2], nullptr, 10), - strtoul(row[3], nullptr, 10), - strtoul(row[6], nullptr, 10), - is_expired - ).c_str()); + if (!is_expired || strcasecmp(sep->arg[2], "all") == 0) + { + c->Message(Chat::White, fmt::format( + "type: [{}] instance: [{}] zone: [{}] version: [{}] members: [{}] expired: [{}]", + strtoul(row[0], nullptr, 10), + strtoul(row[1], nullptr, 10), + strtoul(row[2], nullptr, 10), + strtoul(row[3], nullptr, 10), + strtoul(row[6], nullptr, 10), + is_expired + ).c_str()); + } } } } @@ -6929,7 +6932,7 @@ void command_dz(Client* c, const Seperator* sep) c->Message(Chat::White, "#dz cache list - list expeditions in current zone cache"); c->Message(Chat::White, "#dz cache reload - reload zone cache from database"); c->Message(Chat::White, "#dz destroy - destroy expedition globally (must be in cache)"); - c->Message(Chat::White, "#dz list - list all dynamic zones with corresponding instance ids from database"); + c->Message(Chat::White, "#dz list [all] - list dynamic zones 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"); }