コード例 #1
0
        public IReadOnlyList <ChatPost> GetChatMessages()
        {
            ModelUpdateChat dc;

            dc = _sessionClient.UpdateChat(Data.ChatsTime);
            if (dc == null)
            {
                Data.LastServerConnectFail = true;
                if (!Data.ServerConnected)
                {
                    Disconnected();
                }

                return(null);
            }

            Data.LastServerConnectFail = false;
            Data.LastServerConnect     = DateTime.UtcNow;
            var lastMessage = string.Empty;

            Data.ApplyChats(dc, ref lastMessage);
            var result = new List <ChatPost>(dc.Chats[0].Posts.Where(x => x.Time > Chanel2Server.LastOnlineTime));

            Chanel2Server.LastOnlineTime = Data.ChatsTime;

            return(result);
        }
コード例 #2
0
ファイル: ChatProvider.cs プロジェクト: ldoubil/OnlineCity
        public void UpdateChats()
        {
            ModelUpdateChat dc;

            dc = _sessionClient.UpdateChat(Data.ChatsTime);
            if (dc == null)
            {
                Data.LastServerConnectFail = true;
                if (!Data.ServerConnected)
                {
                    Disconnected();
                }

                return;
            }

            Data.LastServerConnectFail = false;
            Data.LastServerConnect     = DateTime.UtcNow;
            var lastMessage = string.Empty;

            Data.ApplyChats(dc, ref lastMessage);
        }
コード例 #3
0
        public void UpdateChats()
        {
            ModelUpdateChat dc = _sessionClient.UpdateChat(_modelUpdateTime);

            if (dc == null)
            {
                Data.LastServerConnectFail = true;
                if (Data.ServerConnected)
                {
                    Disconnected();
                }

                return;
            }

            _modelUpdateTime.Time      = dc.Time;
            _modelUpdateTime.Value     = dc.LastChatPostId;
            Data.LastServerConnectFail = false;
            Data.LastServerConnect     = DateTime.UtcNow;
            var lastMessage = string.Empty;

            Data.ApplyChats(dc, ref lastMessage);
        }