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
 
Channel & operator= (Channel const &)=delete
 
Channel & operator= (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, 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 SilenceVoice (Player const *player, std::string const &name)
 
void UnsilenceAll (Player const *player, std::string const &name)
 
void UnsilenceVoice (Player const *player, std::string const &name)
 
void List (Player const *player) const
 
void Announce (Player const *player)
 
void Say (ObjectGuid const &guid, std::string const &what, uint32 lang) const
 
void DeclineInvite (Player const *player)
 
void Invite (Player const *player, std::string const &newp)
 
void JoinNotify (ObjectGuid const &guid) const
 
void LeaveNotify (ObjectGuid const &guid) const
 
void SetOwnership (bool ownership)
 
void SendMemberCount (Player const *player) const
 
void VoiceOn (Player const *player)
 
void VoiceOff (Player const *player)
 

Static Public Member Functions

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

Private Types

typedef std::map< ObjectGuid, PlayerInfo > PlayerContainer
 
typedef GuidUnorderedSet BannedContainer
 

Private Member Functions

template<class Builder >
void SendToAll (Builder &builder, ObjectGuid const &guid=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
 
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 _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 259 of file Channel.h.

◆ PlayerContainer

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

Definition at line 258 of file Channel.h.

Constructor & Destructor Documentation

◆ Channel() [1/4]

◆ Channel() [2/4]

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

◆ Channel() [3/4]

Channel::Channel ( Channel const &  )
delete

◆ Channel() [4/4]

Channel::Channel ( Channel &&  )
delete

◆ ~Channel()

Channel::~Channel ( )
default

Member Function Documentation

◆ Announce()

◆ Ban()

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

Definition at line 204 of file Channel.h.

◆ CheckPassword()

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

Definition at line 190 of file Channel.h.

Referenced by JoinChannel().

◆ DeclineInvite()

void Channel::DeclineInvite ( Player const *  player)

Definition at line 827 of file Channel.cpp.

◆ GetChannelId()

uint32 Channel::GetChannelId ( ) const
inline

◆ GetChannelName()

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

◆ GetFlags()

uint8 Channel::GetFlags ( ) const
inline

Definition at line 194 of file Channel.h.

Referenced by YouJoinedAppend::Append(), JoinNotify(), LeaveNotify(), List(), and SendMemberCount().

◆ GetName()

◆ GetNumPlayers()

uint32 Channel::GetNumPlayers ( ) const
inline

Definition at line 192 of file Channel.h.

Referenced by JoinNotify(), LeaveNotify(), ChannelMgr::LeftChannel(), and SendMemberCount().

◆ GetPlayerFlags()

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

Definition at line 249 of file Channel.h.

Referenced by JoinNotify().

◆ GetZoneEntry()

AreaTableEntry const * Channel::GetZoneEntry ( ) const
inline

Definition at line 197 of file Channel.h.

Referenced by Player::CleanupChannels(), and Player::UpdateLocalChannels().

◆ HasFlag()

bool Channel::HasFlag ( uint8  flag) const
inline

Definition at line 195 of file Channel.h.

Referenced by JoinChannel(), and ChatLogScript::OnChat().

◆ Invite()

◆ IsAnnounce()

bool Channel::IsAnnounce ( ) const
inline

Definition at line 182 of file Channel.h.

◆ IsBanned()

bool Channel::IsBanned ( ObjectGuid  guid) const
inlineprivate

Definition at line 247 of file Channel.h.

Referenced by Invite(), JoinChannel(), KickOrBan(), and UnBan().

◆ IsConstant()

bool Channel::IsConstant ( ) const
inline

◆ IsLFG()

bool Channel::IsLFG ( ) const
inline

Definition at line 180 of file Channel.h.

References CHANNEL_FLAG_LFG.

◆ IsOn()

bool Channel::IsOn ( ObjectGuid  who) const
inlineprivate

◆ JoinChannel()

◆ JoinNotify()

void Channel::JoinNotify ( ObjectGuid const &  guid) const

◆ Kick()

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

Definition at line 203 of file Channel.h.

◆ KickOrBan()

◆ LeaveChannel()

◆ LeaveNotify()

void Channel::LeaveNotify ( ObjectGuid const &  guid) const

◆ List()

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ Password()

◆ Say()

◆ SendMemberCount()

◆ SendToAll()

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

◆ SendToAllButOne()

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

Definition at line 899 of file Channel.cpp.

References _playersStore, and ObjectAccessor::FindConnectedPlayer().

Referenced by JoinNotify(), and LeaveNotify().

◆ SendToOne()

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

◆ SendWhoOwner()

void Channel::SendWhoOwner ( Player const *  player)

Definition at line 570 of file Channel.cpp.

References _ownerGuid, Object::GetGUID(), IsOn(), and SendToOne().

◆ SetAnnounce()

void Channel::SetAnnounce ( bool  announce)
inline

Definition at line 183 of file Channel.h.

Referenced by ChannelMgr::LoadFromDB().

◆ SetDirty()

void Channel::SetDirty ( )
inline

Definition at line 186 of file Channel.h.

Referenced by ChannelMgr::CreateCustomChannel().

◆ SetInvisible()

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

Definition at line 484 of file Channel.cpp.

References _isOwnerInvisible, _ownerGuid, _playersStore, and Object::GetGUID().

◆ SetMode()

◆ SetModerator() [1/2]

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

◆ SetModerator() [2/2]

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

Definition at line 216 of file Channel.h.

Referenced by SetMode().

◆ SetMute() [1/2]

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

◆ SetMute() [2/2]

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

Definition at line 218 of file Channel.h.

Referenced by SetMode().

◆ SetOwner() [1/2]

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

◆ SetOwner() [2/2]

◆ SetOwnership()

void Channel::SetOwnership ( bool  ownership)
inline

◆ SetPassword()

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

Definition at line 189 of file Channel.h.

Referenced by ChannelMgr::LoadFromDB().

◆ SilenceAll()

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

Definition at line 811 of file Channel.cpp.

◆ SilenceVoice()

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

Definition at line 815 of file Channel.cpp.

◆ UnBan()

◆ UnsetModerator()

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

Definition at line 217 of file Channel.h.

◆ UnsetMute()

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

Definition at line 219 of file Channel.h.

◆ UnsilenceAll()

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

Definition at line 819 of file Channel.cpp.

◆ UnsilenceVoice()

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

Definition at line 823 of file Channel.cpp.

◆ UpdateChannelInDB()

◆ VoiceOff()

void Channel::VoiceOff ( Player const *  player)

Definition at line 883 of file Channel.cpp.

◆ VoiceOn()

void Channel::VoiceOn ( Player const *  player)

Definition at line 879 of file Channel.cpp.

Member Data Documentation

◆ _announceEnabled

bool Channel::_announceEnabled
private

Definition at line 264 of file Channel.h.

Referenced by Announce(), JoinChannel(), LeaveChannel(), and UpdateChannelInDB().

◆ _bannedStore

BannedContainer Channel::_bannedStore
private

Definition at line 275 of file Channel.h.

Referenced by Channel(), KickOrBan(), UnBan(), and UpdateChannelInDB().

◆ _channelFlags

uint8 Channel::_channelFlags
private

Definition at line 268 of file Channel.h.

Referenced by Channel().

◆ _channelId

uint32 Channel::_channelId
private

Definition at line 269 of file Channel.h.

Referenced by GetName().

◆ _channelName

std::string Channel::_channelName
private

Definition at line 272 of file Channel.h.

Referenced by GetName(), and UpdateChannelInDB().

◆ _channelPassword

std::string Channel::_channelPassword
private

Definition at line 273 of file Channel.h.

Referenced by Password(), and UpdateChannelInDB().

◆ _channelTeam

uint32 Channel::_channelTeam
private

Definition at line 270 of file Channel.h.

Referenced by UpdateChannelInDB().

◆ _isDirty

bool Channel::_isDirty
private

Definition at line 261 of file Channel.h.

Referenced by Announce(), KickOrBan(), Password(), SetOwner(), UnBan(), and UpdateChannelInDB().

◆ _isOwnerInvisible

bool Channel::_isOwnerInvisible
private

Definition at line 266 of file Channel.h.

Referenced by JoinChannel(), LeaveChannel(), and SetInvisible().

◆ _nextActivityUpdateTime

time_t Channel::_nextActivityUpdateTime
private

Definition at line 262 of file Channel.h.

Referenced by JoinChannel(), and UpdateChannelInDB().

◆ _ownerGuid

ObjectGuid Channel::_ownerGuid
private

Definition at line 271 of file Channel.h.

Referenced by JoinChannel(), KickOrBan(), SendWhoOwner(), SetInvisible(), SetMode(), SetOwner(), and SetOwner().

◆ _ownershipEnabled

bool Channel::_ownershipEnabled
private

Definition at line 265 of file Channel.h.

Referenced by JoinChannel(), KickOrBan(), LeaveChannel(), and UpdateChannelInDB().

◆ _playersStore

◆ _zoneEntry

AreaTableEntry const* Channel::_zoneEntry
private

Definition at line 277 of file Channel.h.

Referenced by GetName().


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