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());
107 channelName = fmt::sprintf(channelEntry->
Name[locale],
ASSERT_NOTNULL(zoneEntry)->AreaName[locale]);
110 channelName = channelEntry->
Name[locale];
127 std::ostringstream banlist;
129 banlist << guid.ToHexString() <<
' ';
232 notify->
Data.Write();
287 notify->
Data.Suspended = suspend;
288 notify->
Data.Write();
296 bool changeowner = info.
IsOwner();
314 PlayerContainer::iterator itr;
317 if (!itr->second.IsInvisible())
325 itr->second.SetModerator(
true);
330 if (itr->second.IsInvisible())
359 if (!bad || !victim || !
IsOn(victim))
535 itr->second.SetInvisible(on);
565 if (!newp || !victim || !
IsOn(victim) ||
610 TC_LOG_DEBUG(
"chat.system",
"SMSG_CHANNEL_LIST {} Channel: {}",
718 packet->
Data.SenderGUID = guid;
719 packet->
Data.TargetGUID = guid;
722 packet->
Data.Write();
766 packet->
Data.SenderGUID = guid;
767 packet->
Data.TargetGUID = guid;
770 packet->
Data.Write();
845 itr->second.SetOwner(
false);
856 itr->second.SetModerator(
true);
857 itr->second.SetOwner(
true);
897 userlistAdd->
Data.AddedUserGUID = guid;
901 userlistAdd->
Data.ChannelName =
GetName(localeIdx);
902 userlistAdd->
Data.Write();
915 userlistUpdate->
Data.UpdatedUserGUID = guid;
919 userlistUpdate->
Data.ChannelName =
GetName(localeIdx);
920 userlistUpdate->
Data.Write();
921 return userlistUpdate;
937 userlistRemove->
Data.RemovedUserGUID = guid;
940 userlistRemove->
Data.ChannelName =
GetName(localeIdx);
941 userlistRemove->
Data.Write();
942 return userlistRemove;
974 if (playerInfo.
IsMuted() != set)
985template <
class Builder>
992 if (guid.
IsEmpty() || !player->GetSocial()->HasIgnore(guid, accountGuid))
996template <
class Builder>
1007template <
class Builder>
1016template <
class Builder>
1024 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__,...)
std::optional< T > Optional
Optional helper class to wrap optional values within.
uint32 urand(uint32 min, uint32 max)
static bool IsPlayerAccount(uint32 gmlevel)
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 ObjectGuid const Empty
std::string ToString() const
void SetRawValue(std::vector< uint8 > const &guid)
static ObjectGuid GetGUID(Object const *o)
bool HasIgnore(ObjectGuid const &ignoreGuid, ObjectGuid const &ignoreAccountGuid)
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 setBool(const uint8 index, const bool value)
void setUInt32(const uint8 index, const uint32 value)
void setString(const uint8 index, const std::string &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)
uint32 GetVirtualRealmAddress()
@ 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