1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-06-13 10:57:46 +00:00

Properly sent linkshell member status in linkshell list

This commit is contained in:
Mordred 2021-12-04 01:02:25 +01:00
parent 1fe1b9ec8b
commit 8ce29c0bdc
4 changed files with 31 additions and 4 deletions

View file

@ -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;

View file

@ -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:

View file

@ -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 ];

View file

@ -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() );
}