diff options
Diffstat (limited to 'src/game/GridNotifiersImpl.h')
-rw-r--r-- | src/game/GridNotifiersImpl.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h index 6ec8c59082e..20e72047055 100644 --- a/src/game/GridNotifiersImpl.h +++ b/src/game/GridNotifiersImpl.h @@ -584,5 +584,28 @@ void MaNGOS::LocalizedPacketDo<Builder>::operator()( Player* p ) p->SendDirectMessage(data); } -#endif // TRINITY_GRIDNOTIFIERSIMPL_H +template<class Builder> +void MaNGOS::LocalizedPacketListDo<Builder>::operator()( Player* p ) +{ + uint32 loc_idx = p->GetSession()->GetSessionDbLocaleIndex(); + uint32 cache_idx = loc_idx+1; + WorldPacketList* data_list; + + // create if not cached yet + if(i_data_cache.size() < cache_idx+1 || i_data_cache[cache_idx].empty()) + { + if(i_data_cache.size() < cache_idx+1) + i_data_cache.resize(cache_idx+1); + + data_list = &i_data_cache[cache_idx]; + + i_builder(*data_list,loc_idx); + } + else + data_list = &i_data_cache[cache_idx]; + + for(size_t i = 0; i < data_list->size(); ++i) + p->SendDirectMessage((*data_list)[i]); +} +#endif // MANGOS_GRIDNOTIFIERSIMPL_H |