diff --git a/src/world/Manager/LinkshellMgr.cpp b/src/world/Manager/LinkshellMgr.cpp index c5d87192..fc66aa0c 100644 --- a/src/world/Manager/LinkshellMgr.cpp +++ b/src/world/Manager/LinkshellMgr.cpp @@ -297,6 +297,7 @@ void LinkshellMgr::sendLinkshellList( Entity::Player& player ) void LinkshellMgr::leaveLinkshell( uint64_t lsId, uint64_t characterId ) { auto& server = Common::Service< World::WorldServer >::ref(); + auto& chatChannelMgr = Common::Service< Manager::ChatChannelMgr >::ref(); auto leavingPlayer = server.getPlayer( characterId ); auto lsPtr = getLinkshellById( lsId ); if( !leavingPlayer || !lsPtr ) @@ -305,12 +306,14 @@ void LinkshellMgr::leaveLinkshell( uint64_t lsId, uint64_t characterId ) lsPtr->removeMember( characterId ); writeLinkshell( lsId ); + chatChannelMgr.removePlayerFromChannel( lsPtr->getChatChannel(), *leavingPlayer ); sendLinkshellList( *leavingPlayer ); } void LinkshellMgr::joinLinkshell( uint64_t lsId, uint64_t characterId ) { auto &server = Common::Service< World::WorldServer >::ref(); + auto& chatChannelMgr = Common::Service< Manager::ChatChannelMgr >::ref(); auto joiningPlayer = server.getPlayer( characterId ); auto lsPtr = getLinkshellById( lsId ); if( !joiningPlayer || !lsPtr ) @@ -320,5 +323,7 @@ void LinkshellMgr::joinLinkshell( uint64_t lsId, uint64_t characterId ) lsPtr->removeInvite( characterId ); writeLinkshell( lsId ); + chatChannelMgr.addPlayerToChannel( lsPtr->getChatChannel(), *joiningPlayer ); + sendLinkshellList( *joiningPlayer ); } \ No newline at end of file diff --git a/src/world/Manager/TerritoryMgr.cpp b/src/world/Manager/TerritoryMgr.cpp index d5480eb5..49a02b5b 100644 --- a/src/world/Manager/TerritoryMgr.cpp +++ b/src/world/Manager/TerritoryMgr.cpp @@ -16,12 +16,17 @@ #include "Territory/QuestBattle.h" #include "TerritoryMgr.h" #include "HousingMgr.h" +#include "ChatChannelMgr.h" +#include "LinkshellMgr.h" + +#include "Linkshell/Linkshell.h" #include "Territory/Land.h" #include "Territory/House.h" #include "Territory/Housing/HousingInteriorTerritory.h" #include "NaviMgr.h" + Sapphire::World::Manager::TerritoryMgr::TerritoryMgr() : m_lastInstanceId( 10000 ) { @@ -799,6 +804,12 @@ 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;