38 _nextActivityUpdateTime(0),
39 _announceEnabled(false),
40 _ownershipEnabled(false),
41 _isOwnerInvisible(false),
43 _channelId(channelId),
65 _nextActivityUpdateTime(0),
66 _announceEnabled(true),
67 _ownershipEnabled(true),
68 _isOwnerInvisible(false),
80 banned.
SetRawValue(Trinity::StringTo<uint64>(guid).value_or(0));
84 TC_LOG_DEBUG(
"chat.system",
"Channel({}) loaded player {} into bannedStore", name, banned.
ToString());
104 channelName = channelEntry->
Name[locale];
121 std::ostringstream banlist;
123 banlist << iter->GetRawValue() <<
' ';
125 std::string banListStr = banlist.str();
258 bool changeowner = info.
IsOwner();
276 PlayerContainer::iterator itr;
279 if (!itr->second.IsInvisible())
287 itr->second.SetModerator(
true);
292 if (itr->second.IsInvisible())
321 if (!bad || !victim || !
IsOn(victim))
468 if (!newp || !victim || !
IsOn(victim) ||
499 itr->second.SetInvisible(on);
529 if (playerInfo.
IsMuted() != set)
563 if (!newp || !victim || !
IsOn(victim) ||
608 TC_LOG_DEBUG(
"chat.system",
"SMSG_CHANNEL_LIST {} Channel: {}",
616 size_t pos = data.
wpos();
634 data <<
uint8(i->second.flags);
715 ChatHandler::BuildChatPacket(data,
CHAT_MSG_CHANNEL,
Language(lang), guid, guid, what, 0,
"",
"", 0,
false,
GetName(localeIdx));
786 itr->second.SetOwner(
false);
797 itr->second.SetModerator(
true);
798 itr->second.SetOwner(
true);
864template<
class Builder>
871 if (!guid || !player->GetSocial()->HasIgnore(guid))
875template<
class Builder>
886template<
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 put(std::size_t pos, T value)
void JoinNotify(ObjectGuid guid) const
void List(Player const *player) const
void Password(Player const *player, std::string const &pass)
void Voice(ObjectGuid guid1, ObjectGuid guid2) const
BannedContainer _bannedStore
void JoinChannel(Player *player, std::string const &pass="")
std::string GetName(LocaleConstant locale=DEFAULT_LOCALE) const
bool HasFlag(uint8 flag) const
Channel(uint32 channelId, uint32 team=0, AreaTableEntry const *zoneEntry=nullptr)
time_t _nextActivityUpdateTime
void SendToAllButOne(Builder &builder, ObjectGuid who) const
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 LeaveNotify(ObjectGuid guid) const
bool CheckPassword(std::string const &password) const
void SetOwner(ObjectGuid guid, bool exclaim=true)
bool IsOn(ObjectGuid who) const
void Say(ObjectGuid guid, std::string const &what, uint32 lang) const
void SendWhoOwner(ObjectGuid guid)
void LeaveChannel(Player *player, bool send=true)
void UnBan(Player const *player, std::string const &badname)
void SetMode(Player const *player, std::string const &p2n, bool mod, bool set)
static void GetChannelName(std::string &channelName, uint32 channelId, LocaleConstant locale, AreaTableEntry const *zoneEntry)
void SetInvisible(Player const *player, bool on)
void Announce(Player const *player)
uint8 GetPlayerFlags(ObjectGuid guid) const
void SendToAll(Builder &, ObjectGuid guid=ObjectGuid::Empty) const
void Invite(Player const *player, std::string const &newp)
uint32 GetNumPlayers() const
bool IsBanned(ObjectGuid guid) const
AreaTableEntry const * _zoneEntry
void SendToOne(Builder &builder, ObjectGuid who) const
void DeVoice(ObjectGuid guid1, ObjectGuid guid2) const
std::string _channelPassword
PlayerContainer _playersStore
static std::string PGetParseString(std::string_view fmt, Args &&... args)
static size_t BuildChatPacket(WorldPacket &data, ChatMsg chatType, Language language, ObjectGuid senderGUID, ObjectGuid receiverGUID, std::string_view message, uint8 chatTag, std::string const &senderName="", std::string const &receiverName="", uint32 achievementId=0, bool gmMessage=false, std::string const &channelName="")
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)
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 SetMuted(bool state)