From 0d8df603587d18303af44318bd64f65a5252c653 Mon Sep 17 00:00:00 2001 From: hg <4683435+hgtw@users.noreply.github.com> Date: Thu, 2 Jul 2020 22:50:56 -0400 Subject: [PATCH] Add character id based expedition apis Add static expedition methods to add or remove character lockouts Add CreateLockout static helper to ExpeditionLockoutTimer Refactor existing character lockout removal to allow removal of lockouts for offline characters (was only used by #dz lockouts remove command) Fix #dz list member count --- common/servertalk.h | 12 ++-- world/expedition.cpp | 8 ++- world/zoneserver.cpp | 2 +- zone/client.cpp | 24 ++++--- zone/client.h | 2 +- zone/command.cpp | 4 +- zone/expedition.cpp | 103 +++++++++++++++++++++++++--- zone/expedition.h | 11 ++- zone/expedition_lockout_timer.cpp | 14 ++++ zone/expedition_lockout_timer.h | 4 ++ zone/lua_client.cpp | 4 +- zone/lua_general.cpp | 107 ++++++++++++++++++++++++++++-- zone/questmgr.cpp | 20 ------ zone/questmgr.h | 3 - zone/worldserver.cpp | 2 +- 15 files changed, 257 insertions(+), 63 deletions(-) diff --git a/common/servertalk.h b/common/servertalk.h index 5c8cf7a5d..32e3cd812 100644 --- a/common/servertalk.h +++ b/common/servertalk.h @@ -154,7 +154,7 @@ #define ServerOP_ExpeditionDzCompass 0x040a #define ServerOP_ExpeditionDzSafeReturn 0x040b #define ServerOP_ExpeditionDzZoneIn 0x040c -#define ServerOP_ExpeditionRemoveCharLockouts 0x040d +#define ServerOP_ExpeditionCharacterLockout 0x040d #define ServerOP_ExpeditionSaveInvite 0x040e #define ServerOP_ExpeditionRequestInvite 0x040f #define ServerOP_ExpeditionReplayOnJoin 0x0410 @@ -2059,9 +2059,13 @@ struct ServerExpeditionSetting_Struct { }; struct ServerExpeditionCharacterLockout_Struct { - char character_name[64]; - char expedition_name[128]; - char event_name[256]; + uint8 remove; + uint32 character_id; + uint64 expire_time; + uint32 duration; + char uuid[37]; + char expedition_name[128]; + char event_name[256]; }; struct ServerExpeditionCharacterID_Struct { diff --git a/world/expedition.cpp b/world/expedition.cpp index 7bd77b6c7..c880a2855 100644 --- a/world/expedition.cpp +++ b/world/expedition.cpp @@ -428,10 +428,14 @@ void ExpeditionMessage::HandleZoneMessage(ServerPacket* pack) ExpeditionMessage::MakeLeader(pack); break; } - case ServerOP_ExpeditionRemoveCharLockouts: + case ServerOP_ExpeditionCharacterLockout: { auto buf = reinterpret_cast(pack->pBuffer); - client_list.SendPacket(buf->character_name, pack); + auto cle = client_list.FindCLEByCharacterID(buf->character_id); + if (cle && cle->Server()) + { + cle->Server()->SendPacket(pack); + } break; } case ServerOP_ExpeditionSaveInvite: diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index 3628991f0..4b750ed99 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -1381,7 +1381,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) { case ServerOP_ExpeditionMembersRemoved: case ServerOP_ExpeditionDzAddPlayer: case ServerOP_ExpeditionDzMakeLeader: - case ServerOP_ExpeditionRemoveCharLockouts: + case ServerOP_ExpeditionCharacterLockout: case ServerOP_ExpeditionSaveInvite: case ServerOP_ExpeditionRequestInvite: { diff --git a/zone/client.cpp b/zone/client.cpp index e6dfcb788..553c898e9 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -39,7 +39,6 @@ extern volatile bool RunLoops; #include "../common/string_util.h" #include "../common/data_verification.h" #include "../common/profanity_manager.h" -#include "../common/util/uuid.h" #include "data_bucket.h" #include "expedition.h" #include "expedition_database.h" @@ -9632,12 +9631,7 @@ void Client::AddExpeditionLockout( void Client::AddNewExpeditionLockout( const std::string& expedition_name, const std::string& event_name, uint32_t seconds, std::string uuid) { - if (uuid.empty()) - { - uuid = EQ::Util::UUID::Generate().ToString(); - } - ExpeditionLockoutTimer lockout{uuid, expedition_name, event_name, 0, seconds}; - lockout.Reset(); // sets expire time + auto lockout = ExpeditionLockoutTimer::CreateLockout(expedition_name, event_name, seconds, uuid); AddExpeditionLockout(lockout, true); } @@ -9661,22 +9655,30 @@ void Client::RemoveExpeditionLockout( } } -void Client::RemoveAllExpeditionLockouts(std::string expedition_name) +void Client::RemoveAllExpeditionLockouts(const std::string& expedition_name, bool update_db) { if (expedition_name.empty()) { - ExpeditionDatabase::DeleteAllCharacterLockouts(CharacterID()); + if (update_db) + { + ExpeditionDatabase::DeleteAllCharacterLockouts(CharacterID()); + } m_expedition_lockouts.clear(); } else { - ExpeditionDatabase::DeleteAllCharacterLockouts(CharacterID(), expedition_name); + if (update_db) + { + ExpeditionDatabase::DeleteAllCharacterLockouts(CharacterID(), expedition_name); + } + m_expedition_lockouts.erase(std::remove_if(m_expedition_lockouts.begin(), m_expedition_lockouts.end(), [&](const ExpeditionLockoutTimer& lockout) { return lockout.GetExpeditionName() == expedition_name; } ), m_expedition_lockouts.end()); } + SendExpeditionLockoutTimers(); } @@ -9717,6 +9719,8 @@ bool Client::HasExpeditionLockout( void Client::LoadAllExpeditionLockouts() { + m_expedition_lockouts.clear(); + auto lockouts = ExpeditionDatabase::LoadCharacterLockouts(CharacterID()); for (const auto& lockout : lockouts) { diff --git a/zone/client.h b/zone/client.h index b37b74147..471daf23c 100644 --- a/zone/client.h +++ b/zone/client.h @@ -1132,7 +1132,7 @@ public: uint32 GetPendingExpeditionInviteID() const { return m_pending_expedition_invite.expedition_id; } bool HasExpeditionLockout(const std::string& expedition_name, const std::string& event_name, bool include_expired = false); bool IsInExpedition() const { return m_expedition_id != 0; } - void RemoveAllExpeditionLockouts(std::string expedition_name = {}); + void RemoveAllExpeditionLockouts(const std::string& expedition_name, bool update_db = false); void RemoveExpeditionLockout( const std::string& expedition_name, const std::string& event_name, bool update_db = false, bool update_client = true); void RequestPendingExpeditionInvite(); diff --git a/zone/command.cpp b/zone/command.cpp index b6ce11440..74eb74e66 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -6889,7 +6889,7 @@ void command_dz(Client* c, const Seperator* sep) instance_list.version, instance_list.start_time, instance_list.duration, - COUNT(instance_list.id) member_count + COUNT(instance_list_player.id) member_count FROM dynamic_zones INNER JOIN instance_list ON dynamic_zones.instance_id = instance_list.id LEFT JOIN instance_list_player ON instance_list.id = instance_list_player.id @@ -6944,7 +6944,7 @@ void command_dz(Client* c, const Seperator* sep) "Removing [{}]:[{}] lockout on [{}].", sep->arg[4], sep->arg[5], sep->arg[3] ).c_str()); } - Expedition::RemoveCharacterLockouts(sep->arg[3], sep->arg[4], sep->arg[5]); + Expedition::RemoveLockoutsByCharacterName(sep->arg[3], sep->arg[4], sep->arg[5]); } } else diff --git a/zone/expedition.cpp b/zone/expedition.cpp index 3fc07b099..6fb0ec226 100644 --- a/zone/expedition.cpp +++ b/zone/expedition.cpp @@ -1586,18 +1586,78 @@ void Expedition::SendWorldGetOnlineMembers( worldserver.SendPacket(pack.get()); } -void Expedition::RemoveCharacterLockouts( - std::string character_name, std::string expedition_name, std::string event_name) +void Expedition::SendWorldCharacterLockout( + uint32_t character_id, const ExpeditionLockoutTimer& lockout, bool remove) { uint32_t pack_size = sizeof(ServerExpeditionCharacterLockout_Struct); - auto pack = std::unique_ptr(new ServerPacket(ServerOP_ExpeditionRemoveCharLockouts, pack_size)); + auto pack = std::unique_ptr(new ServerPacket(ServerOP_ExpeditionCharacterLockout, pack_size)); auto buf = reinterpret_cast(pack->pBuffer); - strn0cpy(buf->character_name, character_name.c_str(), sizeof(buf->character_name)); - strn0cpy(buf->expedition_name, expedition_name.c_str(), sizeof(buf->expedition_name)); - strn0cpy(buf->event_name, event_name.c_str(), sizeof(buf->event_name)); + buf->remove = remove; + buf->character_id = character_id; + buf->expire_time = lockout.GetExpireTime(); + buf->duration = lockout.GetDuration(); + strn0cpy(buf->uuid, lockout.GetExpeditionUUID().c_str(), sizeof(buf->uuid)); + strn0cpy(buf->expedition_name, lockout.GetExpeditionName().c_str(), sizeof(buf->expedition_name)); + strn0cpy(buf->event_name, lockout.GetEventName().c_str(), sizeof(buf->event_name)); worldserver.SendPacket(pack.get()); } +void Expedition::AddLockoutByCharacterID( + uint32_t character_id, const std::string& expedition_name, const std::string& event_name, + uint32_t seconds, const std::string& uuid) +{ + if (character_id) + { + auto lockout = ExpeditionLockoutTimer::CreateLockout(expedition_name, event_name, seconds, uuid); + ExpeditionDatabase::InsertCharacterLockouts(character_id, { lockout }, true); + SendWorldCharacterLockout(character_id, lockout, false); + } +} + +void Expedition::AddLockoutByCharacterName( + const std::string& character_name, const std::string& expedition_name, const std::string& event_name, + uint32_t seconds, const std::string& uuid) +{ + if (!character_name.empty()) + { + uint32_t character_id = database.GetCharacterID(character_name.c_str()); + AddLockoutByCharacterID(character_id, expedition_name, event_name, seconds, uuid); + } +} + +void Expedition::RemoveLockoutsByCharacterID( + uint32_t character_id, const std::string& expedition_name, const std::string& event_name) +{ + if (character_id) + { + if (!event_name.empty()) + { + ExpeditionDatabase::DeleteCharacterLockout(character_id, expedition_name, event_name); + } + else if (!expedition_name.empty()) + { + ExpeditionDatabase::DeleteAllCharacterLockouts(character_id, expedition_name); + } + else + { + ExpeditionDatabase::DeleteAllCharacterLockouts(character_id); + } + + ExpeditionLockoutTimer lockout{{}, expedition_name, event_name, 0, 0}; + SendWorldCharacterLockout(character_id, lockout, true); + } +} + +void Expedition::RemoveLockoutsByCharacterName( + const std::string& character_name, const std::string& expedition_name, const std::string& event_name) +{ + if (!character_name.empty()) + { + uint32_t character_id = database.GetCharacterID(character_name.c_str()); + RemoveLockoutsByCharacterID(character_id, expedition_name, event_name); + } +} + void Expedition::HandleWorldMessage(ServerPacket* pack) { switch (pack->opcode) @@ -1818,15 +1878,21 @@ void Expedition::HandleWorldMessage(ServerPacket* pack) } break; } - case ServerOP_ExpeditionRemoveCharLockouts: + case ServerOP_ExpeditionCharacterLockout: { auto buf = reinterpret_cast(pack->pBuffer); - Client* client = entity_list.GetClientByName(buf->character_name); + Client* client = entity_list.GetClientByCharID(buf->character_id); if (client) { - if (buf->event_name[0] != '\0') + if (!buf->remove) { - client->RemoveExpeditionLockout(buf->expedition_name, buf->event_name, true); + client->AddExpeditionLockout(ExpeditionLockoutTimer{ + buf->uuid, buf->expedition_name, buf->event_name, buf->expire_time, buf->duration + }); + } + else if (buf->event_name[0] != '\0') + { + client->RemoveExpeditionLockout(buf->expedition_name, buf->event_name); } else { @@ -1982,3 +2048,20 @@ std::string Expedition::GetLootEventBySpawnID(uint32_t spawn_id) return event_name; } + +std::vector Expedition::GetExpeditionLockoutsByCharacterID(uint32_t character_id) +{ + std::vector lockouts; + + auto client = entity_list.GetClientByCharID(character_id); + if (client) + { + lockouts = client->GetExpeditionLockouts(); + } + else + { + lockouts = ExpeditionDatabase::LoadCharacterLockouts(character_id); + } + + return lockouts; +} diff --git a/zone/expedition.h b/zone/expedition.h index 002b3c0d4..ba6ba09e9 100644 --- a/zone/expedition.h +++ b/zone/expedition.h @@ -77,8 +77,16 @@ public: static Expedition* FindCachedExpeditionByCharacterName(const std::string& char_name); static Expedition* FindCachedExpeditionByID(uint32_t expedition_id); static Expedition* FindCachedExpeditionByInstanceID(uint32_t instance_id); - static void RemoveCharacterLockouts(std::string character_name, std::string expedition_name = {}, std::string event_name = {}); + static std::vector GetExpeditionLockoutsByCharacterID(uint32_t character_id); static void HandleWorldMessage(ServerPacket* pack); + static void AddLockoutByCharacterID(uint32_t character_id, const std::string& expedition_name, + const std::string& event_name, uint32_t seconds, const std::string& uuid = {}); + static void AddLockoutByCharacterName(const std::string& character_name, const std::string& expedition_name, + const std::string& event_name, uint32_t seconds, const std::string& uuid = {}); + static void RemoveLockoutsByCharacterID(uint32_t character_id, + const std::string& expedition_name = {}, const std::string& event_name = {}); + static void RemoveLockoutsByCharacterName(const std::string& character_name, + const std::string& expedition_name = {}, const std::string& event_name = {}); uint32_t GetID() const { return m_id; } uint16_t GetInstanceID() const { return m_dynamiczone.GetInstanceID(); } @@ -143,6 +151,7 @@ public: private: static void CacheExpeditions(MySQLRequestResult& results); static void SendWorldGetOnlineMembers(const std::vector>& expedition_character_ids); + static void SendWorldCharacterLockout(uint32_t character_id, const ExpeditionLockoutTimer& lockout, bool remove); void AddLockout(const ExpeditionLockoutTimer& lockout, bool members_only = false); void AddInternalMember(const std::string& char_name, uint32_t char_id, ExpeditionMemberStatus status); diff --git a/zone/expedition_lockout_timer.cpp b/zone/expedition_lockout_timer.cpp index a070ce582..ef0358122 100644 --- a/zone/expedition_lockout_timer.cpp +++ b/zone/expedition_lockout_timer.cpp @@ -20,6 +20,7 @@ #include "expedition_lockout_timer.h" #include "../common/string_util.h" +#include "../common/util/uuid.h" #include const char* const DZ_REPLAY_TIMER_NAME = "Replay Timer"; // see December 14, 2016 patch notes @@ -40,6 +41,19 @@ ExpeditionLockoutTimer::ExpeditionLockoutTimer( } } +ExpeditionLockoutTimer ExpeditionLockoutTimer::CreateLockout( + const std::string& expedition_name, const std::string& event_name, uint32_t seconds, std::string uuid) +{ + if (uuid.empty()) + { + uuid = EQ::Util::UUID::Generate().ToString(); + } + + ExpeditionLockoutTimer lockout{uuid, expedition_name, event_name, 0, seconds}; + lockout.Reset(); // sets expire time + return lockout; +} + uint32_t ExpeditionLockoutTimer::GetSecondsRemaining() const { auto now = std::chrono::system_clock::now(); diff --git a/zone/expedition_lockout_timer.h b/zone/expedition_lockout_timer.h index 5325d0f78..5527e42cf 100644 --- a/zone/expedition_lockout_timer.h +++ b/zone/expedition_lockout_timer.h @@ -34,6 +34,10 @@ public: const std::string& expedition_uuid, const std::string& expedition_name, const std::string& event_name, uint64_t expire_time, uint32_t duration); + static ExpeditionLockoutTimer CreateLockout( + const std::string& expedition_name, const std::string& event_name, + uint32_t seconds, std::string uuid = {}); + struct DaysHoursMinutes { std::string days; diff --git a/zone/lua_client.cpp b/zone/lua_client.cpp index 9696c67c6..9d46df8c2 100644 --- a/zone/lua_client.cpp +++ b/zone/lua_client.cpp @@ -1776,12 +1776,12 @@ void Lua_Client::AddExpeditionLockout(std::string expedition_name, std::string e void Lua_Client::RemoveAllExpeditionLockouts() { Lua_Safe_Call_Void(); - self->RemoveAllExpeditionLockouts(); + self->RemoveAllExpeditionLockouts({}, true); } void Lua_Client::RemoveAllExpeditionLockouts(std::string expedition_name) { Lua_Safe_Call_Void(); - self->RemoveAllExpeditionLockouts(expedition_name); + self->RemoveAllExpeditionLockouts(expedition_name, true); } void Lua_Client::RemoveExpeditionLockout(std::string expedition_name, std::string event_name) { diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index 256534426..c13c90c09 100644 --- a/zone/lua_general.cpp +++ b/zone/lua_general.cpp @@ -25,6 +25,7 @@ #include "encounter.h" #include "lua_encounter.h" #include "data_bucket.h" +#include "expedition.h" struct Events { }; struct Factions { }; @@ -2172,15 +2173,101 @@ void lua_set_content_flag(std::string flag_name, bool enabled){ } Lua_Expedition lua_get_expedition() { - return quest_manager.GetExpeditionForCurrentInstance(); + if (zone && zone->GetInstanceID() != 0) + { + return Expedition::FindCachedExpeditionByInstanceID(zone->GetInstanceID()); + } + return nullptr; } Lua_Expedition lua_get_expedition_by_char_id(uint32 char_id) { - return quest_manager.GetExpeditionByCharID(char_id); + return Expedition::FindCachedExpeditionByCharacterID(char_id); } Lua_Expedition lua_get_expedition_by_instance_id(uint32 instance_id) { - return quest_manager.GetExpeditionByInstanceID(instance_id); + return Expedition::FindCachedExpeditionByInstanceID(instance_id); +} + +luabind::object lua_get_expedition_lockout_by_char_id(lua_State* L, uint32 char_id, std::string expedition_name, std::string event_name) { + luabind::adl::object lua_table = luabind::newtable(L); + + auto lockouts = Expedition::GetExpeditionLockoutsByCharacterID(char_id); + + auto it = std::find_if(lockouts.begin(), lockouts.end(), [&](const ExpeditionLockoutTimer& lockout) { + return lockout.IsSameLockout(expedition_name, event_name); + }); + + if (it != lockouts.end()) + { + lua_table["remaining"] = it->GetSecondsRemaining(); + lua_table["uuid"] = it->GetExpeditionUUID(); + } + + return lua_table; +} + +luabind::object lua_get_expedition_lockouts_by_char_id(lua_State* L, uint32 char_id) { + luabind::adl::object lua_table = luabind::newtable(L); + + auto lockouts = Expedition::GetExpeditionLockoutsByCharacterID(char_id); + for (const auto& lockout : lockouts) + { + auto lockout_table = lua_table[lockout.GetExpeditionName()]; + if (luabind::type(lockout_table) != LUA_TTABLE) + { + lockout_table = luabind::newtable(L); + } + + auto event_table = lockout_table[lockout.GetEventName()]; + if (luabind::type(event_table) != LUA_TTABLE) + { + event_table = luabind::newtable(L); + } + + event_table["remaining"] = lockout.GetSecondsRemaining(); + event_table["uuid"] = lockout.GetExpeditionUUID(); + } + return lua_table; +} + +luabind::object lua_get_expedition_lockouts_by_char_id(lua_State* L, uint32 char_id, std::string expedition_name) { + luabind::adl::object lua_table = luabind::newtable(L); + + auto lockouts = Expedition::GetExpeditionLockoutsByCharacterID(char_id); + for (const auto& lockout : lockouts) + { + if (lockout.GetExpeditionName() == expedition_name) + { + auto event_table = lua_table[lockout.GetEventName()]; + if (luabind::type(event_table) != LUA_TTABLE) + { + event_table = luabind::newtable(L); + } + event_table["remaining"] = lockout.GetSecondsRemaining(); + event_table["uuid"] = lockout.GetExpeditionUUID(); + } + } + return lua_table; +} + +void lua_add_expedition_lockout_by_char_id(uint32 char_id, std::string expedition_name, std::string event_name, uint32 seconds) { + Expedition::AddLockoutByCharacterID(char_id, expedition_name, event_name, seconds); +} + +void lua_add_expedition_lockout_by_char_id(uint32 char_id, std::string expedition_name, std::string event_name, uint32 seconds, std::string uuid) { + Expedition::AddLockoutByCharacterID(char_id, expedition_name, event_name, seconds, uuid); +} + +void lua_remove_expedition_lockout_by_char_id(uint32 char_id, std::string expedition_name, std::string event_name) { + Expedition::RemoveLockoutsByCharacterID(char_id, expedition_name, event_name); +} + +void lua_remove_all_expedition_lockouts_by_char_id(uint32 char_id) { + Expedition::RemoveLockoutsByCharacterID(char_id); +} + +void lua_remove_all_expedition_lockouts_by_char_id(uint32 char_id, std::string expedition_name) { + Expedition::RemoveLockoutsByCharacterID(char_id, expedition_name); } #define LuaCreateNPCParse(name, c_type, default_value) do { \ @@ -2780,9 +2867,17 @@ luabind::scope lua_register_general() { luabind::def("is_content_flag_enabled", (bool(*)(std::string))&lua_is_content_flag_enabled), luabind::def("set_content_flag", (void(*)(std::string, bool))&lua_set_content_flag), - luabind::def("get_expedition", (Lua_Expedition(*)())&lua_get_expedition), - luabind::def("get_expedition_by_char_id", (Lua_Expedition(*)(uint32 char_id))&lua_get_expedition_by_char_id), - luabind::def("get_expedition_by_instance_id", (Lua_Expedition(*)(uint32 instance_id))&lua_get_expedition_by_instance_id) + luabind::def("get_expedition", &lua_get_expedition), + luabind::def("get_expedition_by_char_id", &lua_get_expedition_by_char_id), + luabind::def("get_expedition_by_instance_id", &lua_get_expedition_by_instance_id), + luabind::def("get_expedition_lockout_by_char_id", &lua_get_expedition_lockout_by_char_id), + luabind::def("get_expedition_lockouts_by_char_id", (luabind::object(*)(lua_State*, uint32))&lua_get_expedition_lockouts_by_char_id), + luabind::def("get_expedition_lockouts_by_char_id", (luabind::object(*)(lua_State*, uint32, std::string))&lua_get_expedition_lockouts_by_char_id), + luabind::def("add_expedition_lockout_by_char_id", (void(*)(uint32, std::string, std::string, uint32))&lua_add_expedition_lockout_by_char_id), + luabind::def("add_expedition_lockout_by_char_id", (void(*)(uint32, std::string, std::string, uint32, std::string))&lua_add_expedition_lockout_by_char_id), + luabind::def("remove_expedition_lockout_by_char_id", &lua_remove_expedition_lockout_by_char_id), + luabind::def("remove_all_expedition_lockouts_by_char_id", (void(*)(uint32))&lua_remove_all_expedition_lockouts_by_char_id), + luabind::def("remove_all_expedition_lockouts_by_char_id", (void(*)(uint32, std::string))&lua_remove_all_expedition_lockouts_by_char_id) ]; } diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 4e92ce2ec..82fae08ee 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -26,7 +26,6 @@ #include "entity.h" #include "event_codes.h" -#include "expedition.h" #include "guild_mgr.h" #include "qglobals.h" #include "queryserv.h" @@ -4293,22 +4292,3 @@ void QuestManager::UpdateZoneHeader(std::string type, std::string value) { entity_list.QueueClients(0, outapp); safe_delete(outapp); } - -Expedition* QuestManager::GetExpeditionByCharID(uint32 char_id) -{ - return Expedition::FindCachedExpeditionByCharacterID(char_id); -} - -Expedition* QuestManager::GetExpeditionByInstanceID(uint32 instance_id) -{ - return Expedition::FindCachedExpeditionByInstanceID(instance_id); -} - -Expedition* QuestManager::GetExpeditionForCurrentInstance() -{ - if (zone && zone->GetInstanceID() != 0) - { - return Expedition::FindCachedExpeditionByInstanceID(zone->GetInstanceID()); - } - return nullptr; -} diff --git a/zone/questmgr.h b/zone/questmgr.h index 2e7e0b8b6..9ea34e1e1 100644 --- a/zone/questmgr.h +++ b/zone/questmgr.h @@ -365,9 +365,6 @@ public: bool DisableRecipe(uint32 recipe_id); void ClearNPCTypeCache(int npctype_id); void ReloadZoneStaticData(); - Expedition* GetExpeditionByCharID(uint32 char_id); - Expedition* GetExpeditionByInstanceID(uint32 instance_id); - Expedition* GetExpeditionForCurrentInstance(); Client *GetInitiator() const; NPC *GetNPC() const; diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index fb8faeb1c..07c97e410 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -2907,7 +2907,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) case ServerOP_ExpeditionDzSafeReturn: case ServerOP_ExpeditionDzZoneIn: case ServerOP_ExpeditionDzDuration: - case ServerOP_ExpeditionRemoveCharLockouts: + case ServerOP_ExpeditionCharacterLockout: { Expedition::HandleWorldMessage(pack); break;