![]() |
TrinityCore
|
#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="") | |
| 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 |
| 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) const |
| 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 (ObjectGuid const &guid) const |
| void | LeaveNotify (ObjectGuid const &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, PlayerInfo > | PlayerContainer |
| 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 |
|
private |
|
private |
| Channel::Channel | ( | ObjectGuid const & | guid, |
| uint32 | channelId, | ||
| uint32 | team = 0, |
||
| AreaTableEntry const * | zoneEntry = nullptr |
||
| ) |
Definition at line 38 of file Channel.cpp.
References _channelFlags, AllowItemLinks, CHANNEL_FLAG_CITY, CHANNEL_FLAG_LFG, CHANNEL_FLAG_NOT_LFG, CHANNEL_FLAG_TRADE, ChatChannelsEntry::GetFlags(), LinkedChannel, LookingForGroup, and sChatChannelsStore.
| Channel::Channel | ( | ObjectGuid const & | guid, |
| std::string const & | name, | ||
| uint32 | team = 0, |
||
| std::string const & | banList = "" |
||
| ) |
Definition at line 63 of file Channel.cpp.
References _bannedStore, ObjectGuid::SetRawValue(), TC_LOG_DEBUG, Trinity::Tokenize(), and ObjectGuid::ToString().
|
delete |
|
delete |
|
default |
| void Channel::AddonSay | ( | ObjectGuid const & | guid, |
| std::string const & | prefix, | ||
| std::string const & | what, | ||
| bool | isLogged | ||
| ) | const |
Definition at line 754 of file Channel.cpp.
References _channelGuid, _playersStore, CHAT_MSG_CHANNEL, Trinity::PacketSenderOwning< Packet >::Data, DEFAULT_LOCALE, ObjectGuid::Empty, ObjectAccessor::FindConnectedPlayer(), WorldSession::GetAccountGUID(), GetName(), Player::GetSession(), Channel::PlayerInfo::IsModerator(), Channel::PlayerInfo::IsMuted(), IsOn(), LANG_ADDON, LANG_ADDON_LOGGED, SendToAllWithAddon(), SendToOne(), and sWorld.
Referenced by WorldSession::HandleChatAddonMessage().
| void Channel::Announce | ( | Player const * | player | ) |
Definition at line 663 of file Channel.cpp.
References _announceEnabled, _isDirty, _playersStore, BaseEntity::GetGUID(), Player::GetSession(), WorldSession::HasPermission(), Channel::PlayerInfo::IsModerator(), IsOn(), rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR, SendToAll(), and SendToOne().
|
inline |
|
inline |
Definition at line 181 of file Channel.h.
Referenced by JoinChannel().
| void Channel::DeclineInvite | ( | Player const * | player | ) |
Definition at line 904 of file Channel.cpp.
|
inline |
Definition at line 166 of file Channel.h.
Referenced by YouJoinedAppend::Append(), YouLeftAppend::Append(), Player::CleanupChannels(), WorldSession::HandleChatMessage(), JoinNotify(), LeaveNotify(), and Player::UpdateLocalChannels().
|
static |
Definition at line 99 of file Channel.cpp.
References ASSERT_NOTNULL, ChatChannelsEntry::GetFlags(), LinkedChannel, ChatChannelsEntry::Name, ChatHandler::PGetParseString(), sChatChannelsStore, ChannelMgr::SpecialLinkedArea, and ZoneBased.
Referenced by ChannelMgr::GetChannel(), and GetName().
|
inline |
Definition at line 185 of file Channel.h.
Referenced by JoinNotify(), LeaveNotify(), and List().
|
inline |
| std::string Channel::GetName | ( | LocaleConstant | locale = DEFAULT_LOCALE | ) | const |
Definition at line 116 of file Channel.cpp.
References _channelId, _channelName, _zoneEntry, and GetChannelName().
Referenced by AddonSay(), JoinChannel(), JoinNotify(), LeaveChannel(), LeaveNotify(), List(), ChatLogScript::OnChat(), ChannelNameBuilder< PacketModifier >::operator()(), and Say().
|
inline |
Definition at line 183 of file Channel.h.
Referenced by ChannelMgr::LeftChannel().
|
inlineprivate |
Definition at line 239 of file Channel.h.
Referenced by JoinChannel(), and JoinNotify().
|
inline |
Definition at line 188 of file Channel.h.
Referenced by Player::CleanupChannels(), and Player::UpdateLocalChannels().
|
inline |
Definition at line 186 of file Channel.h.
Referenced by JoinChannel(), and ChatLogScript::OnChat().
| void Channel::Invite | ( | Player const * | player, |
| std::string const & | newp | ||
| ) |
Definition at line 802 of file Channel.cpp.
References ObjectAccessor::FindConnectedPlayerByName(), WorldSession::GetAccountGUID(), BaseEntity::GetGUID(), WorldObject::GetName(), Player::GetSession(), Player::GetSocial(), Player::GetTeam(), PlayerSocial::HasIgnore(), WorldSession::HasPermission(), IsBanned(), Player::isGMVisible(), IsOn(), rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL, and SendToOne().
|
inlineprivate |
Definition at line 237 of file Channel.h.
Referenced by Invite(), JoinChannel(), KickOrBan(), and UnBan().
|
inline |
Definition at line 167 of file Channel.h.
Referenced by ChannelOwnerAppend::Append(), Player::CleanupChannels(), JoinChannel(), JoinNotify(), LeaveChannel(), and LeaveNotify().
|
inline |
Definition at line 171 of file Channel.h.
References CHANNEL_FLAG_LFG.
|
inlineprivate |
Definition at line 236 of file Channel.h.
Referenced by AddonSay(), Announce(), Invite(), JoinChannel(), KickOrBan(), LeaveChannel(), List(), Password(), Say(), SendWhoOwner(), SetMode(), SetModerator(), SetMute(), SetOwner(), and UnBan().
| void Channel::JoinChannel | ( | Player * | player, |
| std::string const & | pass = "" |
||
| ) |
Definition at line 159 of file Channel.cpp.
References _announceEnabled, _channelFlags, _channelGuid, _channelId, _isOwnerInvisible, _nextActivityUpdateTime, _ownerGuid, _ownershipEnabled, _playersStore, CHANNEL_FLAG_LFG, CheckPassword(), CONFIG_RESTRICTED_LFG_CHANNEL, Trinity::PacketSenderOwning< Packet >::Data, Player::GetGroup(), BaseEntity::GetGUID(), GetName(), GetPlayerFlags(), WorldSession::GetSecurity(), Player::GetSession(), HasFlag(), WorldSession::HasPermission(), IsBanned(), IsConstant(), ObjectGuid::IsEmpty(), Player::isGMVisible(), Channel::PlayerInfo::IsInvisible(), IsOn(), AccountMgr::IsPlayerAccount(), Player::JoinedChannel(), JoinNotify(), rbac::RBAC_PERM_SILENTLY_JOIN_CHANNEL, SendToAll(), SendToOne(), Channel::PlayerInfo::SetInvisible(), Channel::PlayerInfo::SetModerator(), SetOwner(), and sWorld.
Referenced by Player::UpdateLocalChannels().
| void Channel::JoinNotify | ( | ObjectGuid const & | guid | ) | const |
Definition at line 908 of file Channel.cpp.
References Trinity::PacketSenderOwning< Packet >::Data, GetChannelId(), GetFlags(), GetName(), GetPlayerFlags(), IsConstant(), SendToAll(), SendToAllButOne(), and sWorld.
Referenced by JoinChannel().
|
inline |
| void Channel::KickOrBan | ( | Player const * | player, |
| std::string const & | badname, | ||
| bool | ban | ||
| ) |
Definition at line 326 of file Channel.cpp.
References _bannedStore, _isDirty, _ownerGuid, _ownershipEnabled, _playersStore, ObjectGuid::Empty, ObjectAccessor::FindConnectedPlayerByName(), BaseEntity::GetGUID(), Player::GetSession(), WorldSession::HasPermission(), IsBanned(), Channel::PlayerInfo::IsModerator(), IsOn(), Player::LeftChannel(), rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR, rbac::RBAC_PERM_SILENTLY_JOIN_CHANNEL, SendToAll(), SendToOne(), Channel::PlayerInfo::SetModerator(), and SetOwner().
| void Channel::LeaveChannel | ( | Player * | player, |
| bool | send = true, |
||
| bool | suspend = false |
||
| ) |
Definition at line 253 of file Channel.cpp.
References _announceEnabled, _channelId, _isOwnerInvisible, _ownershipEnabled, _playersStore, Trinity::PacketSenderOwning< Packet >::Data, BaseEntity::GetGUID(), GetName(), Player::GetSession(), WorldSession::HasPermission(), IsConstant(), IsOn(), Channel::PlayerInfo::IsOwner(), LeaveNotify(), Player::LeftChannel(), rbac::RBAC_PERM_SILENTLY_JOIN_CHANNEL, SendToAll(), SendToOne(), SetOwner(), and sWorld.
Referenced by Player::CleanupChannels(), and Player::UpdateLocalChannels().
| void Channel::LeaveNotify | ( | ObjectGuid const & | guid | ) | const |
Definition at line 948 of file Channel.cpp.
References Trinity::PacketSenderOwning< Packet >::Data, GetChannelId(), GetFlags(), GetName(), IsConstant(), SendToAll(), SendToAllButOne(), and sWorld.
Referenced by LeaveChannel().
| void Channel::List | ( | Player const * | player | ) | const |
always true?
Definition at line 622 of file Channel.cpp.
References WorldPackets::Channel::ChannelListResponse::_Channel, WorldPackets::Channel::ChannelListResponse::_ChannelFlags, _playersStore, CONFIG_GM_LEVEL_IN_WHO_LIST, WorldPackets::Channel::ChannelListResponse::Display, ObjectAccessor::FindConnectedPlayer(), GetFlags(), BaseEntity::GetGUID(), GetName(), WorldSession::GetPlayerInfo(), WorldSession::GetSecurity(), Player::GetSession(), WorldSession::GetSessionDbcLocale(), WorldSession::HasPermission(), IsOn(), Player::IsVisibleGloballyFor(), Player::m_playerData, WorldPackets::Channel::ChannelListResponse::Members, rbac::RBAC_PERM_WHO_SEE_ALL_SEC_LEVELS, Player::SendDirectMessage(), SendToOne(), sWorld, TC_LOG_DEBUG, and WorldPackets::Channel::ChannelListResponse::Write().
| void Channel::Password | ( | Player const * | player, |
| std::string const & | pass | ||
| ) |
Definition at line 437 of file Channel.cpp.
References _channelPassword, _isDirty, _playersStore, BaseEntity::GetGUID(), Player::GetSession(), WorldSession::HasPermission(), Channel::PlayerInfo::IsModerator(), IsOn(), rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR, SendToAll(), and SendToOne().
| void Channel::Say | ( | ObjectGuid const & | guid, |
| std::string const & | what, | ||
| uint32 | lang | ||
| ) | const |
Definition at line 702 of file Channel.cpp.
References _channelGuid, _playersStore, CHAT_MSG_CHANNEL, CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL, Trinity::PacketSenderOwning< Packet >::Data, ObjectGuid::Empty, ObjectAccessor::FindConnectedPlayer(), WorldSession::GetAccountGUID(), GetName(), Player::GetSession(), Channel::PlayerInfo::IsModerator(), Channel::PlayerInfo::IsMuted(), IsOn(), LANG_UNIVERSAL, SendToAll(), SendToOne(), and sWorld.
Referenced by WorldSession::HandleChatMessage().
|
private |
Definition at line 970 of file Channel.cpp.
References _playersStore, ObjectAccessor::FindConnectedPlayer(), and ObjectGuid::IsEmpty().
Referenced by Announce(), JoinChannel(), JoinNotify(), KickOrBan(), LeaveChannel(), LeaveNotify(), Password(), Say(), SetModerator(), SetMute(), SetOwner(), and UnBan().
|
private |
Definition at line 981 of file Channel.cpp.
References _playersStore, and ObjectAccessor::FindConnectedPlayer().
Referenced by JoinNotify(), and LeaveNotify().
|
private |
Definition at line 1001 of file Channel.cpp.
References _playersStore, ObjectAccessor::FindConnectedPlayer(), and ObjectGuid::IsEmpty().
Referenced by AddonSay().
|
private |
Definition at line 992 of file Channel.cpp.
References ObjectAccessor::FindConnectedPlayer().
Referenced by AddonSay(), Announce(), Invite(), JoinChannel(), KickOrBan(), LeaveChannel(), List(), Password(), Say(), SendWhoOwner(), SetMode(), SetOwner(), and UnBan().
| void Channel::SendWhoOwner | ( | Player const * | player | ) |
Definition at line 605 of file Channel.cpp.
References _ownerGuid, BaseEntity::GetGUID(), IsOn(), and SendToOne().
|
inline |
Definition at line 174 of file Channel.h.
Referenced by ChannelMgr::LoadFromDB().
|
inline |
Definition at line 177 of file Channel.h.
Referenced by ChannelMgr::CreateCustomChannel().
| void Channel::SetInvisible | ( | Player const * | player, |
| bool | on | ||
| ) |
Definition at line 519 of file Channel.cpp.
References _isOwnerInvisible, _ownerGuid, _playersStore, and BaseEntity::GetGUID().
| void Channel::SetMode | ( | Player const * | player, |
| std::string const & | p2n, | ||
| bool | mod, | ||
| bool | set | ||
| ) |
Definition at line 467 of file Channel.cpp.
References _ownerGuid, _playersStore, ObjectGuid::Empty, ObjectAccessor::FindConnectedPlayerByName(), BaseEntity::GetGUID(), WorldObject::GetName(), Player::GetSession(), Player::GetTeam(), WorldSession::HasPermission(), ObjectGuid::IsEmpty(), Channel::PlayerInfo::IsModerator(), IsOn(), rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR, rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL, SendToOne(), SetModerator(), and SetMute().
|
private |
Definition at line 532 of file Channel.cpp.
References _playersStore, Channel::PlayerInfo::GetFlags(), Channel::PlayerInfo::IsModerator(), IsOn(), SendToAll(), and Channel::PlayerInfo::SetModerator().
|
inline |
|
private |
Definition at line 549 of file Channel.cpp.
References _playersStore, Channel::PlayerInfo::GetFlags(), Channel::PlayerInfo::IsMuted(), IsOn(), SendToAll(), and Channel::PlayerInfo::SetMuted().
|
inline |
| void Channel::SetOwner | ( | ObjectGuid const & | guid, |
| bool | exclaim = true |
||
| ) |
Definition at line 861 of file Channel.cpp.
References _isDirty, _ownerGuid, _playersStore, ObjectGuid::IsEmpty(), and SendToAll().
Referenced by JoinChannel(), KickOrBan(), LeaveChannel(), and SetOwner().
| void Channel::SetOwner | ( | Player const * | player, |
| std::string const & | name | ||
| ) |
Definition at line 566 of file Channel.cpp.
References _ownerGuid, _playersStore, ObjectGuid::Empty, ObjectAccessor::FindConnectedPlayerByName(), BaseEntity::GetGUID(), Player::GetSession(), Player::GetTeam(), WorldSession::HasPermission(), IsOn(), rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR, rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL, SendToOne(), Channel::PlayerInfo::SetModerator(), and SetOwner().
|
inline |
Definition at line 221 of file Channel.h.
Referenced by message_commandscript::HandleChannelSetOwnership(), and ChannelMgr::LoadFromDB().
|
inline |
Definition at line 180 of file Channel.h.
Referenced by ChannelMgr::LoadFromDB().
| void Channel::SilenceAll | ( | Player const * | player, |
| std::string const & | name | ||
| ) |
Definition at line 896 of file Channel.cpp.
| void Channel::UnBan | ( | Player const * | player, |
| std::string const & | badname | ||
| ) |
Definition at line 396 of file Channel.cpp.
References _bannedStore, _isDirty, _playersStore, ObjectGuid::Empty, ObjectAccessor::FindConnectedPlayerByName(), BaseEntity::GetGUID(), Player::GetSession(), WorldSession::HasPermission(), IsBanned(), ObjectGuid::IsEmpty(), Channel::PlayerInfo::IsModerator(), IsOn(), rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR, SendToAll(), and SendToOne().
|
inline |
|
inline |
| void Channel::UnsilenceAll | ( | Player const * | player, |
| std::string const & | name | ||
| ) |
Definition at line 900 of file Channel.cpp.
| void Channel::UpdateChannelInDB | ( | ) |
Definition at line 124 of file Channel.cpp.
References _announceEnabled, _bannedStore, _channelName, _channelPassword, _channelTeam, _isDirty, _nextActivityUpdateTime, _ownershipEnabled, _playersStore, CHAR_UPD_CHANNEL, CHAR_UPD_CHANNEL_USAGE, CharacterDatabase, CONFIG_PRESERVE_CUSTOM_CHANNEL_INTERVAL, GameTime::GetGameTime(), MINUTE, PreparedStatementBase::setBool(), PreparedStatementBase::setString(), PreparedStatementBase::setUInt32(), sWorld, and urand().
|
private |
Definition at line 254 of file Channel.h.
Referenced by Announce(), JoinChannel(), LeaveChannel(), and UpdateChannelInDB().
|
private |
Definition at line 266 of file Channel.h.
Referenced by Channel(), KickOrBan(), UnBan(), and UpdateChannelInDB().
|
private |
Definition at line 258 of file Channel.h.
Referenced by Channel(), and JoinChannel().
|
private |
Definition at line 261 of file Channel.h.
Referenced by AddonSay(), JoinChannel(), and Say().
|
private |
Definition at line 259 of file Channel.h.
Referenced by GetName(), JoinChannel(), and LeaveChannel().
|
private |
Definition at line 263 of file Channel.h.
Referenced by GetName(), and UpdateChannelInDB().
|
private |
Definition at line 264 of file Channel.h.
Referenced by Password(), and UpdateChannelInDB().
|
private |
Definition at line 260 of file Channel.h.
Referenced by UpdateChannelInDB().
|
private |
Definition at line 251 of file Channel.h.
Referenced by Announce(), KickOrBan(), Password(), SetOwner(), UnBan(), and UpdateChannelInDB().
|
private |
Definition at line 256 of file Channel.h.
Referenced by JoinChannel(), LeaveChannel(), and SetInvisible().
|
private |
Definition at line 252 of file Channel.h.
Referenced by JoinChannel(), and UpdateChannelInDB().
|
private |
Definition at line 262 of file Channel.h.
Referenced by JoinChannel(), KickOrBan(), SendWhoOwner(), SetInvisible(), SetMode(), SetOwner(), and SetOwner().
|
private |
Definition at line 255 of file Channel.h.
Referenced by JoinChannel(), KickOrBan(), LeaveChannel(), and UpdateChannelInDB().
|
private |
Definition at line 265 of file Channel.h.
Referenced by AddonSay(), Announce(), JoinChannel(), KickOrBan(), LeaveChannel(), List(), Password(), Say(), SendToAll(), SendToAllButOne(), SendToAllWithAddon(), SetInvisible(), SetMode(), SetModerator(), SetMute(), SetOwner(), SetOwner(), UnBan(), and UpdateChannelInDB().
|
private |