Core: Crash fix (TemporarySummon), remove some warnings and some other minor changes
- "const uint64" and "uint64 const" --> uint64 - Add some info in LFGDungeonEntry - Move some definitions from ".h" files and move to ".cpp"
This commit is contained in:
@@ -1508,7 +1508,7 @@ void Guild::HandleRemoveMember(WorldSession* session, const std::string& name)
|
||||
SendCommandResult(session, GUILD_QUIT_S, ERR_GUILD_RANK_TOO_HIGH_S, name);
|
||||
else
|
||||
{
|
||||
const uint64 guid = pMember->GetGUID();
|
||||
uint64 guid = pMember->GetGUID();
|
||||
// After call to DeleteMember pointer to member becomes invalid
|
||||
DeleteMember(guid, false, true);
|
||||
_LogEvent(GUILD_EVENT_LOG_UNINVITE_PLAYER, player->GetGUIDLow(), GUID_LOPART(guid));
|
||||
@@ -1790,7 +1790,7 @@ void Guild::SendBankTabText(WorldSession *session, uint8 tabId) const
|
||||
|
||||
void Guild::SendPermissions(WorldSession *session) const
|
||||
{
|
||||
const uint64 guid = session->GetPlayer()->GetGUID();
|
||||
uint64 guid = session->GetPlayer()->GetGUID();
|
||||
uint8 rankId = session->GetPlayer()->GetRank();
|
||||
|
||||
WorldPacket data(MSG_GUILD_PERMISSIONS, 4 * 15 + 1);
|
||||
@@ -2063,7 +2063,7 @@ void Guild::BroadcastPacket(WorldPacket* packet) const
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Members handling
|
||||
bool Guild::AddMember(const uint64 guid, uint8 rankId)
|
||||
bool Guild::AddMember(uint64 guid, uint8 rankId)
|
||||
{
|
||||
Player* player = ObjectAccessor::FindPlayer(guid);
|
||||
// Player cannot be in guild
|
||||
@@ -2132,7 +2132,7 @@ bool Guild::AddMember(const uint64 guid, uint8 rankId)
|
||||
return true;
|
||||
}
|
||||
|
||||
void Guild::DeleteMember(const uint64 guid, bool isDisbanding, bool isKicked)
|
||||
void Guild::DeleteMember(uint64 guid, bool isDisbanding, bool isKicked)
|
||||
{
|
||||
uint32 lowguid = GUID_LOPART(guid);
|
||||
Player* player = ObjectAccessor::FindPlayer(guid);
|
||||
@@ -2188,7 +2188,7 @@ void Guild::DeleteMember(const uint64 guid, bool isDisbanding, bool isKicked)
|
||||
_UpdateAccountsNumber();
|
||||
}
|
||||
|
||||
bool Guild::ChangeMemberRank(const uint64 guid, uint8 newRank)
|
||||
bool Guild::ChangeMemberRank(uint64 guid, uint8 newRank)
|
||||
{
|
||||
if (newRank <= _GetLowestRankId()) // Validate rank (allow only existing ranks)
|
||||
if (Member* pMember = GetMember(guid))
|
||||
@@ -2352,7 +2352,7 @@ void Guild::_DeleteBankItems(SQLTransaction& trans, bool removeItemsFromDB)
|
||||
m_bankTabs.clear();
|
||||
}
|
||||
|
||||
bool Guild::_ModifyBankMoney(SQLTransaction& trans, const uint64 amount, bool add)
|
||||
bool Guild::_ModifyBankMoney(SQLTransaction& trans, uint64 amount, bool add)
|
||||
{
|
||||
if (add)
|
||||
m_bankMoney += amount;
|
||||
@@ -2448,21 +2448,21 @@ inline uint8 Guild::_GetRankBankTabRights(uint8 rankId, uint8 tabId) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline uint32 Guild::_GetMemberRemainingSlots(const uint64 guid, uint8 tabId) const
|
||||
inline uint32 Guild::_GetMemberRemainingSlots(uint64 guid, uint8 tabId) const
|
||||
{
|
||||
if (const Member* pMember = GetMember(guid))
|
||||
return pMember->GetBankRemainingValue(tabId, this);
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline uint32 Guild::_GetMemberRemainingMoney(const uint64 guid) const
|
||||
inline uint32 Guild::_GetMemberRemainingMoney(uint64 guid) const
|
||||
{
|
||||
if (const Member* pMember = GetMember(guid))
|
||||
return pMember->GetBankRemainingValue(GUILD_BANK_MAX_TABS, this);
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline void Guild::_DecreaseMemberRemainingSlots(SQLTransaction& trans, const uint64 guid, uint8 tabId)
|
||||
inline void Guild::_DecreaseMemberRemainingSlots(SQLTransaction& trans, uint64 guid, uint8 tabId)
|
||||
{
|
||||
// Remaining slots must be more then 0
|
||||
if (uint32 remainingSlots = _GetMemberRemainingSlots(guid, tabId))
|
||||
@@ -2472,7 +2472,7 @@ inline void Guild::_DecreaseMemberRemainingSlots(SQLTransaction& trans, const ui
|
||||
pMember->DecreaseBankRemainingValue(trans, tabId, 1);
|
||||
}
|
||||
|
||||
inline bool Guild::_MemberHasTabRights(const uint64 guid, uint8 tabId, uint32 rights) const
|
||||
inline bool Guild::_MemberHasTabRights(uint64 guid, uint8 tabId, uint32 rights) const
|
||||
{
|
||||
if (const Member* pMember = GetMember(guid))
|
||||
{
|
||||
@@ -2632,7 +2632,7 @@ bool Guild::_DoItemsMove(MoveItemData* pSrc, MoveItemData* pDest, bool sendError
|
||||
|
||||
void Guild::_SendBankContent(WorldSession *session, uint8 tabId) const
|
||||
{
|
||||
const uint64 guid = session->GetPlayer()->GetGUID();
|
||||
uint64 guid = session->GetPlayer()->GetGUID();
|
||||
if (_MemberHasTabRights(guid, tabId, GUILD_BANK_RIGHT_VIEW_TAB))
|
||||
if (const BankTab* pTab = GetBankTab(tabId))
|
||||
{
|
||||
@@ -2726,7 +2726,7 @@ void Guild::_SendBankContentUpdate(uint8 tabId, SlotIds slots) const
|
||||
}
|
||||
}
|
||||
|
||||
void Guild::_BroadcastEvent(GuildEvents guildEvent, const uint64 guid, const char* param1, const char* param2, const char* param3) const
|
||||
void Guild::_BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* param1, const char* param2, const char* param3) const
|
||||
{
|
||||
uint8 count = !param3 ? (!param2 ? (!param1 ? 0 : 1) : 2) : 3;
|
||||
|
||||
|
||||
@@ -257,7 +257,7 @@ private:
|
||||
};
|
||||
|
||||
public:
|
||||
Member(uint32 guildId, const uint64 guid, uint8 rankId) : m_guildId(guildId), m_guid(guid), m_logoutTime(::time(NULL)), m_rankId(rankId) { }
|
||||
Member(uint32 guildId, uint64 guid, uint8 rankId) : m_guildId(guildId), m_guid(guid), m_logoutTime(::time(NULL)), m_rankId(rankId) { }
|
||||
|
||||
void SetStats(Player* player);
|
||||
void SetStats(const std::string& name, uint8 level, uint8 _class, uint32 zoneId, uint32 accountId);
|
||||
@@ -280,7 +280,7 @@ private:
|
||||
inline void UpdateLogoutTime() { m_logoutTime = ::time(NULL); }
|
||||
inline bool IsRank(uint8 rankId) const { return m_rankId == rankId; }
|
||||
inline bool IsRankNotLower(uint8 rankId) const { return m_rankId <= rankId; }
|
||||
inline bool IsSamePlayer(const uint64 guid) const { return m_guid == guid; }
|
||||
inline bool IsSamePlayer(uint64 guid) const { return m_guid == guid; }
|
||||
|
||||
void DecreaseBankRemainingValue(SQLTransaction& trans, uint8 tabId, uint32 amount);
|
||||
uint32 GetBankRemainingValue(uint8 tabId, const Guild* guild) const;
|
||||
@@ -656,9 +656,9 @@ public:
|
||||
|
||||
// Members
|
||||
// Adds member to guild. If rankId == GUILD_RANK_NONE, lowest rank is assigned.
|
||||
bool AddMember(const uint64 guid, uint8 rankId = GUILD_RANK_NONE);
|
||||
void DeleteMember(const uint64 guid, bool isDisbanding = false, bool isKicked = false);
|
||||
bool ChangeMemberRank(const uint64 guid, uint8 newRank);
|
||||
bool AddMember(uint64 guid, uint8 rankId = GUILD_RANK_NONE);
|
||||
void DeleteMember(uint64 guid, bool isDisbanding = false, bool isKicked = false);
|
||||
bool ChangeMemberRank(uint64 guid, uint8 newRank);
|
||||
|
||||
// Bank
|
||||
void SwapItems(Player* player, uint8 tabId, uint8 slotId, uint8 destTabId, uint8 destSlotId, uint32 splitedAmount);
|
||||
@@ -698,12 +698,12 @@ private:
|
||||
inline BankTab* GetBankTab(uint8 tabId) { return tabId < m_bankTabs.size() ? m_bankTabs[tabId] : NULL; }
|
||||
inline const BankTab* GetBankTab(uint8 tabId) const { return tabId < m_bankTabs.size() ? m_bankTabs[tabId] : NULL; }
|
||||
|
||||
inline const Member* GetMember(const uint64 guid) const
|
||||
inline const Member* GetMember(uint64 guid) const
|
||||
{
|
||||
Members::const_iterator itr = m_members.find(GUID_LOPART(guid));
|
||||
return itr != m_members.end() ? itr->second : NULL;
|
||||
}
|
||||
inline Member* GetMember(const uint64 guid)
|
||||
inline Member* GetMember(uint64 guid)
|
||||
{
|
||||
Members::iterator itr = m_members.find(GUID_LOPART(guid));
|
||||
return itr != m_members.end() ? itr->second : NULL;
|
||||
@@ -736,7 +736,7 @@ private:
|
||||
void _UpdateAccountsNumber();
|
||||
bool _IsLeader(Player* player) const;
|
||||
void _DeleteBankItems(SQLTransaction& trans, bool removeItemsFromDB = false);
|
||||
bool _ModifyBankMoney(SQLTransaction& trans, const uint64 amount, bool add);
|
||||
bool _ModifyBankMoney(SQLTransaction& trans, uint64 amount, bool add);
|
||||
void _SetLeaderGUID(Member* pLeader);
|
||||
|
||||
void _SetRankBankMoneyPerDay(uint8 rankId, uint32 moneyPerDay);
|
||||
@@ -747,10 +747,10 @@ private:
|
||||
uint32 _GetRankBankTabSlotsPerDay(uint8 rankId, uint8 tabId) const;
|
||||
std::string _GetRankName(uint8 rankId) const;
|
||||
|
||||
uint32 _GetMemberRemainingSlots(const uint64 guid, uint8 tabId) const;
|
||||
uint32 _GetMemberRemainingMoney(const uint64 guid) const;
|
||||
void _DecreaseMemberRemainingSlots(SQLTransaction& trans, const uint64 guid, uint8 tabId);
|
||||
bool _MemberHasTabRights(const uint64 guid, uint8 tabId, uint32 rights) const;
|
||||
uint32 _GetMemberRemainingSlots(uint64 guid, uint8 tabId) const;
|
||||
uint32 _GetMemberRemainingMoney(uint64 guid) const;
|
||||
void _DecreaseMemberRemainingSlots(SQLTransaction& trans, uint64 guid, uint8 tabId);
|
||||
bool _MemberHasTabRights(uint64 guid, uint8 tabId, uint32 rights) const;
|
||||
|
||||
void _LogEvent(GuildEventLogTypes eventType, uint32 playerGuid1, uint32 playerGuid2 = 0, uint8 newRank = 0);
|
||||
void _LogBankEvent(SQLTransaction& trans, GuildBankEventLogTypes eventType, uint8 tabId, uint32 playerGuid, uint32 itemOrMoney, uint16 itemStackCount = 0, uint8 destTabId = 0);
|
||||
@@ -765,6 +765,6 @@ private:
|
||||
void _SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) const;
|
||||
void _SendBankContentUpdate(uint8 tabId, SlotIds slots) const;
|
||||
|
||||
void _BroadcastEvent(GuildEvents guildEvent, const uint64 guid, const char* param1 = NULL, const char* param2 = NULL, const char* param3 = NULL) const;
|
||||
void _BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* param1 = NULL, const char* param2 = NULL, const char* param3 = NULL) const;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -81,7 +81,7 @@ std::string GuildMgr::GetGuildNameById(uint32 guildId) const
|
||||
return "";
|
||||
}
|
||||
|
||||
Guild* GuildMgr::GetGuildByLeader(const uint64 guid) const
|
||||
Guild* GuildMgr::GetGuildByLeader(uint64 guid) const
|
||||
{
|
||||
for (GuildContainer::const_iterator itr = GuildStore.begin(); itr != GuildStore.end(); ++itr)
|
||||
if (itr->second->GetLeaderGUID() == guid)
|
||||
|
||||
@@ -23,13 +23,14 @@
|
||||
class GuildMgr
|
||||
{
|
||||
friend class ACE_Singleton<GuildMgr, ACE_Null_Mutex>;
|
||||
private:
|
||||
GuildMgr();
|
||||
~GuildMgr();
|
||||
|
||||
public:
|
||||
typedef UNORDERED_MAP<uint32, Guild*> GuildContainer;
|
||||
|
||||
Guild* GetGuildByLeader(uint64 const guid) const;
|
||||
Guild* GetGuildByLeader(uint64 guid) const;
|
||||
Guild* GetGuildById(uint32 guildId) const;
|
||||
Guild* GetGuildByName(const std::string& guildName) const;
|
||||
std::string GetGuildNameById(uint32 guildId) const;
|
||||
|
||||
Reference in New Issue
Block a user