Exemple #1
0
 protected override void SetContent(string text_channel, string text_senderName, string text_chatContent, string datetime)
 {
     if (ChatManager.IsVoice(this.m_chatInfo))
     {
         text_chatContent = "[语音]";
     }
     ResourceManager.SetIconSprite(this.m_spChannelIcon, ChannelBit.GetChannelIcon(this.m_chatInfo.src_channel));
     base.SetContent(ChatInfo2Tip.ChannelBlank + text_senderName + text_chatContent, datetime);
 }
 private void Add2ChatTipUI(int dstChannels, ChatManager.ChatInfo chatInfo)
 {
     for (int i = 0; i < ChannelBit.all_channelviews.Length; i++)
     {
         if (ChannelBit.IsContainChannel(dstChannels, ChannelBit.all_channelviews[i]) && !this.CheckIsChannelMaskOn(ChannelBit.all_channelviews[i]))
         {
             ChatTipUIViewModel.AddChat(chatInfo);
             return;
         }
     }
 }
 private void Add2ChatUI(int dstChannels, ChatManager.ChatInfo chatInfo)
 {
     for (int i = 0; i < ChannelBit.all_channelviews.Length; i++)
     {
         if (ChannelBit.IsContainChannel(dstChannels, ChannelBit.all_channelviews[i]))
         {
             this.ChatNews.get_Item(ChannelBit.all_channelviews[i]).Add(chatInfo);
             if (ChannelBit.all_channelviews[i] == 4)
             {
                 this.CheckPrivateBadge();
             }
         }
     }
 }
    private void OnChatNotifyRes(short state, ChatNotify down = null)
    {
        if (state != 0)
        {
            StateManager.Instance.StateShow(state, 0);
            return;
        }
        List <TalkMsg> msgs = down.msgs;

        for (int i = 0; i < msgs.get_Count(); i++)
        {
            TalkMsg talkMsg     = msgs.get_Item(i);
            int     srcChannel  = ChannelBit.Server2ClientChannel(talkMsg.type);
            int     dstChannels = ChannelBit.GetDstChannels(srcChannel, talkMsg.sender.id);
            this.Add2Channels(srcChannel, dstChannels, talkMsg);
        }
        this.RefreshCurrentChatChannel();
    }
    public void ServerStringReceive(string msg)
    {
        int dstChannels = ChannelBit.GetDstChannels(8, 0L);

        ChatManager.ChatInfo chatInfo = this.GetChatInfo(64, dstChannels, new TalkMsg
        {
            content = new ArticleContent(),
            content =
            {
                text = msg
            }
        });
        chatInfo.viplevel          = -1;
        chatInfo.sender_uid        = -1L;
        chatInfo.sender_occupation = 0;
        chatInfo.items             = new List <DetailInfo>();
        chatInfo.time = this.GetServerTimeString(TimeManager.Instance.PreciseServerTime);
        this.Add2ChatUI(dstChannels, chatInfo);
        this.Add2ChatTipUI(dstChannels, chatInfo);
        this.RefreshCurrentChatChannel();
    }
 public void Send(int channel2Client, string chatContent, List <DetailInfo> items, long targetId)
 {
     if (!string.IsNullOrEmpty(chatContent) || (items != null && items.get_Count() > 0))
     {
         chatContent = this.FilterFacePlaceholder(chatContent, true);
         if (chatContent.get_Length() > ChatManager.MAX_NUM_2_CHAR)
         {
             UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(502064, false));
             return;
         }
         if (this.FaceInfos.get_Count() > ChatManager.MAX_NUM_2_FACE)
         {
             UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(502063, false));
             return;
         }
         string text2chat;
         WordFilter.filter(chatContent, out text2chat, 3, false, false, "*");
         this.SendTalk(ChannelBit.Client2ServerChannel(channel2Client), text2chat, items, targetId, this.FaceInfos);
     }
     else
     {
         UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(502061, false));
     }
 }