DB Layer:
- Make SQL Transactions actual objects used in code. (Thanks to Derex for the idea) * Uncommitted transactions will be automatically rolled back and cleaned up using ACE_Refcounted_Auto_Ptr, so no need to call Rollback() in the code. * Prevents recursive transactions and makes developers aware of transactions going on. * Gets rid of unneccesary overhead iterating over a concurrent map. - Some cleanups in affected code, including better usage of transaction control in AH / mail related code to prevent data loss. *** Experimental, use at own risk, recommended to backup your DBs. *** --HG-- branch : trunk
This commit is contained in:
@@ -294,7 +294,7 @@ class Guild
|
||||
void CreateDefaultGuildRanks(int locale_idx);
|
||||
void Disband();
|
||||
|
||||
void DeleteGuildBankItems(bool alsoInDB = false);
|
||||
void DeleteGuildBankItems(bool alsoInDB = false, SQLTransaction& trans = SQLTransaction(NULL));
|
||||
typedef std::map<uint32, MemberSlot> MemberList;
|
||||
typedef std::vector<RankInfo> RankList;
|
||||
|
||||
@@ -412,11 +412,11 @@ class Guild
|
||||
void LoadGuildBankFromDB();
|
||||
// Money deposit/withdraw
|
||||
void SendMoneyInfo(WorldSession *session, uint32 LowGuid);
|
||||
bool MemberMoneyWithdraw(uint32 amount, uint32 LowGuid);
|
||||
bool MemberMoneyWithdraw(uint32 amount, uint32 LowGuid, SQLTransaction& trans);
|
||||
uint64 GetGuildBankMoney() { return m_GuildBankMoney; }
|
||||
void SetBankMoney(int64 money);
|
||||
void SetBankMoney(int64 money, SQLTransaction& trans);
|
||||
// per days
|
||||
bool MemberItemWithdraw(uint8 TabId, uint32 LowGuid);
|
||||
bool MemberItemWithdraw(uint8 TabId, uint32 LowGuid, SQLTransaction& trans);
|
||||
uint32 GetMemberSlotWithdrawRem(uint32 LowGuid, uint8 TabId);
|
||||
uint32 GetMemberMoneyWithdrawRem(uint32 LowGuid);
|
||||
void SetBankMoneyPerDay(uint32 rankId, uint32 money);
|
||||
@@ -428,7 +428,7 @@ class Guild
|
||||
// Guild Bank Event Logs
|
||||
void LoadGuildBankEventLogFromDB();
|
||||
void DisplayGuildBankLogs(WorldSession *session, uint8 TabId);
|
||||
void LogBankEvent(uint8 EventType, uint8 TabId, uint32 PlayerGuidLow, uint32 ItemOrMoney, uint8 ItemStackCount=0, uint8 DestTabId=0);
|
||||
void LogBankEvent(SQLTransaction& trans, uint8 EventType, uint8 TabId, uint32 PlayerGuidLow, uint32 ItemOrMoney, uint8 ItemStackCount=0, uint8 DestTabId=0);
|
||||
bool AddGBankItemToDB(uint32 GuildId, uint32 BankTab , uint32 BankTabSlot , uint32 GUIDLow, uint32 Entry);
|
||||
|
||||
protected:
|
||||
@@ -473,8 +473,8 @@ class Guild
|
||||
// used only from high level Swap/Move functions
|
||||
Item* GetItem(uint8 TabId, uint8 SlotId);
|
||||
uint8 CanStoreItem(uint8 tab, uint8 slot, GuildItemPosCountVec& dest, uint32 count, Item *pItem, bool swap = false) const;
|
||||
Item* StoreItem(uint8 tab, GuildItemPosCountVec const& pos, Item *pItem);
|
||||
void RemoveItem(uint8 tab, uint8 slot);
|
||||
Item* StoreItem(uint8 tab, GuildItemPosCountVec const& pos, Item *pItem, SQLTransaction& trans);
|
||||
void RemoveItem(uint8 tab, uint8 slot, SQLTransaction& trans);
|
||||
void DisplayGuildBankContentUpdate(uint8 TabId, int32 slot1, int32 slot2 = -1);
|
||||
void DisplayGuildBankContentUpdate(uint8 TabId, GuildItemPosCountVec const& slots);
|
||||
|
||||
@@ -482,6 +482,6 @@ class Guild
|
||||
void AppendDisplayGuildBankSlot(WorldPacket& data, GuildBankTab const *tab, int32 slot);
|
||||
uint8 _CanStoreItem_InSpecificSlot(uint8 tab, uint8 slot, GuildItemPosCountVec& dest, uint32& count, bool swap, Item *pSrcItem) const;
|
||||
uint8 _CanStoreItem_InTab(uint8 tab, GuildItemPosCountVec& dest, uint32& count, bool merge, Item *pSrcItem, uint8 skip_slot) const;
|
||||
Item* _StoreItem(uint8 tab, uint8 slot, Item *pItem, uint32 count, bool clone);
|
||||
Item* _StoreItem(uint8 tab, uint8 slot, Item *pItem, uint32 count, bool clone, SQLTransaction& trans);
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user