mirror of
https://github.com/mangosfour/server.git
synced 2025-12-21 10:37:06 +00:00
[7411] Use similar localization classes for World::SendWorldText muti-line message.
This commit is contained in:
parent
c9ca06a630
commit
f42815f04b
4 changed files with 109 additions and 43 deletions
|
|
@ -562,4 +562,28 @@ void MaNGOS::LocalizedPacketDo<Builder>::operator()( Player* p )
|
|||
p->SendDirectMessage(data);
|
||||
}
|
||||
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue