From ee0cdfad0b6a48dfa66d7ea2f08a01e50f490e75 Mon Sep 17 00:00:00 2001 From: Mordred Date: Sat, 4 Dec 2021 01:27:35 +0100 Subject: [PATCH] Allow invite to show, invite packets and linkshell updating not included --- src/common/Common.h | 17 ++++++++++------- src/world/Manager/LinkshellMgr.cpp | 3 ++- src/world/Network/Handlers/PacketHandlers.cpp | 8 +++++--- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/common/Common.h b/src/common/Common.h index a3d5065c..769cee3f 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -1002,14 +1002,17 @@ namespace Sapphire::Common MAX_0 = 0x7, }; - enum LinkshellHierarchyShifted : int32_t + namespace Ls { - None1 = 0x0, - Master = 0x900, - Leader = 0xa00, - Member = 0xb00, - Invite = 0xc00, - }; + enum LinkshellHierarchyShifted : int32_t + { + None1 = 0x0, + Master = 0x900, + Leader = 0xa00, + Member = 0xb00, + Invite = 0xc00, + }; + } union HierarchyData { diff --git a/src/world/Manager/LinkshellMgr.cpp b/src/world/Manager/LinkshellMgr.cpp index a9703ff7..ba09d397 100644 --- a/src/world/Manager/LinkshellMgr.cpp +++ b/src/world/Manager/LinkshellMgr.cpp @@ -193,9 +193,10 @@ const std::vector< Sapphire::LinkshellPtr > Sapphire::World::Manager::LinkshellM for( const auto &[ key, value ] : m_linkshellIdMap ) { auto& memberList = value->getMemberIdList(); + auto& inviteList = value->getInviteIdList(); // find player id in LS member list - if( !( memberList.find( player.getCharacterId() ) == memberList.end() ) ) + if( memberList.count( player.getCharacterId() ) || inviteList.count( player.getCharacterId() ) ) { lsVec.emplace_back( value ); } diff --git a/src/world/Network/Handlers/PacketHandlers.cpp b/src/world/Network/Handlers/PacketHandlers.cpp index c06516ff..cf643305 100644 --- a/src/world/Network/Handlers/PacketHandlers.cpp +++ b/src/world/Network/Handlers/PacketHandlers.cpp @@ -184,11 +184,13 @@ void Sapphire::Network::GameConnection::linkshellListHandler( const Packets::FFX uint32_t hierarchy = 0; if( pLs->getMasterId() == player.getCharacterId() ) - hierarchy = LinkshellHierarchyShifted::Master; + hierarchy = Ls::LinkshellHierarchyShifted::Master; else if( pLs->getLeaderIdList().count( player.getCharacterId() ) ) - hierarchy = LinkshellHierarchyShifted::Leader; + hierarchy = Ls::LinkshellHierarchyShifted::Leader; + else if( pLs->getInviteIdList().count( player.getCharacterId() ) ) + hierarchy = Ls::LinkshellHierarchyShifted::Invite; else - hierarchy = LinkshellHierarchyShifted::Member; + hierarchy = Ls::LinkshellHierarchyShifted::Member; linkshellListPacket->data().LinkshellList[ i ].LinkshellID = pLs->getId(); linkshellListPacket->data().LinkshellList[ i ].ChannelID = pLs->getChatChannel();