TrinityCore
Channel Class Reference

#include <Channel.h>

Classes

struct  PlayerInfo
 

Public Member Functions

 Channel (ObjectGuid const &guid, uint32 channelId, uint32 team=0, AreaTableEntry const *zoneEntry=nullptr)
 
 Channel (ObjectGuid const &guid, std::string const &name, uint32 team=0, std::string const &banList="")
 
std::string GetName (LocaleConstant locale=DEFAULT_LOCALE) const
 
uint32 GetChannelId () const
 
bool IsConstant () const
 
ObjectGuid GetGUID () 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, bool suspend=false)
 
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 SetInvisible (Player const *player, bool on)
 
void SetOwner (ObjectGuid const &guid, bool exclaim=true)
 
void SetOwner (Player const *player, std::string const &name)
 
void SendWhoOwner (Player const *player)
 
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 SilenceAll (Player const *player, std::string const &name)
 
void UnsilenceAll (Player const *player, std::string const &name)
 
void List (Player const *player)
 
void Announce (Player const *player)
 
void Say (ObjectGuid const &guid, std::string const &what, uint32 lang) const
 
void AddonSay (ObjectGuid const &guid, std::string const &prefix, std::string const &what, bool isLogged) const
 
void DeclineInvite (Player const *player)
 
void Invite (Player const *player, std::string const &newp)
 
void JoinNotify (Player const *player)
 
void LeaveNotify (Player const *player)
 
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 &builder, ObjectGuid const &guid=ObjectGuid::Empty, ObjectGuid const &accountGuid=ObjectGuid::Empty) const
 
template<class Builder >
void SendToAllButOne (Builder &builder, ObjectGuid const &who) const
 
template<class Builder >
void SendToOne (Builder &builder, ObjectGuid const &who) const
 
template<class Builder >
void SendToAllWithAddon (Builder &builder, std::string const &addonPrefix, ObjectGuid const &guid=ObjectGuid::Empty, ObjectGuid const &accountGuid=ObjectGuid::Empty) const
 
bool IsOn (ObjectGuid who) const
 
bool IsBanned (ObjectGuid guid) const
 
uint8 GetPlayerFlags (ObjectGuid const &guid) const
 
void SetModerator (ObjectGuid const &guid, bool set)
 
void SetMute (ObjectGuid const &guid, bool set)
 

Private Attributes

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

Detailed Description

Definition at line 114 of file Channel.h.

Member Typedef Documentation

◆ BannedContainer

Definition at line 249 of file Channel.h.

◆ PlayerContainer

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

Definition at line 248 of file Channel.h.

Constructor & Destructor Documentation

◆ Channel() [1/2]

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

Definition at line 38 of file Channel.cpp.

+ Here is the call graph for this function:

◆ Channel() [2/2]

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

Definition at line 63 of file Channel.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ AddonSay()

void Channel::AddonSay ( ObjectGuid const &  guid,
std::string const &  prefix,
std::string const &  what,
bool  isLogged 
) const

Definition at line 731 of file Channel.cpp.

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

◆ Announce()

void Channel::Announce ( Player const *  player)

Definition at line 639 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 195 of file Channel.h.

◆ CheckPassword()

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

Definition at line 181 of file Channel.h.

+ Here is the caller graph for this function:

◆ DeclineInvite()

void Channel::DeclineInvite ( Player const *  player)

Definition at line 882 of file Channel.cpp.

◆ GetChannelId()

uint32 Channel::GetChannelId ( ) const
inline

Definition at line 166 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 97 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 185 of file Channel.h.

+ Here is the caller graph for this function:

◆ GetGUID()

ObjectGuid Channel::GetGUID ( ) const
inline

Definition at line 169 of file Channel.h.

◆ GetName()

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

Definition at line 114 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 183 of file Channel.h.

+ Here is the caller graph for this function:

◆ GetPlayerFlags()

uint8 Channel::GetPlayerFlags ( ObjectGuid const &  guid) const
inlineprivate

Definition at line 239 of file Channel.h.

+ Here is the caller graph for this function:

◆ GetZoneEntry()

AreaTableEntry const * Channel::GetZoneEntry ( ) const
inline

Definition at line 188 of file Channel.h.

+ Here is the caller graph for this function:

◆ HasFlag()

bool Channel::HasFlag ( uint8  flag) const
inline

Definition at line 186 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 779 of file Channel.cpp.

+ Here is the call graph for this function:

◆ IsAnnounce()

bool Channel::IsAnnounce ( ) const
inline

Definition at line 173 of file Channel.h.

◆ IsBanned()

bool Channel::IsBanned ( ObjectGuid  guid) const
inlineprivate

Definition at line 237 of file Channel.h.

+ Here is the caller graph for this function:

◆ IsConstant()

bool Channel::IsConstant ( ) const
inline

Definition at line 167 of file Channel.h.

+ Here is the caller graph for this function:

◆ IsLFG()

bool Channel::IsLFG ( ) const
inline

