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

#include <Channel.h>

Classes

struct  PlayerInfo
 

Public Member Functions

 Channel (uint32 channelId, uint32 team=0, AreaTableEntry const *zoneEntry=nullptr)
 
 Channel (std::string const &name, uint32 team, std::string const &banList="")
 
 Channel (Channel const &)=delete
 
 Channel (Channel &&)=delete
 
Channeloperator= (Channel const &)=delete
 
Channeloperator= (Channel &&)=delete
 
 ~Channel ()
 
std::string GetName (LocaleConstant locale=DEFAULT_LOCALE) const
 
uint32 GetChannelId () const
 
bool IsConstant () const
 
bool IsLFG () const
 
bool IsAnnounce () const
 
void SetAnnounce (bool announce)
 
void SetDirty ()
 
void UpdateChannelInDB ()
 
void SetPassword (std::string const &password)
 
bool CheckPassword (std::string const &password) const
 
uint32 GetNumPlayers () const
 
uint8 GetFlags () const
 
bool HasFlag (uint8 flag) const
 
AreaTableEntry const * GetZoneEntry () const
 
void JoinChannel (Player *player, std::string const &pass="")
 
void LeaveChannel (Player *player, bool send=true)
 
void KickOrBan (Player const *player, std::string const &badname, bool ban)
 
void Kick (Player const *player, std::string const &badname)
 
void Ban (Player const *player, std::string const &badname)
 
void UnBan (Player const *player, std::string const &badname)
 
void Password (Player const *player, std::string const &pass)
 
void SetMode (Player const *player, std::string const &p2n, bool mod, bool set)
 
void SetModerator (Player const *player, std::string const &newname)
 
void UnsetModerator (Player const *player, std::string const &newname)
 
void SetMute (Player const *player, std::string const &newname)
 
void UnsetMute (Player const *player, std::string const &newname)
 
void SetInvisible (Player const *player, bool on)
 
void SetOwner (ObjectGuid guid, bool exclaim=true)
 
void SetOwner (Player const *player, std::string const &name)
 
void SendWhoOwner (ObjectGuid guid)
 
void List (Player const *player) const
 
void Announce (Player const *player)
 
void Say (ObjectGuid guid, std::string const &what, uint32 lang) const
 
void Invite (Player const *player, std::string const &newp)
 
void Voice (ObjectGuid guid1, ObjectGuid guid2) const
 
void DeVoice (ObjectGuid guid1, ObjectGuid guid2) const
 
void JoinNotify (ObjectGuid guid) const
 
void LeaveNotify (ObjectGuid guid) const
 
void SetOwnership (bool ownership)
 

Static Public Member Functions

static void GetChannelName (std::string &channelName, uint32 channelId, LocaleConstant locale, AreaTableEntry const *zoneEntry)
 

Private Types

typedef std::map< ObjectGuid, PlayerInfoPlayerContainer
 
typedef GuidUnorderedSet BannedContainer
 

Private Member Functions

template<class Builder >
void SendToAll (Builder &, ObjectGuid guid=ObjectGuid::Empty) const
 
template<class Builder >
void SendToAllButOne (Builder &builder, ObjectGuid who) const
 
template<class Builder >
void SendToOne (Builder &builder, ObjectGuid who) const
 
bool IsOn (ObjectGuid who) const
 
bool IsBanned (ObjectGuid guid) const
 
uint8 GetPlayerFlags (ObjectGuid guid) const
 
void SetModerator (ObjectGuid guid, bool set)
 
void SetMute (ObjectGuid guid, bool set)
 

Private Attributes

bool _isDirty
 
time_t _nextActivityUpdateTime
 
bool _announceEnabled
 
bool _ownershipEnabled
 
bool _isOwnerInvisible
 
uint8 _channelFlags
 
uint32 _channelId
 
uint32 _channelTeam
 
ObjectGuid _ownerGuid
 
std::string _channelName
 
std::string _channelPassword
 
PlayerContainer _playersStore
 
BannedContainer _bannedStore
 
AreaTableEntry const * _zoneEntry
 

Detailed Description

Definition at line 119 of file Channel.h.

Member Typedef Documentation

◆ BannedContainer

Definition at line 245 of file Channel.h.

◆ PlayerContainer

typedef std::map<ObjectGuid, PlayerInfo> Channel::PlayerContainer
private

Definition at line 244 of file Channel.h.

Constructor & Destructor Documentation

◆ Channel() [1/4]

Channel::Channel ( uint32  channelId,
uint32  team = 0,
AreaTableEntry const *  zoneEntry = nullptr 
)

Definition at line 36 of file Channel.cpp.

◆ Channel() [2/4]

Channel::Channel ( std::string const &  name,
uint32  team,
std::string const &  banList = "" 
)

Definition at line 63 of file Channel.cpp.

+ Here is the call graph for this function:

◆ Channel() [3/4]

Channel::Channel ( Channel const &  )
delete

◆ Channel() [4/4]

Channel::Channel ( Channel &&  )
delete

◆ ~Channel()

Channel::~Channel ( )
default

