31 if ((itr->second.Flags & flag) != 0)
46 itr->second.Flags |= flag;
47 itr->second.WowAccountGuid = accountGuid;
51 stmt->
setUInt8(0, itr->second.Flags);
59 itr =
_playerSocialMap.emplace(std::piecewise_construct, std::forward_as_tuple(friendGuid), std::forward_as_tuple()).first;
61 itr->second.Flags |= flag;
62 itr->second.WowAccountGuid = accountGuid;
85 itr->second.Flags &= ~flag;
87 if (!itr->second.Flags)
96 ObjectGuid accountGuid = itr->second.WowAccountGuid;
104 return social.second.Flags & SOCIAL_FLAG_IGNORED && social.second.WowAccountGuid == accountGuid;
115 stmt->
setUInt8(0, itr->second.Flags);
129 itr->second.Note = note;
153 uint8 contactFlags = v.second.Flags;
154 if (!(contactFlags &
flags))
169 contactList.
Contacts.emplace_back(v.first, v.second);
179 return (itr->second.Flags &
flags) != 0;
207 friendInfo.
Level = 0;
208 friendInfo.
Class = 0;
216 friendInfo.
Note = itr->second.Note;
233 else if (target->
isAFK())
255 friendStatus.
Initialize(friendGuid, result, fi);
270 PlayerSocial::PlayerSocialMap::const_iterator itr2 = itr->second._playerSocialMap.find(player->
GetGUID());
271 if (itr2 != itr->second._playerSocialMap.end() && (itr2->second.Flags &
SOCIAL_FLAG_FRIEND) != 0)
299 Field* fields = result->Fetch();
301 ObjectGuid friendGuid = ObjectGuid::Create<HighGuid::Player>(fields[0].GetUInt64());
302 ObjectGuid friendAccountGuid = ObjectGuid::Create<HighGuid::WowAccount>(
uint64(fields[1].GetUInt32()));
309 while (result->NextRow());
@ CHAR_UPD_CHARACTER_SOCIAL_NOTE
@ CHAR_UPD_CHARACTER_SOCIAL_FLAGS
@ CHAR_DEL_CHARACTER_SOCIAL
@ CHAR_INS_CHARACTER_SOCIAL
std::shared_ptr< PreparedResultSet > PreparedQueryResult
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
Role Based Access Control related classes definition.
FriendsResult
Results of friend related commands.
#define SOCIALMGR_IGNORE_LIMIT
#define SOCIALMGR_FRIEND_LIMIT
void utf8truncate(std::string &utf8str, size_t len)
Class used to access individual fields of database query result.
LowType GetCounter() const
static ObjectGuid GetGUID(Object const *o)
void SetPlayerGUID(ObjectGuid const &guid)
ObjectGuid const & GetPlayerGUID() const
GuidUnorderedSet _ignoredAccounts
PlayerSocialMap _playerSocialMap
bool AddToSocialList(ObjectGuid const &guid, ObjectGuid const &accountGuid, SocialFlag flag)
uint32 GetNumberOfSocialsWithFlag(SocialFlag flag)
bool _HasContact(ObjectGuid const &guid, SocialFlag flags)
void SetFriendNote(ObjectGuid const &guid, std::string const ¬e)
bool HasIgnore(ObjectGuid const &ignoreGuid, ObjectGuid const &ignoreAccountGuid)
bool HasFriend(ObjectGuid const &friendGuid)
void RemoveFromSocialList(ObjectGuid const &guid, SocialFlag flag)
void SendSocialList(Player *player, uint32 flags)
PlayerSocial * GetSocial() const
void SendDirectMessage(WorldPacket const *data) const
WorldSession * GetSession() const
bool IsVisibleGloballyFor(Player const *player) const
void setUInt8(const uint8 index, const uint8 value)
void setString(const uint8 index, const std::string &value)
void setUInt64(const uint8 index, const uint64 value)
static SocialMgr * instance()
static void GetFriendInfo(Player *player, ObjectGuid const &friendGUID, FriendInfo &friendInfo)
PlayerSocial * LoadFromDB(PreparedQueryResult result, ObjectGuid const &guid)
void SendFriendStatus(Player *player, FriendsResult result, ObjectGuid const &friendGuid, bool broadcast=false)
void BroadcastToFriendListers(Player *player, WorldPacket const *packet)
WorldPacket const * Write() override
void Initialize(ObjectGuid const &guid, FriendsResult result, FriendInfo const &friendInfo)
Player session in the World.
AccountTypes GetSecurity() const
uint32 GetRecruiterId() const
bool HasPermission(uint32 permissionId)
void SendPacket(WorldPacket const *packet, bool forced=false)
Send a packet to the client.
uint32 GetAccountId() const
@ CONFIG_GM_LEVEL_IN_WHO_LIST
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
@ RBAC_PERM_WHO_SEE_ALL_SEC_LEVELS
@ RBAC_PERM_TWO_SIDE_WHO_LIST