Definition at line 171 of file Channel.h.

◆ IsOn()

bool Channel::IsOn ( ObjectGuid  who) const
inlineprivate

Definition at line 236 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 157 of file Channel.cpp.

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

◆ JoinNotify()

void Channel::JoinNotify ( Player const *  player)

Definition at line 886 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 194 of file Channel.h.

◆ KickOrBan()

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

Definition at line 336 of file Channel.cpp.

+ Here is the call graph for this function:

◆ LeaveChannel()

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

Definition at line 256 of file Channel.cpp.

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

◆ LeaveNotify()

void Channel::LeaveNotify ( Player const *  player)

Definition at line 928 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)

always true?

Definition at line 598 of file Channel.cpp.

+ Here is the call graph for this function:

◆ Password()

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

Definition at line 447 of file Channel.cpp.

+ Here is the call graph for this function:

◆ Say()

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

Definition at line 679 of file Channel.cpp.

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

◆ SendToAll()

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

Definition at line 986 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 const &  who 
) const
private

Definition at line 997 of file Channel.cpp.

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

◆ SendToAllWithAddon()

template<class Builder >
void Channel::SendToAllWithAddon ( Builder &  builder,
std::string const &  addonPrefix,
ObjectGuid const &  guid = ObjectGuid::Empty,
ObjectGuid const &  accountGuid = ObjectGuid::Empty 
) const
private

Definition at line 1017 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 const &  who 
) const
private

Definition at line 1008 of file Channel.cpp.

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

◆ SendWhoOwner()

void Channel::SendWhoOwner ( Player const *  player)

Definition at line 581 of file Channel.cpp.

+ Here is the call graph for this function:

◆ SetAnnounce()

void Channel::SetAnnounce ( bool  announce)
inline

Definition at line 174 of file Channel.h.

+ Here is the caller graph for this function:

◆ SetDirty()

void Channel::SetDirty ( )
inline

Definition at line 177 of file Channel.h.

+ Here is the caller graph for this function:

◆ SetInvisible()

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

Definition at line 529 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 477 of file Channel.cpp.

+ Here is the call graph for this function:

◆ SetModerator() [1/2]

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

Definition at line 951 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 207 of file Channel.h.

+ Here is the caller graph for this function:

◆ SetMute() [1/2]

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

Definition at line 968 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 209 of file Channel.h.

+ Here is the caller graph for this function:

◆ SetOwner() [1/2]

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

Definition at line 838 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 542 of file Channel.cpp.

+ Here is the call graph for this function:

◆ SetOwnership()

void Channel::SetOwnership ( bool  ownership)
inline

Definition at line 221 of file Channel.h.

+ Here is the caller graph for this function:

◆ SetPassword()

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

Definition at line 180 of file Channel.h.

+ Here is the caller graph for this function:

◆ SilenceAll()

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

Definition at line 874 of file Channel.cpp.

◆ UnBan()

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

Definition at line 406 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 208 of file Channel.h.

◆ UnsetMute()

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

Definition at line 210 of file Channel.h.

◆ UnsilenceAll()

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

Definition at line 878 of file Channel.cpp.

◆ UpdateChannelInDB()

void Channel::UpdateChannelInDB ( )

Definition at line 122 of file Channel.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ _announceEnabled

bool Channel::_announceEnabled
private

Definition at line 254 of file Channel.h.

◆ _bannedStore

BannedContainer Channel::_bannedStore
private

Definition at line 266 of file Channel.h.

◆ _channelFlags

uint8 Channel::_channelFlags
private

Definition at line 258 of file Channel.h.

◆ _channelGuid

ObjectGuid Channel::_channelGuid
private

Definition at line 261 of file Channel.h.

◆ _channelId

uint32 Channel::_channelId
private

Definition at line 259 of file Channel.h.

◆ _channelName

std::string Channel::_channelName
private

Definition at line 263 of file Channel.h.

◆ _channelPassword

std::string Channel::_channelPassword
private

Definition at line 264 of file Channel.h.

◆ _channelTeam

uint32 Channel::_channelTeam
private

Definition at line 260 of file Channel.h.

◆ _isDirty

bool Channel::_isDirty
private

Definition at line 251 of file Channel.h.

◆ _isOwnerInvisible

bool Channel::_isOwnerInvisible
private

Definition at line 256 of file Channel.h.

◆ _nextActivityUpdateTime

time_t Channel::_nextActivityUpdateTime
private

Definition at line 252 of file Channel.h.

◆ _ownerGuid

ObjectGuid Channel::_ownerGuid
private

Definition at line 262 of file Channel.h.

◆ _ownershipEnabled

bool Channel::_ownershipEnabled
private

Definition at line 255 of file Channel.h.

◆ _playersStore

PlayerContainer Channel::_playersStore
private

Definition at line 265 of file Channel.h.

◆ _zoneEntry

AreaTableEntry const* Channel::_zoneEntry
private

Definition at line 268 of file Channel.h.


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