mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 05:06:24 +00:00
refactor(Core/Game): restyle game lib with astyle (#3466)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -143,7 +143,7 @@ void PlayerSocial::SendSocialList(Player* player)
|
||||
|
||||
uint32 size = m_playerSocialMap.size();
|
||||
|
||||
WorldPacket data(SMSG_CONTACT_LIST, (4+4+size*25)); // just can guess size
|
||||
WorldPacket data(SMSG_CONTACT_LIST, (4 + 4 + size * 25)); // just can guess size
|
||||
data << uint32(7); // 0x1 = Friendlist update. 0x2 = Ignorelist update. 0x4 = Mutelist update.
|
||||
data << uint32(size); // friends count
|
||||
|
||||
@@ -202,7 +202,7 @@ SocialMgr* SocialMgr::instance()
|
||||
return &instance;
|
||||
}
|
||||
|
||||
void SocialMgr::GetFriendInfo(Player* player, uint32 friendGUID, FriendInfo &friendInfo)
|
||||
void SocialMgr::GetFriendInfo(Player* player, uint32 friendGUID, FriendInfo& friendInfo)
|
||||
{
|
||||
if (!player)
|
||||
return;
|
||||
@@ -311,7 +311,7 @@ void SocialMgr::BroadcastToFriendListers(Player* player, WorldPacket* packet)
|
||||
|
||||
PlayerSocial* SocialMgr::LoadFromDB(PreparedQueryResult result, uint32 guid)
|
||||
{
|
||||
PlayerSocial *social = &m_socialMap[guid];
|
||||
PlayerSocial* social = &m_socialMap[guid];
|
||||
social->SetPlayerGUID(guid);
|
||||
|
||||
if (!result)
|
||||
@@ -334,8 +334,7 @@ PlayerSocial* SocialMgr::LoadFromDB(PreparedQueryResult result, uint32 guid)
|
||||
// client's friends list and ignore list limit
|
||||
if (social->m_playerSocialMap.size() >= (SOCIALMGR_FRIEND_LIMIT + SOCIALMGR_IGNORE_LIMIT))
|
||||
break;
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
return social;
|
||||
}
|
||||
|
||||
@@ -89,47 +89,47 @@ enum FriendsResult
|
||||
class PlayerSocial
|
||||
{
|
||||
friend class SocialMgr;
|
||||
public:
|
||||
PlayerSocial();
|
||||
~PlayerSocial();
|
||||
// adding/removing
|
||||
bool AddToSocialList(uint32 friend_guid, bool ignore);
|
||||
void RemoveFromSocialList(uint32 friend_guid, bool ignore);
|
||||
void SetFriendNote(uint32 friendGuid, std::string note);
|
||||
// Packet send's
|
||||
void SendSocialList(Player* player);
|
||||
// Misc
|
||||
bool HasFriend(uint32 friend_guid) const;
|
||||
bool HasIgnore(uint32 ignore_guid) const;
|
||||
uint32 GetPlayerGUID() const { return m_playerGUID; }
|
||||
void SetPlayerGUID(uint32 guid) { m_playerGUID = guid; }
|
||||
uint32 GetNumberOfSocialsWithFlag(SocialFlag flag) const;
|
||||
private:
|
||||
PlayerSocialMap m_playerSocialMap;
|
||||
uint32 m_playerGUID;
|
||||
public:
|
||||
PlayerSocial();
|
||||
~PlayerSocial();
|
||||
// adding/removing
|
||||
bool AddToSocialList(uint32 friend_guid, bool ignore);
|
||||
void RemoveFromSocialList(uint32 friend_guid, bool ignore);
|
||||
void SetFriendNote(uint32 friendGuid, std::string note);
|
||||
// Packet send's
|
||||
void SendSocialList(Player* player);
|
||||
// Misc
|
||||
bool HasFriend(uint32 friend_guid) const;
|
||||
bool HasIgnore(uint32 ignore_guid) const;
|
||||
uint32 GetPlayerGUID() const { return m_playerGUID; }
|
||||
void SetPlayerGUID(uint32 guid) { m_playerGUID = guid; }
|
||||
uint32 GetNumberOfSocialsWithFlag(SocialFlag flag) const;
|
||||
private:
|
||||
PlayerSocialMap m_playerSocialMap;
|
||||
uint32 m_playerGUID;
|
||||
};
|
||||
|
||||
class SocialMgr
|
||||
{
|
||||
private:
|
||||
SocialMgr();
|
||||
~SocialMgr();
|
||||
private:
|
||||
SocialMgr();
|
||||
~SocialMgr();
|
||||
|
||||
public:
|
||||
static SocialMgr* instance();
|
||||
public:
|
||||
static SocialMgr* instance();
|
||||
|
||||
// Misc
|
||||
void RemovePlayerSocial(uint32 guid) { m_socialMap.erase(guid); }
|
||||
// Misc
|
||||
void RemovePlayerSocial(uint32 guid) { m_socialMap.erase(guid); }
|
||||
|
||||
void GetFriendInfo(Player* player, uint32 friendGUID, FriendInfo &friendInfo);
|
||||
// Packet management
|
||||
void MakeFriendStatusPacket(FriendsResult result, uint32 friend_guid, WorldPacket* data);
|
||||
void SendFriendStatus(Player* player, FriendsResult result, uint32 friend_guid, bool broadcast);
|
||||
void BroadcastToFriendListers(Player* player, WorldPacket* packet);
|
||||
// Loading
|
||||
PlayerSocial *LoadFromDB(PreparedQueryResult result, uint32 guid);
|
||||
private:
|
||||
SocialMap m_socialMap;
|
||||
void GetFriendInfo(Player* player, uint32 friendGUID, FriendInfo& friendInfo);
|
||||
// Packet management
|
||||
void MakeFriendStatusPacket(FriendsResult result, uint32 friend_guid, WorldPacket* data);
|
||||
void SendFriendStatus(Player* player, FriendsResult result, uint32 friend_guid, bool broadcast);
|
||||
void BroadcastToFriendListers(Player* player, WorldPacket* packet);
|
||||
// Loading
|
||||
PlayerSocial* LoadFromDB(PreparedQueryResult result, uint32 guid);
|
||||
private:
|
||||
SocialMap m_socialMap;
|
||||
};
|
||||
|
||||
#define sSocialMgr SocialMgr::instance()
|
||||
|
||||
Reference in New Issue
Block a user