18 #ifndef __TRINITY_GUILDFINDER_H
19 #define __TRINITY_GUILDFINDER_H
242 auto itr = _membershipRequestsByGuild.find(guildGuid);
243 return itr != _membershipRequestsByGuild.end() ? &itr->second :
nullptr;
260 bool HasRequest(ObjectGuid
const& playerId, ObjectGuid
const& guildId);
271 #define sGuildFinderMgr GuildFinderMgr::instance()
273 #endif // __TRINITY_GUILDFINDER_H
~GuildFinderMgr()
Definition: GuildFinderMgr.cpp:28
ObjectGuid const & GetPlayerGUID() const
Definition: GuildFinderMgr.h:79
void LoadMembershipRequests()
Definition: GuildFinderMgr.cpp:79
LFGuildPlayer(ObjectGuid const &guid, uint8 role, uint8 availability, uint8 interests, uint8 level)
Definition: GuildFinderMgr.h:112
std::vector< MembershipRequest const * > GetAllMembershipRequestsForPlayer(ObjectGuid const &playerGuid)
Returns a list of membership requests for a player.
Definition: GuildFinderMgr.cpp:210
Definition: GuildFinderMgr.h:44
void AddMembershipRequest(ObjectGuid const &guildGuid, MembershipRequest const &request)
Files a membership request to a guild.
Definition: GuildFinderMgr.cpp:116
uint8 GetClassRoles() const
Definition: GuildFinderMgr.h:81
void RemoveAllMembershipRequestsFromPlayer(ObjectGuid const &playerId)
Removes all membership request from a player.
Definition: GuildFinderMgr.cpp:142
uint8 _availability
Definition: GuildFinderMgr.h:93
LFGuildSettings(bool listed, TeamId team)
Definition: GuildFinderMgr.h:161
Definition: GuildFinderMgr.h:45
uint8 CountRequestsFromPlayer(ObjectGuid const &playerId)
Counts the amount of pending membership requests, given the player's db guid.
Definition: GuildFinderMgr.cpp:224
LFGuildStore _guildSettings
Definition: GuildFinderMgr.h:189
MembershipRequest(ObjectGuid const &playerGUID, ObjectGuid const &guildId, uint32 availability, uint32 classRoles, uint32 interests, std::string &comment, time_t submitTime)
Definition: GuildFinderMgr.h:71
LFGuildSettings const & GetGuildSettings(ObjectGuid const &guildGuid)
Returns settings for a guild.
Definition: GuildFinderMgr.h:211
uint8 GetClassRoles() const
Definition: GuildFinderMgr.h:140
std::unordered_map< ObjectGuid, LFGuildSettings > LFGuildStore
Definition: GuildFinderMgr.h:181
uint8 GetLevel() const
Definition: GuildFinderMgr.h:143
static GuildFinderMgr * instance()
Definition: GuildFinderMgr.cpp:343
Definition: GuildFinderMgr.h:29
std::vector< LFGuildSettings const * > GetGuildsMatchingSetting(LFGuildPlayer &settings, TeamId faction)
Returns a store of guilds matching the settings provided, using bitmask operators.
Definition: GuildFinderMgr.cpp:230
ObjectGuid const & GetGUID() const
Definition: GuildFinderMgr.h:139
LFGuildSettings()
Definition: GuildFinderMgr.h:159
time_t _time
Definition: GuildFinderMgr.h:97
bool IsListed() const
Definition: GuildFinderMgr.h:172
Definition: GuildFinderMgr.h:53
Holds settings for a guild in the finder system. Saved to database.
Definition: GuildFinderMgr.h:156
void LoadGuildSettings()
Definition: GuildFinderMgr.cpp:38
arena_t NULL
Definition: jemalloc_internal.h:624
#define false
Definition: CascPort.h:18
LFGuildSettings(LFGuildSettings const &settings)
Definition: GuildFinderMgr.h:169
void LoadFromDB()
Definition: GuildFinderMgr.cpp:32
LFGuildPlayer(ObjectGuid const &guid, uint8 role, uint8 availability, uint8 interests, uint8 level, std::string &comment)
Definition: GuildFinderMgr.h:121
void SetGuildSettings(ObjectGuid const &guildGuid, LFGuildSettings const &settings)
Stores guild settings and begins an asynchronous database insert.
Definition: GuildFinderMgr.cpp:270
MembershipRequest(MembershipRequest const &settings)
Definition: GuildFinderMgr.h:61
Definition: GuildFinderMgr.h:46
LFGuildSettings(bool listed, TeamId team, ObjectGuid const &guid, uint8 role, uint8 availability, uint8 interests, uint8 level)
Definition: GuildFinderMgr.h:163
Definition: GuildFinderMgr.h:183
Definition: GuildFinderMgr.h:47
Definition: GuildFinderMgr.h:30
uint8 _level
Definition: GuildFinderMgr.h:152
uint8 _interests
Definition: GuildFinderMgr.h:95
time_t GetExpiryTime() const
Definition: GuildFinderMgr.h:84
GuildFinderOptionsLevel
Definition: GuildFinderMgr.h:50
void SetListed(bool state)
Definition: GuildFinderMgr.h:173
Definition: GuildFinderMgr.h:37
uint8 _availability
Definition: GuildFinderMgr.h:150
LFGuildSettings(bool listed, TeamId team, ObjectGuid const &guid, uint8 role, uint8 availability, uint8 interests, uint8 level, std::string &comment)
Definition: GuildFinderMgr.h:166
uint8 _interests
Definition: GuildFinderMgr.h:151
ObjectGuid const & GetGuildGuid() const
Definition: GuildFinderMgr.h:78
GuildFinderOptionsInterest
Definition: GuildFinderMgr.h:25
void DeleteGuild(ObjectGuid const &guildId)
Wipes everything related to a guild. Used when that guild is disbanded.
Definition: GuildFinderMgr.cpp:289
Definition: GuildFinderMgr.h:28
uint8 GetAvailability() const
Definition: GuildFinderMgr.h:80
bool _listed
Definition: GuildFinderMgr.h:177
ObjectGuid _guid
Definition: GuildFinderMgr.h:148
time_t GetSubmitTime() const
Definition: GuildFinderMgr.h:83
std::string const & GetComment() const
Definition: GuildFinderMgr.h:144
Definition: GuildFinderMgr.h:54
uint32_t uint32
Definition: Define.h:150
Holds all required informations about a membership request.
Definition: GuildFinderMgr.h:58
void RemoveMembershipRequest(ObjectGuid const &playerId, ObjectGuid const &guildId)
Removes a membership request to a guild.
Definition: GuildFinderMgr.cpp:174
std::unordered_map< ObjectGuid, std::unordered_map< ObjectGuid, MembershipRequest > > _membershipRequestsByGuild
Definition: GuildFinderMgr.h:191
Definition: SharedDefines.h:992
std::string const & GetComment() const
Definition: GuildFinderMgr.h:85
uint8 GetInterests() const
Definition: GuildFinderMgr.h:82
uint8 GetAvailability() const
Definition: GuildFinderMgr.h:141
GuildFinderMgr()
Definition: GuildFinderMgr.cpp:24
ObjectGuid _playerGUID
Definition: GuildFinderMgr.h:91
std::string _comment
Definition: GuildFinderMgr.h:88
LFGuildPlayer(LFGuildPlayer const &settings)
Definition: GuildFinderMgr.h:130
TeamId GetTeam() const
Definition: GuildFinderMgr.h:175
TeamId
Definition: SharedDefines.h:990
std::string _comment
Definition: GuildFinderMgr.h:147
static void SendApplicantListUpdate(Guild *guild)
Definition: GuildFinderMgr.cpp:330
Definition: GuildFinderMgr.h:27
uint8 _roles
Definition: GuildFinderMgr.h:149
std::unordered_map< ObjectGuid, MembershipRequest > const * GetAllMembershipRequestsForGuild(ObjectGuid const &guildGuid)
Returns a set of membership requests for a guild.
Definition: GuildFinderMgr.h:240
GuildFinderOptionsRoles
Definition: GuildFinderMgr.h:42
GuildFinderOptionsAvailability
Definition: GuildFinderMgr.h:35
uint8_t uint8
Definition: Define.h:152
uint8 GetInterests() const
Definition: GuildFinderMgr.h:142
Definition: GuildFinderMgr.h:39
std::unordered_map< ObjectGuid, std::unordered_map< ObjectGuid, MembershipRequest > > _membershipRequestsByPlayer
Definition: GuildFinderMgr.h:192
Definition: ObjectGuid.h:189
Definition: GuildFinderMgr.h:38
Definition: GuildFinderMgr.h:52
MembershipRequest()
Definition: GuildFinderMgr.h:75
uint8 _classRoles
Definition: GuildFinderMgr.h:94
Definition: GuildFinderMgr.h:32
Holds all informations about a player's finder settings. NOT stored in database.
Definition: GuildFinderMgr.h:101
LFGuildPlayer()
Definition: GuildFinderMgr.h:104
ObjectGuid _guildId
Definition: GuildFinderMgr.h:90
static void SendMembershipRequestListUpdate(Player *player)
Definition: GuildFinderMgr.cpp:338
Definition: GuildFinderMgr.h:31
bool HasRequest(ObjectGuid const &playerId, ObjectGuid const &guildId)
Provided a player guid and a guild guid, determines if a pending request is filed with these keys...
Definition: GuildFinderMgr.cpp:261
TeamId _team
Definition: GuildFinderMgr.h:178