Exemplo n.º 1
0
        public void AddDanmu(CommonActionSignalComment comment)
        {
            var match = Pattern.Match(HttpUtility.HtmlDecode(comment.Content));

            if (GameStart && match.Success)
            {
                _pendingDanmu.Add(new Danmu {
                    Timestamp = comment.SendTimeMs, UserId = comment.UserInfo.UserId, Nickname = comment.UserInfo.Nickname, Content = match.Groups[1].Value
                });
                OnPropertyChanged(nameof(PendingDanmu));
            }
        }
Exemplo n.º 2
0
        public void AddComment(CommonActionSignalComment comment)
        {
            var c = new Comment {
                Timestamp = comment.SendTimeMs, UserId = comment.UserInfo.UserId, Nickname = comment.UserInfo.Nickname, Content = HttpUtility.HtmlDecode(comment.Content)
            };

            _comments.Add(c);
            if (SearchStart && comment.Content.Contains(Pattern, StringComparison.OrdinalIgnoreCase) && !_pool.Any(c => c.UserId == comment.UserInfo.UserId))
            {
                _pool.Add(c);
                OnPropertyChanged(nameof(SearchStatus));
            }
            OnPropertyChanged(nameof(Comments));
        }