![]() |
TrinityCore
|
#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 |
|
private |
|
private |
| Channel::Channel | ( | uint32 | channelId, |
| uint32 | team = 0, |
||
| AreaTableEntry const * | zoneEntry = nullptr |
||
| ) |
Definition at line 38 of file Channel.cpp.
References _channelFlags, CHANNEL_DBC_FLAG_CITY_ONLY2, CHANNEL_DBC_FLAG_LFG, CHANNEL_DBC_FLAG_TRADE, CHANNEL_FLAG_CITY, CHANNEL_FLAG_LFG, CHANNEL_FLAG_NOT_LFG, CHANNEL_FLAG_TRADE, ChatChannelsEntry::Flags, and sChatChannelsStore.
| Channel::Channel | ( | std::string const & | name, |
| uint32 | team, | ||
| std::string const & | banList = "" |
||
| ) |
Definition at line 62 of file Channel.cpp.
References _bannedStore, ObjectGuid::SetRawValue(), TC_LOG_DEBUG, Trinity::Tokenize(), and ObjectGuid::ToString().
|
delete |
|
delete |
|
default |
| void Channel::Announce | ( | Player const * | player | ) |
Definition at line 628 of file Channel.cpp.
References _announceEnabled, _isDirty, _playersStore, Object::GetGUID(), Player::GetSession(), WorldSession::HasPermission(), Channel::PlayerInfo::IsModerator(), IsOn(), rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR, SendToAll(), and SendToOne().
|
inline |
|
inline |
Definition at line 190 of file Channel.h.
Referenced by JoinChannel().
| void Channel::DeclineInvite | ( | Player const * | player | ) |
Definition at line 827 of file Channel.cpp.
|
inline |
Definition at line 178 of file Channel.h.
Referenced by YouJoinedAppend::Append(), YouLeftAppend::Append(), Player::CleanupChannels(), and Player::UpdateLocalChannels().
|
static |
Definition at line 88 of file Channel.cpp.
References ASSERT_NOTNULL, CHANNEL_DBC_FLAG_CITY_ONLY, CHANNEL_DBC_FLAG_GLOBAL, ChatChannelsEntry::Flags, LANG_CHANNEL_CITY, ChatChannelsEntry::Name, ChatHandler::PGetParseString(), sChatChannelsStore, and sObjectMgr.
Referenced by ChannelMgr::GetChannel(), and GetName().
|
inline |
Definition at line 194 of file Channel.h.
Referenced by YouJoinedAppend::Append(), JoinNotify(), LeaveNotify(), List(), and SendMemberCount().
| std::string Channel::GetName | ( | LocaleConstant | locale = DEFAULT_LOCALE | ) | const |
Definition at line 105 of file Channel.cpp.
References _channelId, _channelName, _zoneEntry, and GetChannelName().
Referenced by JoinNotify(), LeaveNotify(), List(), ChatLogScript::OnChat(), ChannelNameBuilder< PacketModifier >::operator()(), Say(), and SendMemberCount().
|
inline |
Definition at line 192 of file Channel.h.
Referenced by JoinNotify(), LeaveNotify(), ChannelMgr::LeftChannel(), and SendMemberCount().
|
inlineprivate |
Definition at line 249 of file Channel.h.
Referenced by JoinNotify().
|
inline |
Definition at line 197 of file Channel.h.
Referenced by Player::CleanupChannels(), and Player::UpdateLocalChannels().
|
inline |
Definition at line 195 of file Channel.h.
Referenced by JoinChannel(), and ChatLogScript::OnChat().
| void Channel::Invite | ( | Player const * | player, |
| std::string const & | newp | ||
| ) |
Definition at line 717 of file Channel.cpp.
References ObjectAccessor::FindConnectedPlayerByName(), Object::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 247 of file Channel.h.
Referenced by Invite(), JoinChannel(), KickOrBan(), and UnBan().
|
inline |
Definition at line 179 of file Channel.h.
Referenced by ChannelOwnerAppend::Append(), Player::CleanupChannels(), JoinChannel(), JoinNotify(), LeaveChannel(), and LeaveNotify().
|
inline |
Definition at line 180 of file Channel.h.
References CHANNEL_FLAG_LFG.
|
inlineprivate |
Definition at line 246 of file Channel.h.
Referenced by 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 148 of file Channel.cpp.
References _announceEnabled, _isOwnerInvisible, _nextActivityUpdateTime, _ownerGuid, _ownershipEnabled, _playersStore, CHANNEL_FLAG_LFG, CheckPassword(), CONFIG_RESTRICTED_LFG_CHANNEL, Player::GetGroup(), Object::GetGUID(), 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 831 of file Channel.cpp.
References GetFlags(), GetName(), GetNumPlayers(), GetPlayerFlags(), WorldPacket::Initialize(), IsConstant(), SendToAll(), SendToAllButOne(), SMSG_USERLIST_ADD, SMSG_USERLIST_UPDATE, and sWorld.
Referenced by JoinChannel().
|
inline |
| void Channel::KickOrBan | ( | Player const * | player, |
| std::string const & | badname, | ||
| bool | ban | ||
| ) |
Definition at line 291 of file Channel.cpp.
References _bannedStore, _isDirty, _ownerGuid, _ownershipEnabled, _playersStore, ObjectGuid::Empty, ObjectAccessor::FindConnectedPlayerByName(), Object::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 228 of file Channel.cpp.
References _announceEnabled, _isOwnerInvisible, _ownershipEnabled, _playersStore, Object::GetGUID(), Player::GetSession(), WorldSession::HasPermission(), IsConstant(), IsOn(), Channel::PlayerInfo::IsOwner(), LeaveNotify(), Player::LeftChannel(), rbac::RBAC_PERM_SILENTLY_JOIN_CHANNEL, SendToAll(), SendToOne(), and SetOwner().
Referenced by Player::CleanupChannels(), and Player::UpdateLocalChannels().
| void Channel::LeaveNotify | ( | ObjectGuid const & | guid | ) | const |
Definition at line 851 of file Channel.cpp.
References GetFlags(), GetName(), GetNumPlayers(), WorldPacket::Initialize(), IsConstant(), SendToAll(), SendToAllButOne(), SMSG_USERLIST_REMOVE, and sWorld.
Referenced by LeaveChannel().
| void Channel::List | ( | Player const * | player | ) | const |
always true?
Definition at line 587 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(), Object::GetGUID(), GetName(), WorldSession::GetPlayerInfo(), WorldSession::GetSecurity(), Player::GetSession(), WorldSession::GetSessionDbcLocale(), WorldSession::HasPermission(), IsOn(), Player::IsVisibleGloballyFor(), 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 402 of file Channel.cpp.
References _channelPassword, _isDirty, _playersStore, Object::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 667 of file Channel.cpp.
References _playersStore, CHAT_MSG_CHANNEL, CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL, DEFAULT_LOCALE, ObjectGuid::Empty, ObjectAccessor::FindConnectedPlayer(), GetName(), WorldPackets::Chat::Chat::Initialize(), Channel::PlayerInfo::IsModerator(), Channel::PlayerInfo::IsMuted(), IsOn(), LANG_UNIVERSAL, WorldPackets::ServerPacket::Move(), WorldPackets::Chat::Chat::SenderGUID, SendToAll(), SendToOne(), sWorld, WorldPackets::Chat::Chat::TargetGUID, and WorldPackets::Chat::Chat::Write().
| void Channel::SendMemberCount | ( | Player const * | player | ) | const |
Definition at line 870 of file Channel.cpp.
References WorldPackets::Channel::ChannelMemberCount::_ChannelFlags, WorldPackets::Channel::ChannelMemberCount::ChannelName, GetFlags(), GetName(), GetNumPlayers(), Player::GetSession(), WorldSession::GetSessionDbcLocale(), WorldPackets::Channel::ChannelMemberCount::MemberCount, Player::SendDirectMessage(), and WorldPackets::Channel::ChannelMemberCount::Write().
|
private |
Definition at line 888 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 899 of file Channel.cpp.
References _playersStore, and ObjectAccessor::FindConnectedPlayer().
Referenced by JoinNotify(), and LeaveNotify().
|
private |
Definition at line 910 of file Channel.cpp.
References ObjectAccessor::FindConnectedPlayer().
Referenced by Announce(), Invite(), JoinChannel(), KickOrBan(), LeaveChannel(), List(), Password(), Say(), SendWhoOwner(), SetMode(), SetOwner(), and UnBan().
| void Channel::SendWhoOwner | ( | Player const * | player | ) |
Definition at line 570 of file Channel.cpp.
References _ownerGuid, Object::GetGUID(), IsOn(), and SendToOne().
|
inline |
Definition at line 183 of file Channel.h.
Referenced by ChannelMgr::LoadFromDB().
|
inline |
Definition at line 186 of file Channel.h.
Referenced by ChannelMgr::CreateCustomChannel().
| void Channel::SetInvisible | ( | Player const * | player, |
| bool | on | ||
| ) |
Definition at line 484 of file Channel.cpp.
References _isOwnerInvisible, _ownerGuid, _playersStore, and Object::GetGUID().
| void Channel::SetMode | ( | Player const * | player, |
| std::string const & | p2n, | ||
| bool | mod, | ||
| bool | set | ||
| ) |
Definition at line 432 of file Channel.cpp.
References _ownerGuid, _playersStore, ObjectGuid::Empty, ObjectAccessor::FindConnectedPlayerByName(), Object::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 497 of file Channel.cpp.
References _playersStore, Channel::PlayerInfo::GetFlags(), Channel::PlayerInfo::IsModerator(), IsOn(), SendToAll(), and Channel::PlayerInfo::SetModerator().
|
inline |
|
private |
Definition at line 514 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 776 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 531 of file Channel.cpp.
References _ownerGuid, _playersStore, ObjectGuid::Empty, ObjectAccessor::FindConnectedPlayerByName(), Object::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 231 of file Channel.h.
Referenced by message_commandscript::HandleChannelSetOwnership(), and ChannelMgr::LoadFromDB().
|
inline |
Definition at line 189 of file Channel.h.
Referenced by ChannelMgr::LoadFromDB().
| void Channel::SilenceAll | ( | Player const * | player, |
| std::string const & | name | ||
| ) |
Definition at line 811 of file Channel.cpp.
| void Channel::SilenceVoice | ( | Player const * | player, |
| std::string const & | name | ||
| ) |
Definition at line 815 of file Channel.cpp.
| void Channel::UnBan | ( | Player const * | player, |
| std::string const & | badname | ||
| ) |
Definition at line 361 of file Channel.cpp.
References _bannedStore, _isDirty, _playersStore, ObjectGuid::Empty, ObjectAccessor::FindConnectedPlayerByName(), Object::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 819 of file Channel.cpp.
| void Channel::UnsilenceVoice | ( | Player const * | player, |
| std::string const & | name | ||
| ) |
Definition at line 823 of file Channel.cpp.
| void Channel::UpdateChannelInDB | ( | ) |
Definition at line 113 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().
| void Channel::VoiceOff | ( | Player const * | player | ) |
Definition at line 883 of file Channel.cpp.
| void Channel::VoiceOn | ( | Player const * | player | ) |
Definition at line 879 of file Channel.cpp.
|
private |
Definition at line 264 of file Channel.h.
Referenced by Announce(), JoinChannel(), LeaveChannel(), and UpdateChannelInDB().
|
private |
Definition at line 275 of file Channel.h.
Referenced by Channel(), KickOrBan(), UnBan(), and UpdateChannelInDB().
|
private |
|
private |
|
private |
Definition at line 272 of file Channel.h.
Referenced by GetName(), and UpdateChannelInDB().
|
private |
Definition at line 273 of file Channel.h.
Referenced by Password(), and UpdateChannelInDB().
|
private |
Definition at line 270 of file Channel.h.
Referenced by UpdateChannelInDB().
|
private |
Definition at line 261 of file Channel.h.
Referenced by Announce(), KickOrBan(), Password(), SetOwner(), UnBan(), and UpdateChannelInDB().
|
private |
Definition at line 266 of file Channel.h.
Referenced by JoinChannel(), LeaveChannel(), and SetInvisible().
|
private |
Definition at line 262 of file Channel.h.
Referenced by JoinChannel(), and UpdateChannelInDB().
|
private |
Definition at line 271 of file Channel.h.
Referenced by JoinChannel(), KickOrBan(), SendWhoOwner(), SetInvisible(), SetMode(), SetOwner(), and SetOwner().
|
private |
Definition at line 265 of file Channel.h.
Referenced by JoinChannel(), KickOrBan(), LeaveChannel(), and UpdateChannelInDB().
|
private |
Definition at line 274 of file Channel.h.
Referenced by Announce(), JoinChannel(), KickOrBan(), LeaveChannel(), List(), Password(), Say(), SendToAll(), SendToAllButOne(), SetInvisible(), SetMode(), SetModerator(), SetMute(), SetOwner(), SetOwner(), UnBan(), and UpdateChannelInDB().
|
private |