TrinityCore
Loading...
Searching...
No Matches
ChannelMgr Class Reference

#include <ChannelMgr.h>

Public Member Functions

 ChannelMgr (ChannelMgr const &right)=delete
 
 ChannelMgr (ChannelMgr &&right)=delete
 
ChannelMgr & operator= (ChannelMgr const &right)=delete
 
ChannelMgr & operator= (ChannelMgr &&right)=delete
 
void SaveToDB ()
 
Channel * GetSystemChannel (uint32 channelId, AreaTableEntry const *zoneEntry=nullptr)
 
Channel * CreateCustomChannel (std::string const &name)
 
Channel * GetCustomChannel (std::string const &name) const
 
Channel * GetChannel (uint32 channelId, std::string const &name, Player *player, bool notify=true, AreaTableEntry const *zoneEntry=nullptr) const
 
void LeftChannel (uint32 channelId, AreaTableEntry const *zoneEntry)
 

Static Public Member Functions

static void LoadFromDB ()
 
static ChannelMgr * ForTeam (Team team)
 
static Channel * GetChannelForPlayerByNamePart (std::string const &namePart, Player *playerSearcher)
 
static Channel * GetChannelForPlayerByGuid (ObjectGuid channelGuid, Player *playerSearcher)
 

Static Public Attributes

static AreaTableEntry const * SpecialLinkedArea
 

Protected Member Functions

 ChannelMgr (Team team)
 
 ~ChannelMgr ()
 

Private Types

typedef std::unordered_map< std::wstring, Channel * > CustomChannelContainer
 
typedef std::unordered_map< ObjectGuid, Channel * > BuiltinChannelContainer
 

Private Member Functions

ObjectGuid CreateCustomChannelGuid ()
 
ObjectGuid CreateBuiltinChannelGuid (uint32 channelId, AreaTableEntry const *zoneEntry=nullptr) const
 

Static Private Member Functions

static void SendNotOnChannelNotify (Player const *player, std::string const &name)
 

Private Attributes

CustomChannelContainer _customChannels
 
BuiltinChannelContainer _channels
 
Team const _team
 
ObjectGuidGenerator _guidGenerator
 

Detailed Description

Definition at line 31 of file ChannelMgr.h.

Member Typedef Documentation

◆ BuiltinChannelContainer

typedef std::unordered_map<ObjectGuid, Channel*> ChannelMgr::BuiltinChannelContainer
private

Definition at line 34 of file ChannelMgr.h.

◆ CustomChannelContainer

typedef std::unordered_map<std::wstring, Channel*> ChannelMgr::CustomChannelContainer
private

Definition at line 33 of file ChannelMgr.h.

Constructor & Destructor Documentation

◆ ChannelMgr() [1/3]

ChannelMgr::ChannelMgr ( Team  team)
explicitprotected

Definition at line 31 of file ChannelMgr.cpp.

◆ ~ChannelMgr()

ChannelMgr::~ChannelMgr ( )
protected

Definition at line 35 of file ChannelMgr.cpp.

References _channels, and _customChannels.

◆ ChannelMgr() [2/3]

ChannelMgr::ChannelMgr ( ChannelMgr const &  right)
delete

◆ ChannelMgr() [3/3]

ChannelMgr::ChannelMgr ( ChannelMgr &&  right)
delete

Member Function Documentation

◆ CreateBuiltinChannelGuid()

ObjectGuid ChannelMgr::CreateBuiltinChannelGuid ( uint32  channelId,
AreaTableEntry const *  zoneEntry = nullptr 
) const
private

◆ CreateCustomChannel()

Channel * ChannelMgr::CreateCustomChannel ( std::string const &  name)

◆ CreateCustomChannelGuid()

ObjectGuid ChannelMgr::CreateCustomChannelGuid ( )
private

Definition at line 280 of file ChannelMgr.cpp.

References _guidGenerator, _team, ALLIANCE, and ObjectGuidGenerator::Generate().

Referenced by CreateCustomChannel(), and LoadFromDB().

◆ ForTeam()

◆ GetChannel()

Channel * ChannelMgr::GetChannel ( uint32  channelId,
std::string const &  name,
Player *  player,
bool  notify = true,
AreaTableEntry const *  zoneEntry = nullptr 
) const

◆ GetChannelForPlayerByGuid()

Channel * ChannelMgr::GetChannelForPlayerByGuid ( ObjectGuid  channelGuid,
Player *  playerSearcher 
)
static

◆ GetChannelForPlayerByNamePart()

◆ GetCustomChannel()

Channel * ChannelMgr::GetCustomChannel ( std::string const &  name) const

Definition at line 211 of file ChannelMgr.cpp.

References _customChannels, Utf8toWStr(), and wstrToLower().

Referenced by WorldSession::HandleJoinChannel().

◆ GetSystemChannel()

Channel * ChannelMgr::GetSystemChannel ( uint32  channelId,
AreaTableEntry const *  zoneEntry = nullptr 
)

◆ LeftChannel()

void ChannelMgr::LeftChannel ( uint32  channelId,
AreaTableEntry const *  zoneEntry 
)

◆ LoadFromDB()

◆ operator=() [1/2]

ChannelMgr & ChannelMgr::operator= ( ChannelMgr &&  right)
delete

◆ operator=() [2/2]

ChannelMgr & ChannelMgr::operator= ( ChannelMgr const &  right)
delete

◆ SaveToDB()

void ChannelMgr::SaveToDB ( )

Definition at line 165 of file ChannelMgr.cpp.

References _customChannels.

Referenced by World::Update().

◆ SendNotOnChannelNotify()

void ChannelMgr::SendNotOnChannelNotify ( Player const *  player,
std::string const &  name 
)
staticprivate

Member Data Documentation

◆ _channels

BuiltinChannelContainer ChannelMgr::_channels
private

Definition at line 61 of file ChannelMgr.h.

Referenced by GetChannel(), GetSystemChannel(), LeftChannel(), and ~ChannelMgr().

◆ _customChannels

CustomChannelContainer ChannelMgr::_customChannels
private

◆ _guidGenerator

ObjectGuidGenerator ChannelMgr::_guidGenerator
private

Definition at line 63 of file ChannelMgr.h.

Referenced by CreateCustomChannelGuid().

◆ _team

Team const ChannelMgr::_team
private

◆ SpecialLinkedArea

AreaTableEntry const * ChannelMgr::SpecialLinkedArea
static

Definition at line 50 of file ChannelMgr.h.

Referenced by Channel::GetChannelName(), and LoadFromDB().


The documentation for this class was generated from the following files: