Пример #1
0
 private void OnErrorCodeNtf(int errorCode)
 {
     if (errorCode == 0x8a)
     {
         CChatChannel channel = this.model.channelMgr.GetChannel(EChatChannel.Lobby);
         if (channel != null)
         {
             channel.ClearCd();
             if (this.view != null)
             {
                 this.view.Refresh_ChatInputView();
             }
         }
     }
     else if (errorCode == 0x89)
     {
         CChatChannel channel2 = this.model.channelMgr.GetChannel(EChatChannel.Lobby);
         if (channel2 != null)
         {
             channel2.Start_InputCD();
             if (this.view != null)
             {
                 this.view.Refresh_ChatInputView();
             }
         }
     }
 }
Пример #2
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);
        }
Пример #3
0
        public void Clear(EChatChannel type, ulong ullUid = 0uL, uint dwLogicWorldId = 0u)
        {
            CChatChannel cChatChannel = this._getChannel(type, ullUid, dwLogicWorldId);

            if (cChatChannel != null)
            {
                cChatChannel.Clear();
            }
        }
Пример #4
0
        public int GetUnreadCount(EChatChannel type, ulong ullUid = 0uL, uint dwLogicWorldId = 0u)
        {
            CChatChannel cChatChannel = this._getChannel(type, ullUid, dwLogicWorldId);

            if (cChatChannel == null)
            {
                cChatChannel = this.CreateChannel(type, ullUid, dwLogicWorldId);
            }
            return(cChatChannel.GetUnreadCount());
        }
Пример #5
0
        public CChatChannel GetFriendChannel(ulong ullUid = 0uL, uint dwLogicWorldId = 0u)
        {
            CChatChannel cChatChannel = this._getChannel(EChatChannel.Friend, ullUid, dwLogicWorldId);

            if (cChatChannel == null)
            {
                cChatChannel = this.CreateChannel(EChatChannel.Friend, ullUid, dwLogicWorldId);
            }
            return(cChatChannel);
        }
Пример #6
0
        public CChatChannel GetChannel(EChatChannel type)
        {
            CChatChannel cChatChannel = this._getChannel(type, 0uL, 0u);

            if (cChatChannel == null)
            {
                cChatChannel = this.CreateChannel(type, 0uL, 0u);
            }
            return(cChatChannel);
        }
Пример #7
0
        public int GetAllFriendUnreadCount()
        {
            int num = 0;

            for (int i = 0; i < this.FriendChannelList.Count; i++)
            {
                CChatChannel cChatChannel = this.FriendChannelList[i];
                num += cChatChannel.GetUnreadCount();
            }
            return(num);
        }
Пример #8
0
        public int GetFriendTotal_UnreadCount()
        {
            int num = 0;

            for (int i = 0; i < this.FriendChannelList.Count; i++)
            {
                CChatChannel      cChatChannel    = this.FriendChannelList[i];
                COMDT_FRIEND_INFO gameOrSnsFriend = Singleton <CFriendContoller> .instance.model.GetGameOrSnsFriend(cChatChannel.ullUid, cChatChannel.dwLogicWorldId);

                if (gameOrSnsFriend != null && gameOrSnsFriend.bIsOnline == 1)
                {
                    num += cChatChannel.GetUnreadCount();
                }
            }
            return(num);
        }
Пример #9
0
        public static int FriendDataSortForChatFriendList(COMDT_FRIEND_INFO l, COMDT_FRIEND_INFO r)
        {
            if ((l != r) && ((l != null) && (r != null)))
            {
                CChatChannel friendChannel = Singleton <CChatController> .instance.model.channelMgr.GetFriendChannel(r.stUin.ullUid, r.stUin.dwLogicWorldId);

                CChatChannel channel2 = Singleton <CChatController> .instance.model.channelMgr.GetFriendChannel(l.stUin.ullUid, l.stUin.dwLogicWorldId);

                if (r.bIsOnline == l.bIsOnline)
                {
                    if (friendChannel.GetUnreadCount() != channel2.GetUnreadCount())
                    {
                        return(friendChannel.GetUnreadCount() - channel2.GetUnreadCount());
                    }
                    if (r.dwPvpLvl > l.dwPvpLvl)
                    {
                        return(1);
                    }
                    if (r.dwPvpLvl < l.dwPvpLvl)
                    {
                        return(-1);
                    }
                    return(0);
                }
                if (l.bIsOnline < r.bIsOnline)
                {
                    if (channel2.GetUnreadCount() > 0)
                    {
                        return(-1);
                    }
                    return(1);
                }
                if (r.bIsOnline < l.bIsOnline)
                {
                    if (friendChannel.GetUnreadCount() > 0)
                    {
                        return(1);
                    }
                    return(-1);
                }
            }
            return(0);
        }
Пример #10
0
        public CChatChannel CreateChannel(EChatChannel type, ulong ullUid = 0, uint dwLogicWorldId = 0)
        {
            CChatChannel item = this._getChannel(type, ullUid, dwLogicWorldId);

            if (item == null)
            {
                if (type != EChatChannel.Friend)
                {
                    item = new CChatChannel(type, 0, 0L, 0);
                    this.NormalChannelList.Add(item);
                    return(item);
                }
                item = new CChatChannel(type, 0x1b58, ullUid, dwLogicWorldId);
                item.list.Add(CChatUT.Build_4_System(Singleton <CTextManager> .instance.GetText("Chat_Common_Tips_4")));
                item.ReadAll();
                this.FriendChannelList.Add(item);
            }
            return(item);
        }
Пример #11
0
        public ListView <COMDT_FRIEND_INFO> GetValidChatFriendList()
        {
            this.cache_chatFriends_Results.Clear();
            COMDT_FRIEND_INFO            a     = null;
            ListView <COMDT_FRIEND_INFO> list  = this.GetList(FriendType.GameFriend);
            ListView <COMDT_FRIEND_INFO> view2 = this.GetList(FriendType.SNS);

            for (int i = 0; i < view2.Count; i++)
            {
                a = view2[i];
                if ((a != null) && (OnlineFinder(a) && (this.GetItemIndex(a.stUin.ullUid, a.stUin.dwLogicWorldId, this.cache_chatFriends_Results) == -1)))
                {
                    this.cache_chatFriends_Results.Add(a);
                }
            }
            for (int j = 0; j < list.Count; j++)
            {
                a = list[j];
                if ((a != null) && (OnlineFinder(a) && (this.GetItemIndex(a.stUin.ullUid, a.stUin.dwLogicWorldId, this.cache_chatFriends_Results) == -1)))
                {
                    this.cache_chatFriends_Results.Add(a);
                }
            }
            CChatChannel            channel           = null;
            ListView <CChatChannel> friendChannelList = Singleton <CChatController> .instance.model.channelMgr.FriendChannelList;

            for (int k = 0; k < friendChannelList.Count; k++)
            {
                channel = friendChannelList[k];
                if ((channel != null) && (channel.HasAnyValidChatEntity() && (this.GetItemIndex(channel.ullUid, channel.dwLogicWorldId, this.cache_chatFriends_Results) == -1)))
                {
                    COMDT_FRIEND_INFO gameOrSnsFriend = this.GetGameOrSnsFriend(channel.ullUid, channel.dwLogicWorldId);
                    if (gameOrSnsFriend != null)
                    {
                        this.cache_chatFriends_Results.Add(gameOrSnsFriend);
                    }
                }
            }
            return(this.cache_chatFriends_Results);
        }
Пример #12
0
        public CChatChannel CreateChannel(EChatChannel type, ulong ullUid = 0uL, uint dwLogicWorldId = 0u)
        {
            CChatChannel cChatChannel = this._getChannel(type, ullUid, dwLogicWorldId);

            if (cChatChannel != null)
            {
                return(cChatChannel);
            }
            if (type != EChatChannel.Friend)
            {
                cChatChannel = new CChatChannel(type, 0u, 0uL, 0u);
                this.NormalChannelList.Add(cChatChannel);
            }
            else
            {
                cChatChannel = new CChatChannel(type, 7000u, ullUid, dwLogicWorldId);
                cChatChannel.list.Add(CChatUT.Build_4_System(Singleton <CTextManager> .instance.GetText("Chat_Common_Tips_4")));
                cChatChannel.ReadAll();
                this.FriendChannelList.Add(cChatChannel);
            }
            return(cChatChannel);
        }
Пример #13
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);
        }