Fix corrupt item cache crashes, bot whispers, trade crashes
This commit is contained in:
@@ -241,7 +241,8 @@ enum GuildMemberFlags
|
||||
class EmblemInfo
|
||||
{
|
||||
public:
|
||||
EmblemInfo() : m_style(0), m_color(0), m_borderStyle(0), m_borderColor(0), m_backgroundColor(0) { }
|
||||
EmblemInfo(uint32 style = 0, uint32 color = 0, uint32 borderStyle = 0, uint32 borderColor = 0, uint32 backgroundColor = 0) :
|
||||
m_style(0), m_color(0), m_borderStyle(0), m_borderColor(0), m_backgroundColor(0) { }
|
||||
|
||||
void LoadFromDB(Field* fields);
|
||||
void SaveToDB(uint32 guildId) const;
|
||||
@@ -692,11 +693,13 @@ public:
|
||||
void HandleQuery(WorldSession* session);
|
||||
void HandleSetMOTD(WorldSession* session, std::string_view motd);
|
||||
void HandleSetInfo(WorldSession* session, std::string_view info);
|
||||
void HandleSetEmblem(WorldSession* session, const EmblemInfo& emblemInfo);
|
||||
void HandleSetEmblem(WorldSession* session, EmblemInfo const& emblemInfo);
|
||||
void HandleSetEmblem(EmblemInfo const& emblemInfo);
|
||||
void HandleSetLeader(WorldSession* session, std::string_view name);
|
||||
void HandleSetBankTabInfo(WorldSession* session, uint8 tabId, std::string_view name, std::string_view icon);
|
||||
void HandleSetMemberNote(WorldSession* session, std::string_view name, std::string_view note, bool officer);
|
||||
void HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string_view name, uint32 rights, uint32 moneyPerDay, std::array<GuildBankRightsAndSlots, GUILD_BANK_MAX_TABS> const& rightsAndSlots);
|
||||
void HandleSetRankInfo(uint8 rankId, uint32 rights = 0, std::string_view name = "", uint32 moneyPerDay = 0);
|
||||
void HandleBuyBankTab(WorldSession* session, uint8 tabId);
|
||||
void HandleInviteMember(WorldSession* session, std::string const& name);
|
||||
void HandleAcceptMember(WorldSession* session);
|
||||
@@ -775,6 +778,10 @@ public:
|
||||
[[nodiscard]] bool ModifyBankMoney(CharacterDatabaseTransaction trans, const uint64& amount, bool add) { return _ModifyBankMoney(trans, amount, add); }
|
||||
[[nodiscard]] uint32 GetMemberSize() const { return m_members.size(); }
|
||||
|
||||
bool MemberHasTabRights(ObjectGuid guid, uint8 tabId, uint32 rights) const;
|
||||
bool HasRankRight(Player* player, uint32 right) const;
|
||||
uint32 GetRankRights(uint8 rankId) const;
|
||||
|
||||
protected:
|
||||
uint32 m_id;
|
||||
std::string m_name;
|
||||
@@ -799,13 +806,6 @@ private:
|
||||
inline uint8 _GetRanksSize() const { return uint8(m_ranks.size()); }
|
||||
inline const RankInfo* GetRankInfo(uint8 rankId) const { return rankId < _GetRanksSize() ? &m_ranks[rankId] : nullptr; }
|
||||
inline RankInfo* GetRankInfo(uint8 rankId) { return rankId < _GetRanksSize() ? &m_ranks[rankId] : nullptr; }
|
||||
inline bool _HasRankRight(Player* player, uint32 right) const
|
||||
{
|
||||
if (player)
|
||||
if (Member const* member = GetMember(player->GetGUID()))
|
||||
return (_GetRankRights(member->GetRankId()) & right) != GR_RIGHT_EMPTY;
|
||||
return false;
|
||||
}
|
||||
|
||||
inline uint8 _GetLowestRankId() const { return uint8(m_ranks.size() - 1); }
|
||||
|
||||
@@ -836,7 +836,6 @@ private:
|
||||
void _SetRankBankMoneyPerDay(uint8 rankId, uint32 moneyPerDay);
|
||||
void _SetRankBankTabRightsAndSlots(uint8 rankId, GuildBankRightsAndSlots rightsAndSlots, bool saveToDB = true);
|
||||
int8 _GetRankBankTabRights(uint8 rankId, uint8 tabId) const;
|
||||
uint32 _GetRankRights(uint8 rankId) const;
|
||||
int32 _GetRankBankMoneyPerDay(uint8 rankId) const;
|
||||
int32 _GetRankBankTabSlotsPerDay(uint8 rankId, uint8 tabId) const;
|
||||
std::string _GetRankName(uint8 rankId) const;
|
||||
@@ -844,7 +843,6 @@ private:
|
||||
int32 _GetMemberRemainingSlots(Member const& member, uint8 tabId) const;
|
||||
int32 _GetMemberRemainingMoney(Member const& member) const;
|
||||
void _UpdateMemberWithdrawSlots(CharacterDatabaseTransaction trans, ObjectGuid guid, uint8 tabId);
|
||||
bool _MemberHasTabRights(ObjectGuid guid, uint8 tabId, uint32 rights) const;
|
||||
|
||||
void _LogEvent(GuildEventLogTypes eventType, ObjectGuid playerGuid1, ObjectGuid playerGuid2 = ObjectGuid::Empty, uint8 newRank = 0);
|
||||
void _LogBankEvent(CharacterDatabaseTransaction trans, GuildBankEventLogTypes eventType, uint8 tabId, ObjectGuid playerGuid, uint32 itemOrMoney, uint16 itemStackCount = 0, uint8 destTabId = 0);
|
||||
|
||||
Reference in New Issue
Block a user