Member Function Documentation

◆ Announce()

void Channel::Announce ( Player const *  player)

Definition at line 643 of file Channel.cpp.

+ Here is the call graph for this function:

◆ Ban()

void Channel::Ban ( Player const *  player,
std::string const &  badname 
)
inline

Definition at line 194 of file Channel.h.

◆ CheckPassword()

bool Channel::CheckPassword ( std::string const &  password) const
inline

Definition at line 180 of file Channel.h.

+ Here is the caller graph for this function:

◆ DeVoice()

void Channel::DeVoice ( ObjectGuid  guid1,
ObjectGuid  guid2 
) const

Definition at line 820 of file Channel.cpp.

◆ GetChannelId()

uint32 Channel::GetChannelId ( ) const
inline

Definition at line 168 of file Channel.h.

+ Here is the caller graph for this function:

◆ GetChannelName()

void Channel::GetChannelName ( std::string &  channelName,
uint32  channelId,
LocaleConstant  locale,
AreaTableEntry const *  zoneEntry 
)
static

Definition at line 91 of file Channel.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetFlags()

uint8 Channel::GetFlags ( ) const
inline

Definition at line 184 of file Channel.h.

+ Here is the caller graph for this function:

◆ GetName()

std::string Channel::GetName ( LocaleConstant  locale = DEFAULT_LOCALE) const

Definition at line 108 of file Channel.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNumPlayers()

uint32 Channel::GetNumPlayers ( ) const
inline

Definition at line 182 of file Channel.h.

+ Here is the caller graph for this function:

◆ GetPlayerFlags()

uint8 Channel::GetPlayerFlags ( ObjectGuid  guid) const
inlineprivate

Definition at line 235 of file Channel.h.

+ Here is the caller graph for this function:

◆ GetZoneEntry()

AreaTableEntry const * Channel::GetZoneEntry ( ) const
inline

Definition at line 187 of file Channel.h.

+ Here is the caller graph for this function:

◆ HasFlag()

bool Channel::HasFlag ( uint8  flag) const
inline

Definition at line 185 of file Channel.h.

+ Here is the caller graph for this function:

◆ Invite()

void Channel::Invite ( Player const *  player,
std::string const &  newp 
)

Definition at line 721 of file Channel.cpp.

+ Here is the call graph for this function:

◆ IsAnnounce()

bool Channel::IsAnnounce ( ) const
inline

Definition at line 172 of file Channel.h.

◆ IsBanned()

bool Channel::IsBanned ( ObjectGuid  guid) const
inlineprivate

Definition at line 233 of file Channel.h.

+ Here is the caller graph for this function:

◆ IsConstant()

bool Channel::IsConstant ( ) const
inline

Definition at line 169 of file Channel.h.

+ Here is the caller graph for this function:

◆ IsLFG()

bool Channel::IsLFG ( ) const
inline

Definition at line 170 of file Channel.h.

◆ IsOn()

bool Channel::IsOn ( ObjectGuid  who) const
inlineprivate

Definition at line 232 of file Channel.h.

+ Here is the caller graph for this function:

◆ JoinChannel()

void Channel::JoinChannel ( Player player,
std::string const &  pass = "" 
)

Definition at line 153 of file Channel.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ JoinNotify()

void Channel::JoinNotify ( ObjectGuid  guid) const

Definition at line 825 of file Channel.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Kick()

void Channel::Kick ( Player const *  player,
std::string const &  badname 
)
inline

Definition at line 193 of file Channel.h.

◆ KickOrBan()

void Channel::KickOrBan ( Player const *  player,
std::string const &  badname,
bool  ban 
)

Definition at line 298 of file Channel.cpp.

+ Here is the call graph for this function:

◆ LeaveChannel()

void Channel::LeaveChannel ( Player player,
bool  send = true 
)

Definition at line 234 of file Channel.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LeaveNotify()

void Channel::LeaveNotify ( ObjectGuid  guid) const

Definition at line 845 of file Channel.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ List()

void Channel::List ( Player const *  player) const

Definition at line 595 of file Channel.cpp.

+ Here is the call graph for this function:

◆ operator=() [1/2]

Channel & Channel::operator= ( Channel &&  )
delete

◆ operator=() [2/2]

Channel & Channel::operator= ( Channel const &  )
delete

◆ Password()

void Channel::Password ( Player const *  player,
std::string const &  pass 
)

Definition at line 410 of file Channel.cpp.

+ Here is the call graph for this function:

◆ Say()

void Channel::Say ( ObjectGuid  guid,
std::string const &  what,
uint32  lang 
) const

Definition at line 682 of file Channel.cpp.

+ Here is the call graph for this function:

◆ SendToAll()

template<class Builder >
void Channel::SendToAll ( Builder &  builder,
ObjectGuid  guid = ObjectGuid::Empty 
) const
private

Definition at line 865 of file Channel.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendToAllButOne()

template<class Builder >
void Channel::SendToAllButOne ( Builder &  builder,
ObjectGuid  who 
) const
private

Definition at line 876 of file Channel.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendToOne()

