예제 #1
0
 public void AddMessageToSelectedChannel(ChatChannel channel, string msg)
 {
     if (channel != null)
     {
         channel.Add("Bot", msg);
     }
 }
예제 #2
0
    private void PostHelpToCurrentChannel()
    {
        ChatChannel channelForHelp = this.selectedChannel;

        if (channelForHelp != null)
        {
            channelForHelp.Add("info", ChatGui.HelpText);
        }
        else
        {
            Debug.LogError("no channel for help");
        }
    }
예제 #3
0
    public void AddMessageToSelectedChannel(string msg)
    {
        ChatChannel chatChannel = null;

        if (!this.chatClient.TryGetChannel(this.selectedChannelName, out chatChannel))
        {
            Debug.Log("AddMessageToSelectedChannel failed to find channel: " + this.selectedChannelName);
            return;
        }
        if (chatChannel != null)
        {
            chatChannel.Add("Bot", msg);
        }
    }
예제 #4
0
    /// <summary>
    /// 通知红包领取
    /// </summary>
    /// <param name="cmd"></param>
    public void OnNoticeRedEnveLopeInfo(stNoticeRedPacketChatUserCmd_S cmd)
    {
        RedPacket rp = new RedPacket();

        rp.status = (uint)RedPacketStatus.eRedPacketNormal;
        rp.title  = cmd.title;
        rp.id     = cmd.id;
        rp.name   = cmd.name;
        AddPacket(cmd.world, rp);
        ChangeRedStatus(cmd.id, RedPacketStatus.eRedPacketNormal);
        SortAllRedPacket();
        if (!DataManager.Manager <UIPanelManager>().IsShowPanel(PanelID.RedEnvelopePanel))
        {
            DataManager.Manager <UIPanelManager>().ShowPanel(PanelID.RedEnvelopeTakePanel, jumpData: new UIPanelBase.PanelJumpData()
            {
                Param = cmd
            });
        }
        uint        langTextID = 140001;
        ChatChannel channel    = DataManager.Manager <ChatDataManager>().GetChannelByType(CHATTYPE.CHAT_WORLD);

        if (!cmd.world)
        {
            langTextID = 140002;
            channel    = DataManager.Manager <ChatDataManager>().GetChannelByType(CHATTYPE.CHAT_CLAN);
        }
        stSendInfoReminderChatUserCmd_S chatCmd = new stSendInfoReminderChatUserCmd_S();

        chatCmd.id     = langTextID;
        chatCmd.szInfo = new List <string> {
            cmd.name
        };
        Protocol.Instance.OnReceiveRemindText(chatCmd);
        uint moneyType = GameTableManager.Instance.GetGlobalConfig <uint>("UserRedEnvelopeCurrencyType");
        uint maxNum    = GameTableManager.Instance.GetGlobalConfig <uint>("UserRedEnvelopeCurrencyNum");

        if (cmd.money_type == moneyType)
        {
            if (cmd.gold >= maxNum)
            {
                DispatchValueUpdateEvent(RedEnveLopeEvent.ShowRedEffect.ToString(), null, null);
            }
        }


        if (channel != null)
        {
            channel.Add(channel.ToChatInfoWithRedPackgetMsg(cmd));
        }
    }
예제 #5
0
    public void OnStatusUpdate(string user, int status, bool gotMessage, object message)
    {
        // This is how you get the status updates of friends.
        // Demo simply adds status updates to the currently shown chat.
        // You could buffer them or use them any other way, too.

        ChatChannel activeChannel = this.selectedChannel;

        if (activeChannel != null)
        {
            activeChannel.Add("info", string.Format("{0} is {1}. Msg:{2}", user, status, message));
        }
        Debug.LogWarning("status: " + string.Format("{0} is {1}. Msg:{2}", user, status, message));
    }
예제 #6
0
    [Execute]//喇叭默认走马灯
    public void Excute(GameCmd.stSpeakerChatUserCmd_CS cmd)
    {
        if (!ChatDataManager.CanRecieveChatMsgWithBlack(cmd.dwOPDes))
        {
            return;
        }
        ShowRunlight(cmd.szInfo, RunLightInfo.Pos.Top, cmd.username);

        ChatChannel channel = DataManager.Manager <ChatDataManager>().GetChannelByType(CHATTYPE.CHAT_WORLD);

        if (channel != null)
        {
            channel.Add(channel.ToChatInfo(cmd));
        }
    }
예제 #7
0
    public void AddMessageToSelectedChannel(string msg)
    {
        ChatChannel channel = null;
        bool        found   = this.chatClient.TryGetChannel(this.selectedChannelName, out channel);

        if (!found)
        {
            Debug.Log("AddMessageToSelectedChannel failed to find channel: " + this.selectedChannelName);
            return;
        }

        if (channel != null)
        {
            channel.Add("Bot", msg, 0);             //TODO: how to use msgID?
        }
    }
예제 #8
0
    public void ExecuteChatCmd(GameCmd.stWildChannelCommonChatUserCmd_CS cmd)
    {
        if (!ChatDataManager.CanRecieveChatMsgWithBlack(cmd.dwOPDes))
        {
            return;
        }
        if (cmd.byChatType == GameCmd.CHATTYPE.CHAT_SYS)
        {
            if ((cmd.byChatPos & (uint)GameCmd.ChatPos.ChatPos_Tips) == (uint)GameCmd.ChatPos.ChatPos_Tips)
            {
                TipsManager.Instance.ShowTips(cmd.szInfo);
            }

            if ((cmd.byChatPos & (uint)GameCmd.ChatPos.ChatPos_Sys_chat) == (uint)GameCmd.ChatPos.ChatPos_Sys_chat)
            {
                DataManager.Manager <ChatDataManager>().PrivateChatManager.AddChat(new GameCmd.stCommonMChatUserCmd_CS()
                {
                    szInfo     = cmd.szInfo,
                    byChatType = CHATTYPE.CHAT_SYS,
                    dwOPDes    = 0,
                    szOPDes    = "系统",
                });
                return;
            }
        }

        ChatChannel channel = DataManager.Manager <ChatDataManager>().GetChannelByType(cmd.byChatType);

        if (channel != null)
        {
            channel.Add(channel.ToChatInfo(cmd));
        }

        if ((GameCmd.ChatPos)cmd.byChatPos == GameCmd.ChatPos.ChatPos_Gm ||
            (GameCmd.ChatPos)cmd.byChatPos == GameCmd.ChatPos.ChatPos_Important)
        {
            ShowRunlight(cmd.szInfo, RunLightInfo.Pos.Top);
        }
        //下走马灯 不显示
        if ((GameCmd.ChatPos)cmd.byChatPos == GameCmd.ChatPos.ChatPos_Sys &&
            DataManager.Manager <ChatDataManager>().SimpleChannelContain(CHATTYPE.CHAT_SYS))
        {
            ShowRunlight(cmd.szInfo, RunLightInfo.Pos.Bottom);
        }
    }