diff --git a/src/common/Common.h b/src/common/Common.h index 01c43a38..a3d5065c 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -22,7 +22,7 @@ namespace Sapphire::Common const uint64_t INVALID_GAME_OBJECT_ID64 = 0xE0000000; const uint16_t MAX_PLAYER_LEVEL = 60; - const uint8_t CURRENT_EXPANSION_ID = 3; + const uint8_t CURRENT_EXPANSION_ID = 1; const uint8_t CLASSJOB_TOTAL = 23; const uint8_t CLASSJOB_SLOTS = 23; @@ -1002,6 +1002,15 @@ namespace Sapphire::Common MAX_0 = 0x7, }; + enum LinkshellHierarchyShifted : int32_t + { + None1 = 0x0, + Master = 0x900, + Leader = 0xa00, + Member = 0xb00, + Invite = 0xc00, + }; + union HierarchyData { uint64_t u64; diff --git a/src/world/Manager/LinkshellMgr.h b/src/world/Manager/LinkshellMgr.h index 91d7ff75..c638d420 100644 --- a/src/world/Manager/LinkshellMgr.h +++ b/src/world/Manager/LinkshellMgr.h @@ -8,6 +8,16 @@ namespace Sapphire::World::Manager { + enum Hierarchy : __int32 + { + NONE_1 = 0x0, + MASTER = 0x1, + LEADER = 0x2, + MEMBER = 0x3, + INVITE = 0x4, + MAX_0 = 0x7, + }; + class LinkshellMgr { private: diff --git a/src/world/Network/Handlers/CommonListHandler.cpp b/src/world/Network/Handlers/CommonListHandler.cpp index 5d9bd0cc..7b511e92 100644 --- a/src/world/Network/Handlers/CommonListHandler.cpp +++ b/src/world/Network/Handlers/CommonListHandler.cpp @@ -95,7 +95,7 @@ void Sapphire::Network::GameConnection::getCommonlistHandler( const Packets::FFX if( !pPlayer ) continue; - PlayerEntry entry; + PlayerEntry entry{}; memset( &entry, 0, sizeof( PlayerEntry ) ); bool isConnected = server.getSession( pPlayer->getCharacterId() ) != nullptr; @@ -128,7 +128,7 @@ void Sapphire::Network::GameConnection::getCommonlistHandler( const Packets::FFX entry.CharacterID = pPlayer->getCharacterId(); strcpy( entry.CharacterName, pPlayer->getName().c_str() ); - if( hierarchyVec.size() > 0 ) + if( !hierarchyVec.empty() ) { auto hierarchy = hierarchyVec[ i ]; diff --git a/src/world/Network/Handlers/PacketHandlers.cpp b/src/world/Network/Handlers/PacketHandlers.cpp index 7193f96f..c06516ff 100644 --- a/src/world/Network/Handlers/PacketHandlers.cpp +++ b/src/world/Network/Handlers/PacketHandlers.cpp @@ -181,10 +181,18 @@ void Sapphire::Network::GameConnection::linkshellListHandler( const Packets::FFX for( int i = 0; i < lsVec.size(); ++i ) { auto pLs = lsVec[ i ]; + uint32_t hierarchy = 0; + + if( pLs->getMasterId() == player.getCharacterId() ) + hierarchy = LinkshellHierarchyShifted::Master; + else if( pLs->getLeaderIdList().count( player.getCharacterId() ) ) + hierarchy = LinkshellHierarchyShifted::Leader; + else + hierarchy = LinkshellHierarchyShifted::Member; linkshellListPacket->data().LinkshellList[ i ].LinkshellID = pLs->getId(); linkshellListPacket->data().LinkshellList[ i ].ChannelID = pLs->getChatChannel(); - linkshellListPacket->data().LinkshellList[ i ].HierarchyID = player.getId(); // unknown - possibly FC related + linkshellListPacket->data().LinkshellList[ i ].HierarchyID = hierarchy; strcpy( linkshellListPacket->data().LinkshellList[ i ].LinkshellName, pLs->getName().c_str() ); }