40 _nextActivityUpdateTime(0),
41 _announceEnabled(false),
42 _ownershipEnabled(false),
43 _isOwnerInvisible(false),
45 _channelId(channelId),
64 _nextActivityUpdateTime(0),
65 _announceEnabled(true),
66 _ownershipEnabled(true),
67 _isOwnerInvisible(false),
77 banned.
SetRawValue(Trinity::StringTo<uint64>(guid).value_or(0));
81 TC_LOG_DEBUG(
"chat.system",
"Channel({}) loaded player {} into bannedStore", name, banned.
ToString());
101 channelName = channelEntry->
Name[locale];
118 std::ostringstream banlist;
120 banlist << guid.GetRawValue() <<
' ';
252 bool changeowner = info.
IsOwner();
269 PlayerContainer::iterator itr;
272 if (!itr->second.IsInvisible())
280 itr->second.SetModerator(
true);
285 if (itr->second.IsInvisible())
314 if (!bad || !victim || !
IsOn(victim))
490 itr->second.SetInvisible(on);
520 if (playerInfo.
IsMuted() != set)
554 if (!newp || !victim || !
IsOn(victim) ||
599 TC_LOG_DEBUG(
"chat.system",
"SMSG_CHANNEL_LIST {} Channel: {}",
621 list.
Members.emplace_back(i.first, i.second.GetFlags());
711 data = packet.
Move();
782 itr->second.SetOwner(
false);
792 uint8 oldFlag = itr->second.GetFlags();
793 itr->second.SetModerator(
true);
794 itr->second.SetOwner(
true);
887template <
class Builder>
894 if (guid.
IsEmpty() || !player->GetSocial()->HasIgnore(guid))
898template <
class Builder>
909template <
class Builder>
@ CHANNEL_DBC_FLAG_CITY_ONLY
@ CHANNEL_DBC_FLAG_GLOBAL
@ CHANNEL_DBC_FLAG_CITY_ONLY2
DBCStorage< ChatChannelsEntry > sChatChannelsStore(ChatChannelsEntryfmt)
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
#define ASSERT_NOTNULL(pointer)
#define TC_LOG_DEBUG(filterType__,...)
uint32 urand(uint32 min, uint32 max)
static bool IsPlayerAccount(uint32 gmlevel)
void List(Player const *player) const
void Password(Player const *player, std::string const &pass)
void SilenceVoice(Player const *player, std::string const &name)
BannedContainer _bannedStore
void LeaveNotify(ObjectGuid const &guid) const
void JoinChannel(Player *player, std::string const &pass="")
std::string GetName(LocaleConstant locale=DEFAULT_LOCALE) const
void SendToOne(Builder &builder, ObjectGuid const &who) const
bool HasFlag(uint8 flag) const
void SendToAllButOne(Builder &builder, ObjectGuid const &who) const
Channel(uint32 channelId, uint32 team=0, AreaTableEntry const *zoneEntry=nullptr)
void JoinNotify(ObjectGuid const &guid) const
time_t _nextActivityUpdateTime
void VoiceOn(Player const *player)
void SetMute(Player const *player, std::string const &newname)
void SetModerator(Player const *player, std::string const &newname)
void KickOrBan(Player const *player, std::string const &badname, bool ban)
void SendWhoOwner(Player const *player)
void SendToAll(Builder &builder, ObjectGuid const &guid=ObjectGuid::Empty) const
bool CheckPassword(std::string const &password) const
bool IsOn(ObjectGuid who) const
void UnsilenceAll(Player const *player, std::string const &name)
void UnsilenceVoice(Player const *player, std::string const &name)
void SetOwner(ObjectGuid const &guid, bool exclaim=true)
void UnBan(Player const *player, std::string const &badname)
void SilenceAll(Player const *player, std::string const &name)
uint8 GetPlayerFlags(ObjectGuid const &guid) const
void SetMode(Player const *player, std::string const &p2n, bool mod, bool set)
void Say(ObjectGuid const &guid, std::string const &what, uint32 lang) const
static void GetChannelName(std::string &channelName, uint32 channelId, LocaleConstant locale, AreaTableEntry const *zoneEntry)
void DeclineInvite(Player const *player)
void SetInvisible(Player const *player, bool on)
void Announce(Player const *player)
void Invite(Player const *player, std::string const &newp)
uint32 GetNumPlayers() const
void SendMemberCount(Player const *player) const
bool IsBanned(ObjectGuid guid) const
AreaTableEntry const * _zoneEntry
void VoiceOff(Player const *player)
std::string _channelPassword
void LeaveChannel(Player *player, bool send=true, bool suspend=false)
PlayerContainer _playersStore
static std::string PGetParseString(std::string_view fmt, Args &&... args)
static ObjectGuid const Empty
void SetRawValue(uint64 guid)
std::string ToString() const
static ObjectGuid GetGUID(Object const *o)
bool HasIgnore(ObjectGuid const &ignoreGuid)
void SendDirectMessage(WorldPacket const *data) const
WorldSession * GetSession() const
bool IsVisibleGloballyFor(Player const *player) const
PlayerSocial * GetSocial()
void LeftChannel(Channel *c)
void JoinedChannel(Channel *c)
void setUInt32(uint8 index, uint32 value)
void setBool(uint8 index, bool value)
void setString(uint8 index, std::string const &value)
std::string const & GetName() const
void Initialize(uint16 opcode, size_t newres=200)
std::string _Channel
Channel Name.
std::vector< ChannelPlayer > Members
WorldPacket const * Write() override
WorldPacket const * Write() override
void Initialize(ChatMsg chatType, Language language, WorldObject const *sender, WorldObject const *receiver, std::string_view message, uint32 achievementId=0, std::string_view channelName="", LocaleConstant locale=DEFAULT_LOCALE, std::string_view addonPrefix="")
WorldPacket const * Write() override
AccountTypes GetSecurity() const
LocaleConstant GetSessionDbcLocale() const
std::string GetPlayerInfo() const
bool HasPermission(uint32 permissionId)
@ CONFIG_PRESERVE_CUSTOM_CHANNEL_INTERVAL
@ CONFIG_GM_LEVEL_IN_WHO_LIST
@ CONFIG_RESTRICTED_LFG_CHANNEL
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL
TC_GAME_API Player * FindConnectedPlayerByName(std::string_view name)
TC_GAME_API Player * FindConnectedPlayer(ObjectGuid const &)
TC_COMMON_API std::vector< std::string_view > Tokenize(std::string_view str, char sep, bool keepEmpty)
@ RBAC_PERM_SILENTLY_JOIN_CHANNEL
@ RBAC_PERM_WHO_SEE_ALL_SEC_LEVELS
@ RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR
@ RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL
void SetModerator(bool state)
void SetInvisible(bool on)
void SetMuted(bool state)