Exemplo n.º 1
0
        public void Add_ChatEntity(CChatEntity chatEnt, EChatChannel type, ulong ullUid = 0uL, uint dwLogicWorldId = 0u)
        {
            CChatChannel cChatChannel = this._getChannel(type, ullUid, dwLogicWorldId);

            if (cChatChannel == null)
            {
                cChatChannel = this.CreateChannel(type, ullUid, dwLogicWorldId);
            }
            if (chatEnt.type != EChaterType.System || chatEnt.type != EChaterType.OfflineInfo)
            {
                if (Singleton <CChatController> .get_instance().view.ChatParser != null)
                {
                    Singleton <CChatController> .get_instance().view.ChatParser.bProc_ChatEntry = false;

                    Singleton <CChatController> .get_instance().view.ChatParser.maxWidth = CChatParser.chat_list_max_width;

                    Singleton <CChatController> .get_instance().view.ChatParser.Parse(chatEnt.text, CChatParser.start_x, chatEnt);
                }
                else
                {
                    DebugHelper.Assert(false, "CChatController.instance.view.ChatParser = null! StackTrace = " + new StackTrace().ToString());
                }
            }
            CChatEntity last = cChatChannel.GetLast();

            if (last != null && last.time != 0 && chatEnt.time - last.time > 60)
            {
                cChatChannel.Add(CChatUT.Build_4_Time());
            }
            cChatChannel.Add(chatEnt);
        }
Exemplo n.º 2
0
        public void Add_ChatEntity(CChatEntity chatEnt, EChatChannel type, ulong ullUid = 0, uint dwLogicWorldId = 0)
        {
            CChatChannel channel = this._getChannel(type, ullUid, dwLogicWorldId);

            if (channel == null)
            {
                channel = this.CreateChannel(type, ullUid, dwLogicWorldId);
            }
            if (chatEnt.type != EChaterType.System)
            {
                Singleton <CChatController> .instance.view.ChatParser.bProc_ChatEntry = false;
                Singleton <CChatController> .instance.view.ChatParser.maxWidth        = CChatParser.chat_list_max_width;
                Singleton <CChatController> .instance.view.ChatParser.Parse(chatEnt.text, CChatParser.start_x, chatEnt);
            }
            CChatEntity last = channel.GetLast();

            if (((last != null) && (last.time != 0)) && ((chatEnt.time - last.time) > 60))
            {
                channel.Add(CChatUT.Build_4_Time());
            }
            channel.Add(chatEnt);
        }