1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-30 16:17:46 +00:00

Improved chat channel join calles.

This commit is contained in:
Mordred 2021-12-05 21:16:36 +01:00
parent c5ed71325b
commit b7ad7965a7
5 changed files with 16 additions and 16 deletions

View file

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

View file

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

View file

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

View file

@ -249,6 +249,8 @@ void Sapphire::Network::GameConnection::commandHandler( const Packets::FFXIVARR_
{
player.finishZoning();
player.setLoadingComplete( true );
if( player.isLogin() )
player.setIsLogin( false );
break;
}

View file

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