OregonCore  revision be9e804-git
Your Favourite TBC server
WorldObjectChangeAccumulator Struct Reference

Public Member Functions

 WorldObjectChangeAccumulator (WorldObject &obj, UpdateDataMapType &d)
 
void Visit (PlayerMapType &m)
 
void Visit (CreatureMapType &m)
 
void Visit (DynamicObjectMapType &m)
 
void BuildPacket (Player *plr)
 
template<class SKIP >
void Visit (GridRefManager< SKIP > &)
 

Public Attributes

UpdateDataMapTypei_updateDatas
 
WorldObjecti_object
 
std::set< uint64plr_list
 

Detailed Description

Definition at line 2657 of file Object.cpp.

Constructor & Destructor Documentation

WorldObjectChangeAccumulator::WorldObjectChangeAccumulator ( WorldObject obj,
UpdateDataMapType d 
)
inline

Definition at line 2662 of file Object.cpp.

2662 : i_updateDatas(d), i_object(obj) {}
UpdateDataMapType & i_updateDatas
Definition: Object.cpp:2659

Member Function Documentation

void WorldObjectChangeAccumulator::BuildPacket ( Player plr)
inline

Definition at line 2703 of file Object.cpp.

References Object::BuildFieldsUpdate(), Object::GetGUID(), and Player::HaveAtClient().

2704  {
2705  // Only send update once to a player
2706  if (plr_list.find(plr->GetGUID()) == plr_list.end() && plr->HaveAtClient(&i_object))
2707  {
2709  plr_list.insert(plr->GetGUID());
2710  }
2711  }
void BuildFieldsUpdate(Player *, UpdateDataMapType &) const
Definition: Object.cpp:688
std::set< uint64 > plr_list
Definition: Object.cpp:2661
UpdateDataMapType & i_updateDatas
Definition: Object.cpp:2659
uint64 GetGUID() const
Definition: Object.h:177
bool HaveAtClient(WorldObject const *u) const
Definition: Player.cpp:18689
void WorldObjectChangeAccumulator::Visit ( PlayerMapType m)
inline

Definition at line 2663 of file Object.cpp.

References GridRefManager< OBJECT >::begin(), and GridRefManager< OBJECT >::end().

2664  {
2665  for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
2666  {
2667  BuildPacket(iter->GetSource());
2668  if (!iter->GetSource()->GetSharedVisionList().empty())
2669  {
2670  SharedVisionList::const_iterator it = iter->GetSource()->GetSharedVisionList().begin();
2671  for (; it != iter->GetSource()->GetSharedVisionList().end(); ++it)
2672  BuildPacket(*it);
2673  }
2674  }
2675  }
void BuildPacket(Player *plr)
Definition: Object.cpp:2703
iterator end()
iterator begin()
void WorldObjectChangeAccumulator::Visit ( CreatureMapType m)
inline

Definition at line 2677 of file Object.cpp.

References GridRefManager< OBJECT >::begin(), and GridRefManager< OBJECT >::end().

2678  {
2679  for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
2680  {
2681  if (!iter->GetSource()->GetSharedVisionList().empty())
2682  {
2683  SharedVisionList::const_iterator it = iter->GetSource()->GetSharedVisionList().begin();
2684  for (; it != iter->GetSource()->GetSharedVisionList().end(); ++it)
2685  BuildPacket(*it);
2686  }
2687  }
2688  }
void BuildPacket(Player *plr)
Definition: Object.cpp:2703
iterator end()
iterator begin()
void WorldObjectChangeAccumulator::Visit ( DynamicObjectMapType m)
inline

Definition at line 2689 of file Object.cpp.

References GridRefManager< OBJECT >::begin(), GridRefManager< OBJECT >::end(), ObjectAccessor::FindPlayer(), IS_PLAYER_GUID, and PLAYER_FARSIGHT.

2690  {
2691  for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
2692  {
2693  uint64 guid = iter->GetSource()->GetCasterGUID();
2694  if (IS_PLAYER_GUID(guid))
2695  {
2696  //Caster may be NULL if DynObj is in removelist
2697  if (Player* caster = ObjectAccessor::FindPlayer(guid))
2698  if (caster->GetUInt64Value(PLAYER_FARSIGHT) == iter->GetSource()->GetGUID())
2699  BuildPacket(caster);
2700  }
2701  }
2702  }
#define IS_PLAYER_GUID(Guid)
Definition: ObjectGuid.h:69
void BuildPacket(Player *plr)
Definition: Object.cpp:2703
static Player * FindPlayer(uint64, bool force=false)
iterator end()
ACE_UINT64 uint64
Definition: Define.h:70
iterator begin()
Definition: Player.h:923
template<class SKIP >
void WorldObjectChangeAccumulator::Visit ( GridRefManager< SKIP > &  )
inline

Definition at line 2713 of file Object.cpp.

2713 {}

Member Data Documentation

WorldObject& WorldObjectChangeAccumulator::i_object

Definition at line 2660 of file Object.cpp.

UpdateDataMapType& WorldObjectChangeAccumulator::i_updateDatas

Definition at line 2659 of file Object.cpp.

std::set<uint64> WorldObjectChangeAccumulator::plr_list

Definition at line 2661 of file Object.cpp.


The documentation for this struct was generated from the following file: