diff --git a/common/ruletypes.h b/common/ruletypes.h index f70cd1d98..00264e545 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -787,7 +787,6 @@ RULE_CATEGORY_END() RULE_CATEGORY(Expedition) RULE_INT(Expedition, MinStatusToBypassPlayerCountRequirements, 80, "Minimum GM status to bypass minimum player requirements for Expedition creation") -RULE_BOOL(Expedition, UseDatabaseToVerifyLeaderCommands, false, "Use database instead of zone cache to verify Expedition leader for commands") RULE_BOOL(Expedition, EmptyDzShutdownEnabled, true, "Enable early instance shutdown after last member of expedition removed") RULE_INT(Expedition, EmptyDzShutdownDelaySeconds, 1500, "Seconds to set dynamic zone instance expiration if early shutdown enabled") RULE_INT(Expedition, RequestExpiredLockoutLeewaySeconds, 60, "Seconds remaining on lockout to count as expired for creation requests (client hides timers under 60s remaining)") diff --git a/zone/expedition.cpp b/zone/expedition.cpp index 96b5784ff..2eafa1dbe 100644 --- a/zone/expedition.cpp +++ b/zone/expedition.cpp @@ -908,25 +908,15 @@ bool Expedition::ConfirmLeaderCommand(Client* requester) return false; } - ExpeditionMember leader; - if (RuleB(Expedition, UseDatabaseToVerifyLeaderCommands)) - { - leader = ExpeditionDatabase::GetExpeditionLeader(m_id); - } - else - { - leader = m_leader; - } - - if (leader.char_id == 0) + if (m_leader.char_id == 0) { requester->MessageString(Chat::Red, UNABLE_RETRIEVE_LEADER); // unconfirmed message return false; } - if (leader.char_id != requester->CharacterID()) + if (m_leader.char_id != requester->CharacterID()) { - requester->MessageString(Chat::System, EXPEDITION_NOT_LEADER, leader.name.c_str()); + requester->MessageString(Chat::System, EXPEDITION_NOT_LEADER, m_leader.name.c_str()); return false; } diff --git a/zone/expedition_database.cpp b/zone/expedition_database.cpp index 1f7bbdeb7..001f46730 100644 --- a/zone/expedition_database.cpp +++ b/zone/expedition_database.cpp @@ -430,28 +430,6 @@ uint32_t ExpeditionDatabase::GetExpeditionIDFromCharacterID(uint32_t character_i return expedition_id; } -ExpeditionMember ExpeditionDatabase::GetExpeditionLeader(uint32_t expedition_id) -{ - LogExpeditionsDetail("Getting expedition leader for expedition [{}]", expedition_id); - - auto query = fmt::format(SQL( - SELECT expedition_details.leader_id, character_data.name - FROM expedition_details - INNER JOIN character_data ON expedition_details.leader_id = character_data.id - WHERE expedition_id = {} - ), expedition_id); - - ExpeditionMember leader; - auto results = database.QueryDatabase(query); - if (results.Success() && results.RowCount() > 0) - { - auto row = results.begin(); - leader.char_id = strtoul(row[0], nullptr, 10); - leader.name = row[1]; - } - return leader; -} - void ExpeditionDatabase::InsertCharacterLockouts( uint32_t character_id, const std::vector& lockouts, bool replace_timer, bool is_pending) diff --git a/zone/expedition_database.h b/zone/expedition_database.h index 9002dc600..07c395267 100644 --- a/zone/expedition_database.h +++ b/zone/expedition_database.h @@ -60,7 +60,6 @@ namespace ExpeditionDatabase void DeletePendingLockouts(uint32_t character_id); void DeleteAllMembersPendingLockouts(const std::vector& members); uint32_t GetExpeditionIDFromCharacterID(uint32_t character_id); - ExpeditionMember GetExpeditionLeader(uint32_t expedition_id); std::pair, std::vector> GetMembersLockout( const std::vector& members, const std::string& expedition_name, const std::string& event_name);