![]() |
TrinityCore
|
#include <ChannelMgr.h>
Public Member Functions | |
| void | SaveToDB () |
| Channel * | GetSystemChannel (uint32 channelId, AreaTableEntry const *zoneEntry=nullptr) |
| Channel * | CreateCustomChannel (std::string const &name) |
| Channel * | GetCustomChannel (std::string const &name) const |
| Channel * | GetChannel (uint32 channelId, std::string const &name, Player *player, bool pkt=true, AreaTableEntry const *zoneEntry=nullptr) const |
| void | LeftChannel (uint32 channelId, AreaTableEntry const *zoneEntry) |
Static Public Member Functions | |
| static void | LoadFromDB () |
| static ChannelMgr * | ForTeam (uint32 team) |
| static Channel * | GetChannelForPlayerByNamePart (std::string const &namePart, Player *playerSearcher) |
Protected Member Functions | |
| ChannelMgr (uint32 team) | |
| ~ChannelMgr () | |
Private Types | |
| typedef std::unordered_map< std::wstring, Channel * > | CustomChannelContainer |
| typedef std::unordered_map< std::pair< uint32, uint32 >, Channel * > | BuiltinChannelContainer |
Static Private Member Functions | |
| static void | SendNotOnChannelNotify (Player const *player, std::string const &name) |
Private Attributes | |
| CustomChannelContainer | _customChannels |
| BuiltinChannelContainer | _channels |
| uint32 const | _team |
Definition at line 30 of file ChannelMgr.h.
|
private |
Definition at line 33 of file ChannelMgr.h.
|
private |
Definition at line 32 of file ChannelMgr.h.
|
inlineexplicitprotected |
Definition at line 36 of file ChannelMgr.h.
|
protected |
Definition at line 28 of file ChannelMgr.cpp.
References _channels, and _customChannels.
| Channel * ChannelMgr::CreateCustomChannel | ( | std::string const & | name | ) |
Definition at line 179 of file ChannelMgr.cpp.
References _customChannels, _team, Channel::SetDirty(), Utf8toWStr(), and wstrToLower().
Referenced by WorldSession::HandleJoinChannel().
|
static |
Definition at line 115 of file ChannelMgr.cpp.
References ALLIANCE, CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL, HORDE, and sWorld.
Referenced by Player::CleanupChannels(), message_commandscript::HandleChannelSetOwnership(), WorldSession::HandleJoinChannel(), WorldSession::HandleLeaveChannel(), LoadFromDB(), World::Update(), and Player::UpdateLocalChannels().
| Channel * ChannelMgr::GetChannel | ( | uint32 | channelId, |
| std::string const & | name, | ||
| Player * | player, | ||
| bool | pkt = true, |
||
| AreaTableEntry const * | zoneEntry = nullptr |
||
| ) | const |
Definition at line 212 of file ChannelMgr.cpp.
References _channels, _customChannels, CHANNEL_DBC_FLAG_CITY_ONLY, CHANNEL_DBC_FLAG_GLOBAL, ChatChannelsEntry::Flags, Channel::GetChannelName(), Player::GetSession(), WorldSession::GetSessionDbcLocale(), AreaTableEntry::ID, sChatChannelsStore, SendNotOnChannelNotify(), Utf8toWStr(), and wstrToLower().
|
static |
Definition at line 132 of file ChannelMgr.cpp.
References Player::GetJoinedChannels(), Player::GetSession(), WorldSession::GetSessionDbcLocale(), Utf8toWStr(), and wstrToLower().
Referenced by WorldSession::HandleChannelCommand(), WorldSession::HandleChannelPassword(), WorldSession::HandleChannelPlayerCommand(), and WorldSession::HandleChatMessage().
| Channel * ChannelMgr::GetCustomChannel | ( | std::string const & | name | ) | const |
Definition at line 198 of file ChannelMgr.cpp.
References _customChannels, Utf8toWStr(), and wstrToLower().
Referenced by WorldSession::HandleJoinChannel().
| Channel * ChannelMgr::GetSystemChannel | ( | uint32 | channelId, |
| AreaTableEntry const * | zoneEntry = nullptr |
||
| ) |
Definition at line 161 of file ChannelMgr.cpp.
References _channels, _team, CHANNEL_DBC_FLAG_CITY_ONLY, CHANNEL_DBC_FLAG_GLOBAL, ChatChannelsEntry::Flags, AreaTableEntry::ID, and sChatChannelsStore.
Referenced by WorldSession::HandleJoinChannel(), and Player::UpdateLocalChannels().
| void ChannelMgr::LeftChannel | ( | uint32 | channelId, |
| AreaTableEntry const * | zoneEntry | ||
| ) |
Definition at line 257 of file ChannelMgr.cpp.
References _channels, CHANNEL_DBC_FLAG_CITY_ONLY, CHANNEL_DBC_FLAG_GLOBAL, ChatChannelsEntry::Flags, Channel::GetNumPlayers(), AreaTableEntry::ID, and sChatChannelsStore.
Referenced by Player::UpdateLocalChannels().
|
static |
Definition at line 37 of file ChannelMgr.cpp.
References _customChannels, CHAR_DEL_CHANNEL, CHAR_DEL_OLD_CHANNELS, CharacterDatabase, CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION, CONFIG_PRESERVE_CUSTOM_CHANNELS, DAY, ForTeam(), Field::GetBool(), getMSTime(), GetMSTimeDiffToNow(), Field::GetString(), Field::GetUInt32(), Channel::SetAnnounce(), Channel::SetOwnership(), Channel::SetPassword(), PreparedStatementBase::setString(), PreparedStatementBase::setUInt32(), sWorld, TC_LOG_ERROR, TC_LOG_INFO, and Utf8toWStr().
Referenced by World::SetInitialWorldSettings().
| void ChannelMgr::SaveToDB | ( | ) |
Definition at line 155 of file ChannelMgr.cpp.
References _customChannels.
Referenced by World::Update().
|
staticprivate |
Definition at line 278 of file ChannelMgr.cpp.
References WorldPackets::Channel::ChannelNotify::_Channel, CHAT_NOT_MEMBER_NOTICE, Player::SendDirectMessage(), WorldPackets::Channel::ChannelNotify::Type, and WorldPackets::Channel::ChannelNotify::Write().
Referenced by GetChannel().
|
private |
Definition at line 53 of file ChannelMgr.h.
Referenced by GetChannel(), GetSystemChannel(), LeftChannel(), and ~ChannelMgr().
|
private |
Definition at line 52 of file ChannelMgr.h.
Referenced by CreateCustomChannel(), GetChannel(), GetCustomChannel(), LoadFromDB(), SaveToDB(), and ~ChannelMgr().
|
private |
Definition at line 54 of file ChannelMgr.h.
Referenced by CreateCustomChannel(), and GetSystemChannel().