AzeorthCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::LocalizedPacketListDo< Builder > Class Template Reference

#include "GridNotifiers.h"

Public Types

typedef std::vector< WorldPacket * > WorldPacketList
 

Public Member Functions

 LocalizedPacketListDo (Builder &builder)
 
 ~LocalizedPacketListDo ()
 
void operator() (Player *p)
 

Private Attributes

Builder & i_builder
 
std::vector< WorldPacketListi_data_cache
 

Detailed Description

template<class Builder>
class Acore::LocalizedPacketListDo< Builder >

Member Typedef Documentation

◆ WorldPacketList

template<class Builder >
typedef std::vector<WorldPacket*> Acore::LocalizedPacketListDo< Builder >::WorldPacketList

Constructor & Destructor Documentation

◆ LocalizedPacketListDo()

template<class Builder >
Acore::LocalizedPacketListDo< Builder >::LocalizedPacketListDo ( Builder &  builder)
inlineexplicit
1728: i_builder(builder) {}
Builder & i_builder
Definition: GridNotifiers.h:1739

◆ ~LocalizedPacketListDo()

template<class Builder >
Acore::LocalizedPacketListDo< Builder >::~LocalizedPacketListDo ( )
inline
1731 {
1732 for (size_t i = 0; i < i_data_cache.size(); ++i)
1733 for (size_t j = 0; j < i_data_cache[i].size(); ++j)
1734 delete i_data_cache[i][j];
1735 }
std::vector< WorldPacketList > i_data_cache
Definition: GridNotifiers.h:1740

References Acore::LocalizedPacketListDo< Builder >::i_data_cache.

Member Function Documentation

◆ operator()()

template<class Builder >
void Acore::LocalizedPacketListDo< Builder >::operator() ( Player p)
565{
567 uint32 cache_idx = loc_idx + 1;
568 WorldPacketList* data_list;
569
570 // create if not cached yet
571 if (i_data_cache.size() < cache_idx + 1 || i_data_cache[cache_idx].empty())
572 {
573 if (i_data_cache.size() < cache_idx + 1)
574 i_data_cache.resize(cache_idx + 1);
575
576 data_list = &i_data_cache[cache_idx];
577
578 i_builder(*data_list, loc_idx);
579 }
580 else
581 data_list = &i_data_cache[cache_idx];
582
583 for (size_t i = 0; i < data_list->size(); ++i)
584 p->SendDirectMessage((*data_list)[i]);
585}
LocaleConstant
Definition: Common.h:74
std::uint32_t uint32
Definition: Define.h:108
void SendDirectMessage(WorldPacket const *data) const
Definition: Player.cpp:5578
WorldSession * GetSession() const
Definition: Player.h:1947
std::vector< WorldPacket * > WorldPacketList
Definition: GridNotifiers.h:1727
LocaleConstant GetSessionDbLocaleIndex() const
Definition: WorldSession.h:495

References Player::GetSession(), WorldSession::GetSessionDbLocaleIndex(), and Player::SendDirectMessage().

Member Data Documentation

◆ i_builder

template<class Builder >
Builder& Acore::LocalizedPacketListDo< Builder >::i_builder
private

◆ i_data_cache

template<class Builder >
std::vector<WorldPacketList> Acore::LocalizedPacketListDo< Builder >::i_data_cache
private