AzerothCore 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
1729: i_builder(builder) {}
Builder & i_builder
Definition: GridNotifiers.h:1740

◆ ~LocalizedPacketListDo()

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

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

Member Function Documentation

◆ operator()()

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

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