diff --git a/src/common/Common.h b/src/common/Common.h index 14cc028d..b2d5208d 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -994,13 +994,13 @@ namespace Sapphire::Common namespace Ls { - enum LinkshellHierarchyShifted : int32_t + enum LinkshellHierarchy : int32_t { None1 = 0x0, - Master = 0x900, - Leader = 0xa00, - Member = 0xb00, - Invite = 0xc00, + Master = 0x1, + Leader = 0x2, + Member = 0x3, + Invite = 0x4, }; } diff --git a/src/world/Manager/LinkshellMgr.cpp b/src/world/Manager/LinkshellMgr.cpp index fc66aa0c..9f888236 100644 --- a/src/world/Manager/LinkshellMgr.cpp +++ b/src/world/Manager/LinkshellMgr.cpp @@ -152,6 +152,7 @@ Sapphire::LinkshellPtr Sapphire::World::Manager::LinkshellMgr::createLinkshell( { auto& chatChannelMgr = Common::Service< Manager::ChatChannelMgr >::ref(); auto chatChannelId = chatChannelMgr.createChatChannel( Common::ChatChannelType::LinkshellChat ); + chatChannelMgr.addPlayerToChannel( chatChannelId, player ); uint64_t linkshellId = 1; @@ -271,19 +272,23 @@ void LinkshellMgr::sendLinkshellList( Entity::Player& player ) auto lsVec = getPlayerLinkshells( player ); + uint32_t chatFlag = player.isLogin() ? 0 : 1ul << 11; + for( int i = 0; i < lsVec.size(); ++i ) { auto pLs = lsVec[ i ]; uint32_t hierarchy = 0; if( pLs->getMasterId() == player.getCharacterId() ) - hierarchy = Ls::LinkshellHierarchyShifted::Master; + hierarchy = Ls::LinkshellHierarchy::Master << 8; else if( pLs->getLeaderIdList().count( player.getCharacterId() ) ) - hierarchy = Ls::LinkshellHierarchyShifted::Leader; + hierarchy = Ls::LinkshellHierarchy::Leader << 8; else if( pLs->getInviteIdList().count( player.getCharacterId() ) ) - hierarchy = Ls::LinkshellHierarchyShifted::Invite; + hierarchy = Ls::LinkshellHierarchy::Invite << 8; else - hierarchy = Ls::LinkshellHierarchyShifted::Member; + hierarchy = Ls::LinkshellHierarchy::Member << 8; + + hierarchy |= chatFlag; linkshellListPacket->data().LinkshellList[ i ].LinkshellID = pLs->getId(); linkshellListPacket->data().LinkshellList[ i ].ChannelID = pLs->getChatChannel(); diff --git a/src/world/Manager/TerritoryMgr.cpp b/src/world/Manager/TerritoryMgr.cpp index 49a02b5b..df61c2af 100644 --- a/src/world/Manager/TerritoryMgr.cpp +++ b/src/world/Manager/TerritoryMgr.cpp @@ -804,12 +804,6 @@ bool Sapphire::World::Manager::TerritoryMgr::joinWorld( Sapphire::Entity::Player player.setRot( 0.0f ); } - auto& chatChannelMgr = Common::Service< Manager::ChatChannelMgr >::ref(); - auto& linkshellMgr = Common::Service< Manager::LinkshellMgr >::ref(); - auto lsList = linkshellMgr.getPlayerLinkshells( player ); - for( auto& ls : lsList ) - chatChannelMgr.addPlayerToChannel( ls->getChatChannel(), player ); - if( !movePlayer( pCurrZone, player ) ) return false; diff --git a/src/world/Network/Handlers/PacketCommandHandler.cpp b/src/world/Network/Handlers/PacketCommandHandler.cpp index f7171dee..efa20b9f 100644 --- a/src/world/Network/Handlers/PacketCommandHandler.cpp +++ b/src/world/Network/Handlers/PacketCommandHandler.cpp @@ -249,6 +249,8 @@ void Sapphire::Network::GameConnection::commandHandler( const Packets::FFXIVARR_ { player.finishZoning(); player.setLoadingComplete( true ); + if( player.isLogin() ) + player.setIsLogin( false ); break; } diff --git a/src/world/Network/Handlers/PacketHandlers.cpp b/src/world/Network/Handlers/PacketHandlers.cpp index 3b0d36f9..af24371a 100644 --- a/src/world/Network/Handlers/PacketHandlers.cpp +++ b/src/world/Network/Handlers/PacketHandlers.cpp @@ -459,7 +459,6 @@ void Sapphire::Network::GameConnection::setLanguageHandler( const Packets::FFXIV { // fire the onLogin Event playerMgr.onLogin( player ); - player.setIsLogin( false ); } // spawn the player for himself