mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-02 08:57:44 +00:00
Fixed linkshell chat channels
This commit is contained in:
parent
e84c034509
commit
c5ed71325b
2 changed files with 16 additions and 0 deletions
|
@ -297,6 +297,7 @@ void LinkshellMgr::sendLinkshellList( Entity::Player& player )
|
||||||
void LinkshellMgr::leaveLinkshell( uint64_t lsId, uint64_t characterId )
|
void LinkshellMgr::leaveLinkshell( uint64_t lsId, uint64_t characterId )
|
||||||
{
|
{
|
||||||
auto& server = Common::Service< World::WorldServer >::ref();
|
auto& server = Common::Service< World::WorldServer >::ref();
|
||||||
|
auto& chatChannelMgr = Common::Service< Manager::ChatChannelMgr >::ref();
|
||||||
auto leavingPlayer = server.getPlayer( characterId );
|
auto leavingPlayer = server.getPlayer( characterId );
|
||||||
auto lsPtr = getLinkshellById( lsId );
|
auto lsPtr = getLinkshellById( lsId );
|
||||||
if( !leavingPlayer || !lsPtr )
|
if( !leavingPlayer || !lsPtr )
|
||||||
|
@ -305,12 +306,14 @@ void LinkshellMgr::leaveLinkshell( uint64_t lsId, uint64_t characterId )
|
||||||
lsPtr->removeMember( characterId );
|
lsPtr->removeMember( characterId );
|
||||||
writeLinkshell( lsId );
|
writeLinkshell( lsId );
|
||||||
|
|
||||||
|
chatChannelMgr.removePlayerFromChannel( lsPtr->getChatChannel(), *leavingPlayer );
|
||||||
sendLinkshellList( *leavingPlayer );
|
sendLinkshellList( *leavingPlayer );
|
||||||
}
|
}
|
||||||
|
|
||||||
void LinkshellMgr::joinLinkshell( uint64_t lsId, uint64_t characterId )
|
void LinkshellMgr::joinLinkshell( uint64_t lsId, uint64_t characterId )
|
||||||
{
|
{
|
||||||
auto &server = Common::Service< World::WorldServer >::ref();
|
auto &server = Common::Service< World::WorldServer >::ref();
|
||||||
|
auto& chatChannelMgr = Common::Service< Manager::ChatChannelMgr >::ref();
|
||||||
auto joiningPlayer = server.getPlayer( characterId );
|
auto joiningPlayer = server.getPlayer( characterId );
|
||||||
auto lsPtr = getLinkshellById( lsId );
|
auto lsPtr = getLinkshellById( lsId );
|
||||||
if( !joiningPlayer || !lsPtr )
|
if( !joiningPlayer || !lsPtr )
|
||||||
|
@ -320,5 +323,7 @@ void LinkshellMgr::joinLinkshell( uint64_t lsId, uint64_t characterId )
|
||||||
lsPtr->removeInvite( characterId );
|
lsPtr->removeInvite( characterId );
|
||||||
writeLinkshell( lsId );
|
writeLinkshell( lsId );
|
||||||
|
|
||||||
|
chatChannelMgr.addPlayerToChannel( lsPtr->getChatChannel(), *joiningPlayer );
|
||||||
|
|
||||||
sendLinkshellList( *joiningPlayer );
|
sendLinkshellList( *joiningPlayer );
|
||||||
}
|
}
|
|
@ -16,12 +16,17 @@
|
||||||
#include "Territory/QuestBattle.h"
|
#include "Territory/QuestBattle.h"
|
||||||
#include "TerritoryMgr.h"
|
#include "TerritoryMgr.h"
|
||||||
#include "HousingMgr.h"
|
#include "HousingMgr.h"
|
||||||
|
#include "ChatChannelMgr.h"
|
||||||
|
#include "LinkshellMgr.h"
|
||||||
|
|
||||||
|
#include "Linkshell/Linkshell.h"
|
||||||
|
|
||||||
#include "Territory/Land.h"
|
#include "Territory/Land.h"
|
||||||
#include "Territory/House.h"
|
#include "Territory/House.h"
|
||||||
#include "Territory/Housing/HousingInteriorTerritory.h"
|
#include "Territory/Housing/HousingInteriorTerritory.h"
|
||||||
#include "NaviMgr.h"
|
#include "NaviMgr.h"
|
||||||
|
|
||||||
|
|
||||||
Sapphire::World::Manager::TerritoryMgr::TerritoryMgr() :
|
Sapphire::World::Manager::TerritoryMgr::TerritoryMgr() :
|
||||||
m_lastInstanceId( 10000 )
|
m_lastInstanceId( 10000 )
|
||||||
{
|
{
|
||||||
|
@ -799,6 +804,12 @@ bool Sapphire::World::Manager::TerritoryMgr::joinWorld( Sapphire::Entity::Player
|
||||||
player.setRot( 0.0f );
|
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 ) )
|
if( !movePlayer( pCurrZone, player ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue