mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[8754] Some guld back related packets data correctness checks
* Move when possible checks from deep code to packer/DB read level. * Check real existed guild bank tabs amount instead just max possible amount. * Check guild bank loaded state for packets expected to be called only after guild bank data loadin by another packet. Thanks to elecyb and NetSky for original fix versions.
This commit is contained in:
parent
4284bcc2da
commit
f35be9519c
5 changed files with 157 additions and 120 deletions
|
|
@ -951,15 +951,13 @@ void Guild::LogGuildEvent(uint8 EventType, uint32 PlayerGuid1, uint32 PlayerGuid
|
|||
// Bank content related
|
||||
void Guild::DisplayGuildBankContent(WorldSession *session, uint8 TabId)
|
||||
{
|
||||
WorldPacket data(SMSG_GUILD_BANK_LIST,1200);
|
||||
|
||||
GuildBankTab const* tab = GetBankTab(TabId);
|
||||
if (!tab)
|
||||
return;
|
||||
GuildBankTab const* tab = m_TabListMap[TabId];
|
||||
|
||||
if (!IsMemberHaveRights(session->GetPlayer()->GetGUIDLow(),TabId,GUILD_BANK_RIGHT_VIEW_TAB))
|
||||
return;
|
||||
|
||||
WorldPacket data(SMSG_GUILD_BANK_LIST,1200);
|
||||
|
||||
data << uint64(GetGuildBankMoney());
|
||||
data << uint8(TabId);
|
||||
// remaining slots for today
|
||||
|
|
@ -992,9 +990,7 @@ void Guild::DisplayGuildBankMoneyUpdate()
|
|||
|
||||
void Guild::DisplayGuildBankContentUpdate(uint8 TabId, int32 slot1, int32 slot2)
|
||||
{
|
||||
GuildBankTab const* tab = GetBankTab(TabId);
|
||||
if (!tab)
|
||||
return;
|
||||
GuildBankTab const* tab = m_TabListMap[TabId];
|
||||
|
||||
WorldPacket data(SMSG_GUILD_BANK_LIST,1200);
|
||||
|
||||
|
|
@ -1042,9 +1038,7 @@ void Guild::DisplayGuildBankContentUpdate(uint8 TabId, int32 slot1, int32 slot2)
|
|||
|
||||
void Guild::DisplayGuildBankContentUpdate(uint8 TabId, GuildItemPosCountVec const& slots)
|
||||
{
|
||||
GuildBankTab const* tab = GetBankTab(TabId);
|
||||
if (!tab)
|
||||
return;
|
||||
GuildBankTab const* tab = m_TabListMap[TabId];
|
||||
|
||||
WorldPacket data(SMSG_GUILD_BANK_LIST,1200);
|
||||
|
||||
|
|
@ -1134,14 +1128,6 @@ void Guild::CreateNewBankTab()
|
|||
|
||||
void Guild::SetGuildBankTabInfo(uint8 TabId, std::string Name, std::string Icon)
|
||||
{
|
||||
if (TabId >= GUILD_BANK_MAX_TABS)
|
||||
return;
|
||||
if (TabId >= m_TabListMap.size())
|
||||
return;
|
||||
|
||||
if (!m_TabListMap[TabId])
|
||||
return;
|
||||
|
||||
if (m_TabListMap[TabId]->Name == Name && m_TabListMap[TabId]->Icon == Icon)
|
||||
return;
|
||||
|
||||
|
|
@ -1993,12 +1979,7 @@ void Guild::SetGuildBankTabText(uint8 TabId, std::string text)
|
|||
|
||||
void Guild::SendGuildBankTabText(WorldSession *session, uint8 TabId)
|
||||
{
|
||||
if (TabId > GUILD_BANK_MAX_TABS)
|
||||
return;
|
||||
|
||||
GuildBankTab const *tab = GetBankTab(TabId);
|
||||
if (!tab)
|
||||
return;
|
||||
GuildBankTab const* tab = m_TabListMap[TabId];
|
||||
|
||||
WorldPacket data(MSG_QUERY_GUILD_BANK_TEXT, 1+tab->Text.size()+1);
|
||||
data << uint8(TabId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue