diff options
author | maximius <none@none> | 2009-10-17 15:51:44 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-10-17 15:51:44 -0700 |
commit | e585187b248f48b3c6e9247b49fa07c6565d65e5 (patch) | |
tree | 637c5b7ddacf41040bef4ea4f75a97da64c6a9bc /src/game/SocialMgr.h | |
parent | 26b5e033ffde3d161382fc9addbfa99738379641 (diff) |
*Backed out changeset 3be01fb200a5
--HG--
branch : trunk
Diffstat (limited to 'src/game/SocialMgr.h')
-rw-r--r-- | src/game/SocialMgr.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/game/SocialMgr.h b/src/game/SocialMgr.h index 736667c3e0b..1ca04d69707 100644 --- a/src/game/SocialMgr.h +++ b/src/game/SocialMgr.h @@ -17,15 +17,19 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #ifndef __TRINITY_SOCIALMGR_H #define __TRINITY_SOCIALMGR_H + #include "Policies/Singleton.h" #include "Database/DatabaseEnv.h" #include "Common.h" + class SocialMgr; class PlayerSocial; class Player; class WorldPacket; + enum FriendStatus { FRIEND_STATUS_OFFLINE = 0, @@ -34,12 +38,14 @@ enum FriendStatus FRIEND_STATUS_UNK3 = 3, FRIEND_STATUS_DND = 4 }; + enum SocialFlag { SOCIAL_FLAG_FRIEND = 0x01, SOCIAL_FLAG_IGNORED = 0x02, SOCIAL_FLAG_MUTED = 0x04 // guessed }; + struct FriendInfo { FriendStatus Status; @@ -48,6 +54,7 @@ struct FriendInfo uint32 Level; uint32 Class; std::string Note; + FriendInfo() { Status = FRIEND_STATUS_OFFLINE; @@ -57,6 +64,7 @@ struct FriendInfo Class = 0; Note = ""; } + FriendInfo(uint32 flags, const std::string& note) { Status = FRIEND_STATUS_OFFLINE; @@ -67,8 +75,10 @@ struct FriendInfo Note = note; } }; + typedef std::map<uint32, FriendInfo> PlayerSocialMap; typedef std::map<uint32, PlayerSocial> SocialMap; + /// Results of friend related commands enum FriendsResult { @@ -100,8 +110,10 @@ enum FriendsResult FRIEND_UNK7 = 0x19, // no message at client FRIEND_UNKNOWN = 0x1A // Unknown friend response from server }; + #define SOCIALMGR_FRIEND_LIMIT 50 #define SOCIALMGR_IGNORE_LIMIT 25 + class PlayerSocial { friend class SocialMgr; @@ -124,6 +136,7 @@ class PlayerSocial PlayerSocialMap m_playerSocialMap; uint32 m_playerGUID; }; + class SocialMgr { public: @@ -131,6 +144,7 @@ class SocialMgr ~SocialMgr(); // 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); @@ -141,6 +155,7 @@ class SocialMgr private: SocialMap m_socialMap; }; + #define sSocialMgr Trinity::Singleton<SocialMgr>::Instance() #endif |