From 57d59823090d1bfe8dff4105825a9619fb83095b Mon Sep 17 00:00:00 2001 From: Alice Ogeda Date: Sun, 5 Dec 2021 18:30:35 -0300 Subject: [PATCH] add preliminary hierarchy data to ls commonlist; --- src/common/Common.h | 7 ++++- .../Network/Handlers/CommonListHandler.cpp | 29 ++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/common/Common.h b/src/common/Common.h index b2d5208d..aacb3b51 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -1013,8 +1013,13 @@ namespace Sapphire::Common uint8_t status; uint8_t type; uint8_t group; - uint8_t unk; + uint8_t unavailable; } data; + + struct Hierarchy32 { + uint32_t date; + uint32_t rawId; + } u32; }; /* 61719 */ diff --git a/src/world/Network/Handlers/CommonListHandler.cpp b/src/world/Network/Handlers/CommonListHandler.cpp index 09bb6eea..ffe45450 100644 --- a/src/world/Network/Handlers/CommonListHandler.cpp +++ b/src/world/Network/Handlers/CommonListHandler.cpp @@ -213,10 +213,37 @@ void Sapphire::Network::GameConnection::getCommonlistHandler( const Packets::FFX auto& inviteSet = lsPtr->getInviteIdList(); std::vector< uint64_t > memberVec; + std::vector< Common::HierarchyData > hierarchyData; std::copy( memberSet.begin(), memberSet.end(), std::back_inserter( memberVec ) ); std::copy( inviteSet.begin(), inviteSet.end(), std::back_inserter( memberVec ) ); - page = generateEntries( memberVec, offset, {} ); + for( const auto& id : memberVec ) + { + Common::HierarchyData hierarchy; + if( lsPtr->getMasterId() == id ) + { + hierarchy.data.type = Ls::LinkshellHierarchy::Master; + hierarchy.u32.rawId |= 1ul << 11; + } + else if( lsPtr->getLeaderIdList().count( id ) ) + { + hierarchy.data.type = Ls::LinkshellHierarchy::Leader; + hierarchy.u32.rawId |= 1ul << 11; + } + else if( lsPtr->getInviteIdList().count( id ) ) + { + hierarchy.data.type = Ls::LinkshellHierarchy::Invite; + } + else + { + hierarchy.data.type = Ls::LinkshellHierarchy::Member; + hierarchy.u32.rawId |= 1ul << 11; + } + + hierarchyData.push_back( hierarchy ); + } + + page = generateEntries( memberVec, offset, hierarchyData ); } } else if( data.ListType == 0x0e )