40 _nextActivityUpdateTime(0),
41 _announceEnabled(false),
42 _ownershipEnabled(false),
43 _isOwnerInvisible(false),
45 _channelId(channelId),
65 _nextActivityUpdateTime(0),
66 _announceEnabled(true),
67 _ownershipEnabled(true),
68 _isOwnerInvisible(false),
79 if (guid.size() > 2 && guid.substr(0, 2) ==
"0x")
80 guid.remove_suffix(2);
92 TC_LOG_DEBUG(
"chat.system",
"Channel({}) loaded player {} into bannedStore", name, banned.
ToString());
112 channelName = channelEntry->
Name[locale];
129 std::ostringstream banlist;
131 banlist << guid.ToHexString() <<
' ';
234 notify->
Data.Write();
289 notify->
Data.Suspended = suspend;
290 notify->
Data.Write();
298 bool changeowner = info.
IsOwner();
316 PlayerContainer::iterator itr;
319 if (!itr->second.IsInvisible())
327 itr->second.SetModerator(
true);
332 if (itr->second.IsInvisible())
361 if (!bad || !victim || !
IsOn(victim))
537 itr->second.SetInvisible(on);
567 if (!newp || !victim || !
IsOn(victim) ||
612 TC_LOG_DEBUG(
"chat.system",
"SMSG_CHANNEL_LIST {} Channel: {}",
634 list.
_Members.emplace_back(i.first, *member->
m_playerData->VirtualPlayerRealm, i.second.GetFlags());
720 packet->
Data.SenderGUID = guid;
721 packet->
Data.TargetGUID = guid;
724 packet->
Data.Write();
768 packet->
Data.SenderGUID = guid;
769 packet->
Data.TargetGUID = guid;
772 packet->
Data.Write();
847 itr->second.SetOwner(
false);
858 itr->second.SetModerator(
true);
859 itr->second.SetOwner(
true);
899 userlistAdd->
Data.AddedUserGUID = guid;
903 userlistAdd->
Data.ChannelName =
GetName(localeIdx);
904 userlistAdd->
Data.Write();
917 userlistUpdate->
Data.UpdatedUserGUID = guid;
921 userlistUpdate->
Data.ChannelName =
GetName(localeIdx);
922 userlistUpdate->
Data.Write();
923 return userlistUpdate;
939 userlistRemove->
Data.RemovedUserGUID = guid;
942 userlistRemove->
Data.ChannelName =
GetName(localeIdx);
943 userlistRemove->
Data.Write();
944 return userlistRemove;
976 if (playerInfo.
IsMuted() != set)
987template <
class Builder>
994 if (guid.
IsEmpty() || !player->GetSocial()->HasIgnore(guid, accountGuid))
998template <
class Builder>
1009template <
class Builder>
1018template <
class Builder>
1026 if (player->GetSession()->IsAddonRegistered(addonPrefix) && (guid.
IsEmpty() || !player->GetSocial()->HasIgnore(guid, accountGuid)))
DB2Storage< ChatChannelsEntry > sChatChannelsStore("ChatChannels.db2", &ChatChannelsLoadInfo::Instance)
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
#define ASSERT_NOTNULL(pointer)
#define TC_LOG_DEBUG(filterType__, message__,...)
std::optional< T > Optional
Optional helper class to wrap optional values within.
uint32 urand(uint32 min, uint32 max)
static bool IsPlayerAccount(uint32 gmlevel)
ObjectGuid const & GetGUID() const
static AreaTableEntry const * SpecialLinkedArea
void Password(Player const *player, std::string const &pass)
void List(Player const *player)
BannedContainer _bannedStore
void JoinChannel(Player *player, std::string const &pass="")
std::string GetName(LocaleConstant locale=DEFAULT_LOCALE) const
void SendToAllWithAddon(Builder &builder, std::string const &addonPrefix, ObjectGuid const &guid=ObjectGuid::Empty, ObjectGuid const &accountGuid=ObjectGuid::Empty) const
void SendToOne(Builder &builder, ObjectGuid const &who) const
bool HasFlag(uint8 flag) const
void SendToAllButOne(Builder &builder, ObjectGuid const &who) const
Channel(ObjectGuid const &guid, uint32 channelId, uint32 team=0, AreaTableEntry const *zoneEntry=nullptr)
time_t _nextActivityUpdateTime
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)
uint32 GetChannelId() const
void SendWhoOwner(Player const *player)
bool CheckPassword(std::string const &password) const
bool IsOn(ObjectGuid who) const
void UnsilenceAll(Player const *player, std::string const &name)
void AddonSay(ObjectGuid const &guid, std::string const &prefix, std::string const &what, bool isLogged) const
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 JoinNotify(Player const *player)
void Invite(Player const *player, std::string const &newp)
bool IsBanned(ObjectGuid guid) const
void SendToAll(Builder &builder, ObjectGuid const &guid=ObjectGuid::Empty, ObjectGuid const &accountGuid=ObjectGuid::Empty) const
AreaTableEntry const * _zoneEntry
void LeaveNotify(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) noexcept
static ObjectGuid const Empty
std::string ToString() const
void SetRawValue(std::span< uint8 const > rawBytes)
bool HasIgnore(ObjectGuid const &ignoreGuid, ObjectGuid const &ignoreAccountGuid)
UF::UpdateField< UF::PlayerData, int32(WowCS::EntityFragment::CGObject), TYPEID_PLAYER > m_playerData
PlayerSocial * GetSocial() const
void SendDirectMessage(WorldPacket const *data) const
WorldSession * GetSession() const
bool IsVisibleGloballyFor(Player const *player) const
Group * GetGroup(Optional< uint8 > partyIndex)
void LeftChannel(Channel *c)
void JoinedChannel(Channel *c)
void setString(uint8 index, std::string &&value)
void setUInt32(uint8 index, uint32 value)
void setBool(uint8 index, bool value)
std::string const & GetName() const
std::string _Channel
Channel Name.
std::vector< ChannelPlayer > _Members
WorldPacket const * Write() override
AccountTypes GetSecurity() const
ObjectGuid GetAccountGUID() 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)
EnumFlag< ChatChannelFlags > GetFlags() const