template<class Builder >
void Channel::SendToOne ( Builder &  builder,
ObjectGuid  who 
) const
private

Definition at line 887 of file Channel.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendWhoOwner()

void Channel::SendWhoOwner ( ObjectGuid  guid)

Definition at line 579 of file Channel.cpp.

+ Here is the call graph for this function:

◆ SetAnnounce()

void Channel::SetAnnounce ( bool  announce)
inline

Definition at line 173 of file Channel.h.

+ Here is the caller graph for this function:

◆ SetDirty()

void Channel::SetDirty ( )
inline

Definition at line 176 of file Channel.h.

+ Here is the caller graph for this function:

◆ SetInvisible()

void Channel::SetInvisible ( Player const *  player,
bool  on 
)

Definition at line 493 of file Channel.cpp.

+ Here is the call graph for this function:

◆ SetMode()

void Channel::SetMode ( Player const *  player,
std::string const &  p2n,
bool  mod,
bool  set 
)

Definition at line 441 of file Channel.cpp.

+ Here is the call graph for this function:

◆ SetModerator() [1/2]

void Channel::SetModerator ( ObjectGuid  guid,
bool  set 
)
private

Definition at line 506 of file Channel.cpp.

+ Here is the call graph for this function:

◆ SetModerator() [2/2]

void Channel::SetModerator ( Player const *  player,
std::string const &  newname 
)
inline

Definition at line 200 of file Channel.h.

+ Here is the caller graph for this function:

◆ SetMute() [1/2]

void Channel::SetMute ( ObjectGuid  guid,
bool  set 
)
private

Definition at line 523 of file Channel.cpp.

+ Here is the call graph for this function:

◆ SetMute() [2/2]

void Channel::SetMute ( Player const *  player,
std::string const &  newname 
)
inline

Definition at line 202 of file Channel.h.

+ Here is the caller graph for this function:

◆ SetOwner() [1/2]

void Channel::SetOwner ( ObjectGuid  guid,
bool  exclaim = true 
)

Definition at line 780 of file Channel.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetOwner() [2/2]

void Channel::SetOwner ( Player const *  player,
std::string const &  name 
)

Definition at line 540 of file Channel.cpp.

+ Here is the call graph for this function:

◆ SetOwnership()

void Channel::SetOwnership ( bool  ownership)
inline

Definition at line 219 of file Channel.h.

+ Here is the caller graph for this function:

◆ SetPassword()

void Channel::SetPassword ( std::string const &  password)
inline

Definition at line 179 of file Channel.h.

+ Here is the caller graph for this function:

◆ UnBan()

void Channel::UnBan ( Player const *  player,
std::string const &  badname 
)

Definition at line 369 of file Channel.cpp.

+ Here is the call graph for this function:

◆ UnsetModerator()

void Channel::UnsetModerator ( Player const *  player,
std::string const &  newname 
)
inline

Definition at line 201 of file Channel.h.

◆ UnsetMute()

void Channel::UnsetMute ( Player const *  player,
std::string const &  newname 
)
inline

Definition at line 203 of file Channel.h.

◆ UpdateChannelInDB()

void Channel::UpdateChannelInDB ( )

Definition at line 116 of file Channel.cpp.

+ Here is the call graph for this function:

◆ Voice()

void Channel::Voice ( ObjectGuid  guid1,
ObjectGuid  guid2 
) const

Definition at line 815 of file Channel.cpp.

Member Data Documentation

◆ _announceEnabled

bool Channel::_announceEnabled
private

Definition at line 250 of file Channel.h.

◆ _bannedStore

BannedContainer Channel::_bannedStore
private

Definition at line 261 of file Channel.h.

◆ _channelFlags

uint8 Channel::_channelFlags
private

Definition at line 254 of file Channel.h.

◆ _channelId

uint32 Channel::_channelId
private

Definition at line 255 of file Channel.h.

◆ _channelName

std::string Channel::_channelName
private

Definition at line 258 of file Channel.h.

◆ _channelPassword

std::string Channel::_channelPassword
private

Definition at line 259 of file Channel.h.

◆ _channelTeam

uint32 Channel::_channelTeam
private

Definition at line 256 of file Channel.h.

◆ _isDirty

bool Channel::_isDirty
private

Definition at line 247 of file Channel.h.

◆ _isOwnerInvisible

bool Channel::_isOwnerInvisible
private

Definition at line 252 of file Channel.h.

◆ _nextActivityUpdateTime

time_t Channel::_nextActivityUpdateTime
private

Definition at line 248 of file Channel.h.

◆ _ownerGuid

ObjectGuid Channel::_ownerGuid
private

Definition at line 257 of file Channel.h.

◆ _ownershipEnabled

bool Channel::_ownershipEnabled
private

Definition at line 251 of file Channel.h.

◆ _playersStore

PlayerContainer Channel::_playersStore
private

Definition at line 260 of file Channel.h.

◆ _zoneEntry

AreaTableEntry const* Channel::_zoneEntry
private

Definition at line 263 of file Channel.h.


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