public void Invoke(Player player)
        {
            Locale       loc_idx = player.GetSession().GetSessionDbLocaleIndex();
            ServerPacket messageTemplate;

            // create if not cached yet
            if (!_packetCache.ContainsKey(loc_idx))
            {
                messageTemplate       = _builder.Invoke(loc_idx);
                _packetCache[loc_idx] = messageTemplate;
            }
            else
            {
                messageTemplate = _packetCache[loc_idx];
            }

            ChatPkt message = (ChatPkt)messageTemplate;

            switch (_msgType)
            {
            case ChatMsg.MonsterWhisper:
            case ChatMsg.RaidBossWhisper:
                message.SetReceiver(player, loc_idx);
                break;

            default:
                break;
            }

            player.SendPacket(message);
        }
示例#2
0
        public void Invoke(Player player)
        {
            Locale           loc_idx = player.GetSession().GetSessionDbLocaleIndex();
            ChatPacketSender sender;

            // create if not cached yet
            if (!_packetCache.ContainsKey(loc_idx))
            {
                sender = _builder.Invoke(loc_idx);
                _packetCache[loc_idx] = sender;
            }
            else
            {
                sender = _packetCache[loc_idx];
            }

            switch (_msgType)
            {
            case ChatMsg.MonsterWhisper:
            case ChatMsg.RaidBossWhisper:
                ChatPkt message = sender.UntranslatedPacket;
                message.SetReceiver(player, loc_idx);
                player.SendPacket(message);
                break;

            default:
                break;
            }

            sender.Invoke(player);
        }