TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
TradeHandler.cpp File Reference
#include "Common.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "World.h"
#include "ObjectAccessor.h"
#include "Log.h"
#include "Player.h"
#include "Item.h"
#include "Spell.h"
#include "SocialMgr.h"
#include "Language.h"
#include "AccountMgr.h"
#include "TradePackets.h"
#include "TradeData.h"
+ Include dependency graph for TradeHandler.cpp:

Functions

static void setAcceptTradeMode (TradeData *myTrade, TradeData *hisTrade, Item **myItems, Item **hisItems)
 
static void clearAcceptTradeMode (TradeData *myTrade, TradeData *hisTrade)
 
static void clearAcceptTradeMode (Item **myItems, Item **hisItems)
 

Function Documentation

static void clearAcceptTradeMode ( TradeData myTrade,
TradeData hisTrade 
)
static
206 {
207  myTrade->SetInAcceptProcess(false);
208  hisTrade->SetInAcceptProcess(false);
209 }
void SetInAcceptProcess(bool state)
Definition: TradeData.h:62

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void clearAcceptTradeMode ( Item **  myItems,
Item **  hisItems 
)
static
212 {
213  // clear 'in-trade' flag
214  for (uint8 i = 0; i < TRADE_SLOT_TRADED_COUNT; ++i)
215  {
216  if (myItems[i])
217  myItems[i]->SetInTrade(false);
218  if (hisItems[i])
219  hisItems[i]->SetInTrade(false);
220  }
221 }
void SetInTrade(bool b=true)
Definition: Item.h:312
uint8_t uint8
Definition: Define.h:152
Definition: TradeData.h:26

+ Here is the call graph for this function:

static void setAcceptTradeMode ( TradeData myTrade,
TradeData hisTrade,
Item **  myItems,
Item **  hisItems 
)
static
181 {
182  myTrade->SetInAcceptProcess(true);
183  hisTrade->SetInAcceptProcess(true);
184 
185  // store items in local list and set 'in-trade' flag
186  for (uint8 i = 0; i < TRADE_SLOT_TRADED_COUNT; ++i)
187  {
188  if (Item* item = myTrade->GetItem(TradeSlots(i)))
189  {
190  TC_LOG_DEBUG("network", "player trade %s bag: %u slot: %u", item->GetGUID().ToString().c_str(), item->GetBagSlot(), item->GetSlot());
191  //Can return NULL
192  myItems[i] = item;
193  myItems[i]->SetInTrade();
194  }
195 
196  if (Item* item = hisTrade->GetItem(TradeSlots(i)))
197  {
198  TC_LOG_DEBUG("network", "partner trade %s bag: %u slot: %u", item->GetGUID().ToString().c_str(), item->GetBagSlot(), item->GetSlot());
199  hisItems[i] = item;
200  hisItems[i]->SetInTrade();
201  }
202  }
203 }
void SetInAcceptProcess(bool state)
Definition: TradeData.h:62
void SetInTrade(bool b=true)
Definition: Item.h:312
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Item * GetItem(TradeSlots slot) const
Definition: TradeData.cpp:27
TradeSlots
Definition: TradeData.h:23
Definition: Item.h:259
uint8_t uint8
Definition: Define.h:152
Definition: TradeData.h:26

+ Here is the call graph for this function:

+ Here is the caller graph for this function: