aboutsummaryrefslogtreecommitdiff
path: root/src/game/GridNotifiersImpl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/GridNotifiersImpl.h')
-rw-r--r--src/game/GridNotifiersImpl.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h
index aee78386b6d..525402f0a1c 100644
--- a/src/game/GridNotifiersImpl.h
+++ b/src/game/GridNotifiersImpl.h
@@ -539,5 +539,30 @@ void Trinity::PlayerSearcher<Check>::Visit(PlayerMapType &m)
}
}
+template<class Builder>
+void MaNGOS::LocalizedPacketDo<Builder>::operator()( Player* p )
+{
+ uint32 loc_idx = p->GetSession()->GetSessionDbLocaleIndex();
+ uint32 cache_idx = loc_idx+1;
+ WorldPacket* data;
+
+ // create if not cached yet
+ if(i_data_cache.size() < cache_idx+1 || !i_data_cache[cache_idx])
+ {
+ if(i_data_cache.size() < cache_idx+1)
+ i_data_cache.resize(cache_idx+1);
+
+ data = new WorldPacket(SMSG_MESSAGECHAT, 200);
+
+ i_builder(*data,loc_idx);
+
+ i_data_cache[cache_idx] = data;
+ }
+ else
+ data = i_data_cache[cache_idx];
+
+ p->SendDirectMessage(data);
+}
+
#endif // TRINITY_GRIDNOTIFIERSIMPL_H